Conditional Rule Help

I'm trying to have a bathroom light come on when tripped by a motion sensor between 4pm and 7am? I'm hoping someone can help me figure out why this does not work.

Which part of the rule does not work? Do you have logs of the rule? That is usually the best place to troubleshoot issues. With that said, I'd strongly reconsider the way you have this rule written. If this was me, I'd write it the following way:

Required Expression
Time between 4:00pm and 7:00am

Trigger
Motion sensor active

Actions
Set light to 5
Wait for Event - Elapsed time of 1 minute
Turn off Light (rather than set to zero)

4 Likes

It's much simpler using the required expression as @JB10 has shown. I'd probably just do it in Room Lighting (I never thought I'd hear myself say that!)

Why not just use the Motion and Mode Lighting App?

You certainly can; however, M&ML has been superceded by Room Lighting as the heir apperent for those kind of things. M&ML is still available, but it's no longer being actively supported, so I myself would avoid getting too attached to it.

I doubt they'll deprecate M&ML anytime soon, but I guess you never know.

1 Like

Gotcha, I'm an original Hubitat user from "way back when" so MM&L was all we had then and I've stuck with it. :slight_smile:

1 Like

The lights go on with motion any time of day and do shut off after 1 minute.

I will try it like that.

Is that format Rule Machine or Basic Rules?

That format is for Rule Machine; though, it can easily be modified for Basic Rules as well. With Basic Rules, you would just move the time to as restriction (only between 4pm and 7am).

Do you have any other rules controlling the lights during the day? Your rule should work; though, without logs and possibly device events, it's tough to say exactly what is happening.

1 Like

Yes, I have several rules that are strictly schedules. None are conditional or that include that bathroom light. Good to know I'm on the right track. I looked for videos and the support info was spotty. I will use the Motion Mode app for this until rule machine is working for me. It seems simple enough going right down the list of conditions and actions in order.

I was a Vera Plus user since the beginning (10+ years) and x10 prior . Just switched to Hubitat.

What other rules do you have controlling this specific light? You can possibly combine them into one rule depending on your goals.