Hello, I have to realize a clock for turning lights ON and OFF with the possibility at any time to set the lights to ON and wait for the timer to turn them off and the other way around.
Example.
Light 1
Time on 10.00
Time off 15.00
if I turn them ON at 9.00 manually, i must be able to turn them on and they will turn off at 15.00
If I turn them OFF manually at 14.00 I have to be able to turn them off etc.
Are you looking for something like this rule below? It’s simple example of changing the temperature setpoint of my thermostats at 15:00 each day of the week, excluding the weekends.
rule "SCHEDULED: Reset the Thermostats"
when
Time cron "0 0 15 * * ? *"
then
if(Weekend.state == ON) return;
Livingroom_HRT4ZW_Setpoint.sendCommand(21)
Landing_HRT4ZW_Setpoint.sendCommand(20)
end
Since this is a request fo rhlep, I’ve moved it from the Tutorials & Examples category into Scripts & Rules.
I think you m\ay have mixed up some ons and offs in your description, which is making it hard to tell what you want to accomplish. More specific detail would be helpful for us to understand the issue.