Use of the wait command

Hello, I am stumped on this one. Probably comes about from my not understanding how to use the wait command.

I have a rule to turn on the lights a low level when somebody is stumbling around living room after dark. Itā€™s designed turn the lights off after a couple of minutes. However, sometimes I will awaken early And will go out and activate a rule called good morning which flexor switch GM1 to indicate to the Night lights rule that someone is up and not to turn off the lights again. However the lights go off anyway. Here is my code:
IF (Time between 22:00 and 06:00(T) AND
GM1(off) is off(T) [TRUE]) THEN
On: Inside Lights
Dim: Nightlights: 1
On: Inside colored lights
Dim: Inside colored lights: 5
Wait for condition: Port Mult Sensor inactive TRUE
Set color: Inside colored lights ->White
Dim: Nightlights: 0 --> delayed: 0:05:00 (cancelable)
Set color: Inside colored lights ->White ->Level: 0 --> delayed: 0:05:00 (cancelable)
Wait for events: GM1(off) turns on
Cancel Delayed Actions
END-IF

Does anybody see what Iā€™m doing wrong?

Put a time out on the wait of 6 min, only thing I can think is the waite is still pending from a previous rule run
Also are your sure the gm1 is turning on?
Enable loging and.post the results

You would need to turn GM1 on after the motion sensor has gone inactive to keep the lights on.
You could change "Wait for events: GM1(off) turns on" to a Wait for condition (with 5:01 timeout) and it should work no matter when you turn GM1 on.

The better option is use the Motion Lighting app rather than RM.

1 Like

Thanks, you solved it. It appears my Alexa integration was not turning on GM1. Appears to be working now.

Thanks for your help. I couldnā€™t quite get the motion lighting to do what I need it to.