I wanted to make a scene where I have three lights (later more lights). It should first dim one light from 0% to 100%, after that another one, and finally the last one. Objects that I have for lights are on/off, dim, value, on/off status and value status. Perhaps I only need value and value status objects. Can anyone help me how to write the script in lua? Script should be called when I press the button on touch panel or at a certain time of day.
25.08.2021, 08:49 (This post was last modified: 25.08.2021, 08:50 by lf96player.)
(25.08.2021, 08:29)Daniel. Wrote: Why don't you just use Scene for this?
I am using SpaceLYnk, and I can't find option to make it dim to 100%, and after that to start another light to do the same thing. I want to time for dimming of one light to be like 3-5s
This example will dim 3 lights from 0% to 100% in 10% steps with 0.2 seconds delay between each step. You can adjust the step/delay as needed and also add new group addresses to the list.
(25.08.2021, 09:26)admin Wrote: This example will dim 3 lights from 0% to 100% in 10% steps with 0.2 seconds delay between each step. You can adjust the step/delay as needed and also add new group addresses to the list.
It's a tiny bit faster since each grp.write call requires a database query. You can also use grp.write(addr, value, dt.scale) so no query is needed as the datatype is set directly.
(25.08.2021, 09:39)admin Wrote: It's a tiny bit faster since each grp.write call requires a database query. You can also use grp.write(addr, value, dt.scale) so no query is needed as the datatype is set directly.
(25.08.2021, 09:26)admin Wrote: This example will dim 3 lights from 0% to 100% in 10% steps with 0.2 seconds delay between each step. You can adjust the step/delay as needed and also add new group addresses to the list.
How can I make it go like that and then opposite. When the third light reaches 100%, then it should dim to 0%, then the second should dim to 0%, and then first. And how to make a loop that the whole process repeats again, and how to stop that loop?
Then you can create an event script (1-bit object) which can be used to turn the scene on and off:
Code:
123456
value = event.getvalue()
ifvaluethenscript.enable('light scene')
elsescript.disable('light scene')
end
How can I get this script to dim the first groupadress 0-100%, and at the same time thr first groupadres dims from 100-0%, the second goupadress dims from 0-100%?