Help with cancelling actions

I am trying to create a rule that turns a number of lights off after a delay when motion stops.
This is where I have got to so far, however this is turning the light off as soon as motion goes to inactive

This looks more or less OK to me, except that your IF will be false any time you're outside one of those modes and will turn the lights off any time the sensor changes (to either value) in that case. Guessing that's not what's happening here. You also might be turning off different lights than you're turning on, unless the one you're turning on is a scene or group and then you're just turning off the individual bulbs.

One thing you could try: turn on action logging (at least) so you can see what RM thinks it's doing when. Also, are you sure you don't have other automations acting on the same lights? Your love logs or the "In Use By" section on the device page may help there.

Finally, while it's not exactly what you asked, both Motion Lighting and Simple Lighting could handle this automation if you didn't want to use RM. They are easier to set up and likely faster to execute. That being said, your rule does look fine (something I'm not used to saying when people try this :slight_smile: ).

Thanks the response, I think your first point may actually be right and something I hadn't considered as I have two similar rules for Nightlight (mode=night) and Dimmed Lighting (mode=morning).

So what is likely happening when the motion stops is that one of the other rules is turning the light off, am I correct in thinking that?

So what I could do is use the rules like this to turn the lights on depending on mode, then a seperate rule that doesn't include the mode only motion.

You are correct in that the rule is turning on a scene (Hue B Smart) and then turning off the individual lights after the delay. I tried this in Motion Lighting but I got too confused lol

Here is something that I have that turns a light on to different levels depending on mode.
It also turns them off with different delays depending on mode.
I know this is not exactly what you are after but it should give you an idea of what you could try in wrapping the light for different modes all into one rule.

Actually, would this work? I've added an additional IF statement at the start want to remove the mode from the second conditional action.

Ah yes, of course! Also added another END-IF at the end.

How does this look? I had everything working as I wanted in ST using WebCore but trying to transition everything over to Hubitat and get rid of ST

Looks good. If you ever adjust the lights away from the "bright" settings, you might want to change the action of "turn on Laundry bright to a simple conditional using one of the lights being off as the condition. That way, it wouldn't override what you have changed the level to.

1 Like

Good plan.
Thanks for the help. I think I'm finally there!

1 Like

Hadn't considered using the bulb status as a condition but this will help in some rooms I am due to setup, so thanks again for this...

Assume this is what you mean? Don't want to crack on with everything else if I got the wrong idea.
For clarity, what used to be spare bedroom will eventually be renamed Nursery... that's WIP

Yup....That looks good to me.

May I ask...why are you turning on "Spare Bedroom Bright" instead of just setting the level of Spare Bedroom Ceiling if that is the only light in the room?

1 Like

Good question! I have been trying to keep things consistent between rooms. I only have two rooms with just the one light in so figured I'd treat these automations the same as other rooms.

I know I could use color temperature for all bulbs in the room but I like to try and stick with my existing hue scenes.

Always open to change things though if there is a better route.

If you have a hue scene set up for that and are using CoCo hue to pull those in, then yes. That is one way to go. It doesn't save you all that much though. If you were to add a light to the room, since you can't turn the scene off, you would still have to go into every rule and add the new light in the turn off part. But if it works for you, then go with it. :slight_smile: I was just curious. Couldn't tell if it was a Hubitat scene or something else.

I am using Hue B Smart as this is what I used in ST.
But looking at CoCo Hue I may move over to that at some point