Bath Lights and shower Lights - 2 rules

Hi - I originally thought this category was for discussion of Rule Machine functionality and potential problems being found - not for rule review but now it seems obvious.

I have a bathroom - it has a motion detector at the doorway and a sink light that's a group of 4 bulbs. I have a second motion sensor in the Shower hidden behind the curtain - it doesn't detect unless I reach in to turn on the water or am actually in the shower.

When I enter the bathroom, I have a rule to deal with that - but it doesn't always function as I expect. If I shortly after entering the bathroom (usually within a minute or two) reach in to turn the shower on, I want the shower rule to take over. It seems to work - sometimes but occassionally the lights will go off and I have to reach over the shower curtain and wave my hand.
When I get out - I'll be finishing up and the lights will just go off.
Here are my rules... Can anyone review and point out flaws or improvements? thanks!
First rule for bath lights:

Second rule, for shower :
image

1 Like

I'll take a stab (since I recommended you posted it here to begin with!)... I have a very similar setup actually.

I think the issue is even when the second rule is triggered the first rule is active. So if mode is day and the Samsung sensor fires an event, the wait for event timer is still still counting down the original 6 minute timer. When the second rule is triggered by the zooz a new timer starts but the old one does not stop. You might be able to change the "wait for event" in the first rule to delays and make them cancelable and then in the second rule cancel the delays in the first rule...

Or... why not use the mode and motion lighting app to replace the first rule and just use the additional shower zooz to keep the lights on?

Here's my mode & moton rule... no timers based on mode but I think the app supports it,..

1 Like

Hereā€™s a couple of things I would start with. (Recommendation - clone the rules and disable the originals, then if it doesnā€™t work right, you can easily just disable the new ones and re-enable the originals.)

For the Bath Lights Rule:
Change the Wait to Motion inactive -> Duration X minutes.
I would also remove the if / end-ifā€™s and instead use a Color Temperature per mode.

For the Shower Lights Rule:
Remove the Required Expression - It will prevent the rule from re-triggering if necessary
Change the wait for event to Sensor inactive -> Duration X minutes (probably something like 2-5 minutes).

In both cases, every time the sensors re-trigger, it will reset the duration timer.

Seeing that @brad5 also provided a recommendation - there are typically more than one way about this, so you can see what works best for you and combine options! Great way to learn!

1 Like

if you add a 'cancel delayed actions' to the 2nd rule, how does it know what delayed actions are cancellable - I mean I have another rule that turns the office AC and heater off when triggered by the shower - wont that get cancelled too?
update : NM! they aren't 'cancellable' delays....

I think you can cancel delayed actions in a specific rule... lemme see if I can go find it or @Sebastien may know as well.

1 Like

Correct. You can decide what delays are cancellable. You can also chose in which rules actions should be cancelled.

Wait events will always be cancelled when a rule is re-run.

Found it! Actually according to this maybe you dont even have to change them to delays... maybe it will cancel the waits. But then the lights might go out the minute you step into the shower... so might have to fiddle a bit

1 Like

I just went back and looked at mine and I do the same thing basically but with two instances of the motion and mode lighting app. The shower motion sensor used in the second rule keeps the lights in the first rule from shutting off.

I found that Cancel Timed Actions as well - the more you dig.... :slight_smile: I'mma gonna give the @BRAD5 's first suggestion ... try to mod my rule to improve them.
If that isn't a good solve, then I'll try his second thought about using Mode/lighting app. I recently toyed with Motion lights plus and had some problems and aborted... it may still be a good way as well. If none of those options give me a great functionality I'll to to Sebastians way of thinking...
Thank you!

1 Like

Sounds good. @Sebastien is Canadian so not only is his likely to work but he's probably nicer than I am too.

2 Likes

Here's my report - so far - the changes seem to work much better. No inadvertent light off while showering ... thats a great start!
However, after I took a shower, stepped out of the tub and was finishing my prep the lights went out and no motion restarted the basic Bath routine - I had to yell at Alexa to turn them on. What am I missing in the rule that allows the Bath routine to go back to normal? (The rules copied here are modified slightly then the test run (longer period on the timeout) due to a visitor here.


image

I'm gonna guess and say in your first rule the very first thing should be to cancel all the delayed actions within the rule... that way when the rule retriggers it will restart all those counters.

And I have an Alexa in the bathroom so I don't have to yell. Just sayin. Not weird or anything.

1 Like

I'll suggest in your Shower Lights Rule that you turn off the lights if the Bath Samsung Magnetic Motion Sensor 3 is inactive. That should allow your Bath Lights Rule to regain control of the Bathroom Lights.

2 Likes

Iā€™ll second @brad5ā€™s and @pseudonymā€™s recommendation.

Also, your delays are all of 8 minutes, so they donā€™t need to be part of your if structure (unless of course you donā€™t want them to turn on when the mode is ā€œAwayā€).

1 Like

I'll also add that you don't need to make the Delays cancelable for a Cancel Timed Actions to work on them. Cancel Timed Actions will cancel them and other timed actions. However, since you've made the delays cancelable, you need to add a Cancel Delays as the first action of that rule.