Flashing light automation issue

I wrote a Rule Machine rule to flash a lamp if either of two contact sensors are reporting open when the lamp is turned on.

  • The lamp is a bedside lamp turned on prior to retiring for the night
  • The contact sensors tell me if sliding doors are unlocked (open) or locked (closed)
    So if the sliding doors are not both locked, the lamp flashes. This works great.

I would like the light to stop flashing once both contact sensors are closed. The problem is it stops in whatever state it is in when the last contact sensor is closed. So if the sliding door is locked and the contact sensor registers that when the flashing lamp is in the on state, the lamp remains on, without flashing, which is the desired behavior. But if the sliding door is locked and the contact sensor registers that when the flashing lamp is in the off state, the lamp remains off without flashing, which is NOT the desired behavior.

I think there is a better way to write this rule, so I'm requesting suggestions.
image

If this rule is triggered when the lamp is turned on, why not just have the rule turn it on as the last command?

The trigger for the rule is the light is turned on. Do you mean that I add actions at the bottom? Like this:
Wait for Contact x and Contact y = closed
On: Plug ABC light @ bed
and Delete the END-REP?

Or just add the On command after the END-REP?

This - add it after the end-rep.

Done. Will report back to confirm it works as soon as the next time the flashing triggers.
THANK YOU!

1 Like