I made automation for switching on the light on the movement. The light is turned on in two stages first turns on the power, then checked if the controller is not in the status of unavailable then in a loop sent commands to turn on, in a loop because the controller may show the status off, but in fact has not yet turned on.
And the question to avoid infinite loop how to limit the loop operation by say 1 minute or other time, I tried to put timeout: 00:01:00 but this command inside the repeat: block is not supported.
I have no idea what you are trying to do. I think you are making things more complicated than they really are…
Well to put that code into pseudo code, I get…
When a sensor changes from off to on
Turn on light A
If light B is available
Say True
If not available wait 1 minute.
repeat
turn on light B
While light B is off
Say True
I don’t get it…
Why are you saying true?
If you turned light B on, why do you expect it to ignore you and start yelling true at it?
Maybe I’m having a bad day, but I really don’t understand.
Did ChatGPT help you with this?
If we translate this code into pseudo-code, we get
If light B is available we stop waiting for it and proceed to turning it on
1 minute is a timeout, not a delay, after 1 minute we stop waiting, i.e. 1 minute is the maximum waiting time.