I need to turn on the switch1 for 10 seconds, them switch off. My rule is switch 1 - time after 10, next after 1 sec. Does anyone know how to write a procedure? I’m not a programmer
Not sure if I get your question completely, but the fundamental issue is that you are creating a loop here:
Item switch1 received a command, then you want 10 seconds (or you sleep actually, way worse: Why have my Rules stopped running? Why Thread::sleep is a bad idea) and then you send a command again to switch 1, which then receives a command, waits 10 seconds, sends another command, and so on…
I’m guessing, but that is just guessing, that you want something like this:
rule "switch1ON10"
when
Item switch1 received command ON
then
createTimer(now.plusSeconds(10))[| switch1.sendCommand(OFF) ]
end