Start and End time in a Rule

Hello Guys

I am trying to make a rule to dim the lights when motion is inactive and increase the brightness when the motion is active, it worked well as per my requirements.

However i want the rules to fire between 10 PM till 6 AM. I am unable to add the start and end time in the rule. Please suggest how to add the timings. I have attached the rule image below.

Thanks

1 Like

Turn on the toggle for "Use Required Expression" and add a requirement for your times.

1 Like

If you use the Required Expression, consider the case where the motion sensor goes active before 6:00 AM but Inactive after 6:00 AM. What do you want to happen? You may want to consider updating your rule to trigger on active, delete all the simple conditions and just use the actions, and put a Wait for inactivity (perhaps with stay that way for x minutes) between the two Send GET actions. This way the rule will only trigger on active motion between 10 PM and 6 AM but will complete the current inactive actions regardless of the time.

It would still work. Required expressions do not cancel out pending actions unless that option is enabled.

The way the rule is currently written, there are no pending actions. That's why I said to add the Wait. With that there would be pending actions.

Ah yeah...good call. Something like:

Required Expression:
    Time between 10:00 PM and 6:00 am
Trigger:
    Motion - GF Entrance motion active
Action:
    Dim: "Entrance Lamp 2, Entrance Lamp 1": 100
    Send GET: "#stuffs#"
    Wait for event: "Motion - GF Entrance" motion inactive
    Dim: "Entrance Lamp 2, Entrance Lamp 1": 20
    Send GET: "#stuffs#"
1 Like

not at all far off from what I'm using:

@regener8ed Same issue as above. For example, if your contact opens at 2 minutes before sunrise the RE will be true and the lights will turn on. If the contact is then closed 1 minute after sunrise the RE will be false and prevent the rule from triggering so the light won't be turned off. Are you okay with the light staying on? For me the answer is no. Is this going to happen a lot? Probably not but I'd write the rule so it doesn't happen at all. FC2006 provided a good example of how to write this type of rule that'll allow the light to turn off even if the closed event happens after the RE period has ended.

In my case additional logic was not necessary because the crossover scenarios are already resolved in some other rules (like a rule at sunrise which turns off several devices, including the one shown.)

I was just showing how I use the Required Expression and Trigger Events to dive into logic that then further evaluates the trigger event.

Thank you, worked very well

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.