Logic for lights and laundry

Current logic for my bathroom lights (C8 pro, rule machine).

Motion sensor active:

  • If bathroom lights are off, turn bathroom lights on via cocohue all-day scene (changes depending on time of day).
  • Cancel delayed actions, delay 10 mins, turn bathroom lights off.

I want to introduce a laundry rule that uses a smart plug to sense when the washing machine has finished its programme, then makes just one of the bathroom lights (lets call it the laundry light) pulse until the washing machine door is opened (contact sensor).

I want the rest of the bathroom lights to ignore the laundry rule altogether. I don't want the laundry light to stop pulsing when motion is detected. When the washing machine door is opened and the laundry light stops pulsing, I want the laundry light to revert back to the same all-day scene as the rest of the bathroom lights.

What is the best way to achieve this, so the laundry rule temporarily 'overrides' the normal motion rule?

I assume that your bathroom lights are separate lights and not a group?

Something like this maybe...

Laundry Rule:
Trigger: Laundry is done
Actions:
Turn on laundry-flash switch
Start flashing laundry light
Wait for event: laundry door opens
Turn off laundry-flash switch & laundry light

Bathroom Rule:
Trigger: Motion
Actions:
If laundry-flash switch is off
Turn on all-day scene on all bathroom lights
Wait 10 minutes
Turn off all bathroom lights
Else
Turn on all-day scene on all bathroom lights except laundry light
Wait 10 minutes
Turn off all bathroom lights except laundry light
End-if

There are probably lots of other ways to do this. Off the top of my head you could use private boolean for either rule instead of a switch. You could have three rules and have the laundry rule determine which bathroom rule is active and pause the other. You could combine them into one big rule to control them all, but that would probably be harder to debug.

Hope this helped.

Thanks, I'm not familiar with private booleans so I'll look into them.

The all-day scene groups all of the bathroom lights. I'm not sure if there is a way to turn on a scene for specific lights - I think the scene itself determines which lights are included?

Or are you suggesting I create a second all-day scene identical to the first, but excluding the laundry light? I think that would work.

That would work. The laundry light has to be somehow separated from the other lights.

Or I suppose you could turn on the all-day scene and then start the laundry light flashing again if the laundry is done. You'd have to do something similar when turning the bathroom lights off.

There's the possibility that the laundry light will turn off when the bathroom lights are on if the laundry door opens when someone is in the bathroom. That may or may not be a problem.