Cafe Lights On for a few hours if house is occupied

So I am coming from Vera and had super elaborate automations done via Reactor and I'm starting a new system and playing around with what I would call simple automations, but I'm hitting little snags. I want to make sure I have the concepts down before just building multiple rules for what normally would be a simple, single, condition in my head.

For example, right now I have 2 rules for outside Christmas lights: one for coming on at sunset and the other rule to turn them off at sunrise.

Last night, I created a new rule to turn on some café lights if people are present and it's between sunset and 4 hours after sunset. For this one, I tried the "Conditional Actions, ELSE -If" so essentially the lights will come on if condition is met and turn off otherwise. I really like this, and something that was also designed into Reactor (Was basically every condition had an action if true, action if false). However, how do I trigger this rule? Run it every 30 seconds? that would be crazy.

Trigger should probably be motion going active with a condition of time between sunset and (sunset + 4)

except I don't have a motion sensor out there. I guess I could just use one from another room in the house, but doesn't that seem silly? Motion in the dining room trigger porch lights on or off based on time of day?
Feel like there would be a way to have a condition be true and actions correspond. In that line of though, the time would be the 'change' or trigger. But it's like there's nothing in HE that 'monitors' time, and I have to 'ping' it manually one way or another...?

I was using the motion to detect presence. Without presence all you have left to test is time of day, how were you considering triggering presence?

Time can be a trigger instead of the conditional, still need a way to detect the presence of people.

I'm detecting presence via life360 integration, which works really well :slight_smile:

Basically the rule is:

If between sunset and 4 hours after AND someone's home
turn on cafe lights
ELSE
turn off cafe lights.

So if we are home and during that time, lights on. If the time 'expires' or if we leave or aren't home, they turn off.

It's just i need something to make the rule evaluate. My current edit has me triggering at sunset and then 4 hours after, but then i need to make the condition to be within those times by a minute so they don't match exactly for an update.

I know that will work, but again it just seems like I'm going around the backdoor when I'm just missing a simple RM concept or something.

I know how'd I write it in a few other rule systems but still working out the nuances for RM. So I'm thinking you have 4 scenarios for this rule:

  1. Time becomes sunset and someone is home (Trigger is Sunset, condition someone is present)
  2. Time in range and someone arrives (Trigger is arrival, condition is time range)
  3. Time in range and everyone leaves (Trigger is departure)
  4. Time becomes Sunset + 4 (Trigger is Sunset +4)

In RM rule triggers are an OR condition. so #3 and #4 should be able to be combined

Thanks for the input - Here's what I'm doing for now. I will keep digging and playing around with options.

Instead of triggering every 5 minutes, you might want to simply have multiple triggers... Use the Sunset and Sunset+4hours as triggers...AND use the arrival of Ryan, Lynda, and Ahren as triggers. The conditions you have appear to be fine. But using the triggers I mentioned will greatly reduce the number of times the rule has to be evaluated.

You may also want to consider using the built-in Mode Manager app to set the “mode” of the house based on time of day, and whether or not anyone is present. This way, in your automations and rules, you can simply use modes as either triggers and/or conditions as opposed to individual presence sensors and/or specific times of day.

2 Likes

That is what I would recommend as well. With that trigger, you aren’t constantly running the rule and can make it much simpler. I would do the following (See below) which would only turn it on if you are home in the evening. If you arriver later in the evening, it would remain on for 4 hours starting when you arrived.