Hi
Still trying to get my head around events and scripts. Although this is the scripting section my question is regarding both but I figured that the scripters would know the best way to do what I want
I want to trigger a lamp to gradually come on over an hour before sunset. I have considered two options to do this.
1)
I have created an event group with four events. The first one checks the time and sets a counter from 0 to 1 when it's time to start the light coming on. Then there is a second event that runs once a minute (only when the counter is 1) that fires an event that runs a script to increase the lamp brightness. Lastly there is an event that checks the lamp brightness and once reached max sets the counter back to 0. This works fine but is a bit clunky
2)
I believe this approach to be simpler yet more versatile. I have just one event that runs when the time is right to start the lamp coming on. This event then runs a script. The script is essentially a for next loop that increases the brightness by 1 on each loop. I would then put a waitsecs in there to wait a minute before moving on in the loop.
What are your thoughts advice etc?
Still trying to get my head around events and scripts. Although this is the scripting section my question is regarding both but I figured that the scripters would know the best way to do what I want
I want to trigger a lamp to gradually come on over an hour before sunset. I have considered two options to do this.
1)
I have created an event group with four events. The first one checks the time and sets a counter from 0 to 1 when it's time to start the light coming on. Then there is a second event that runs once a minute (only when the counter is 1) that fires an event that runs a script to increase the lamp brightness. Lastly there is an event that checks the lamp brightness and once reached max sets the counter back to 0. This works fine but is a bit clunky
2)
I believe this approach to be simpler yet more versatile. I have just one event that runs when the time is right to start the lamp coming on. This event then runs a script. The script is essentially a for next loop that increases the brightness by 1 on each loop. I would then put a waitsecs in there to wait a minute before moving on in the loop.
What are your thoughts advice etc?
Comment