Simple Automation at Varying Times

Hi. I'm trying to run a simple automation rule, that turns a switch on and off at a similar time every day. I was using Simple Automation for this rule when it was the same time, but now that I need the times slightly varied every day, I need something more accomodating.

Is a complex, nested RM rule my only option here?

I would use RM for this. If the time will always be the same on a set day of the week, then a trigger time per day could be used.

Thanks for the reply. That's the problem, it's different times, so I would have to trigger the ON rule at the earliest time, then set a bunch of conditional delays, based on the day of the week.

Then another similar rule for the OFF command.

Yea, it could indeed require some if conditions in the rule. Can you share exactly what you are looking to do? There may be tools available to help.

My wife runs a business from home and she has some LED signage at the front, plugged into a TP-Link (Kasa) outlet.

The business used to run at the same times on the days she operated. Now the hours are modified, and, as you can imagine, it's not ideal to illuminate the signage when she is not operating.

1 Like

Indeed! Can you share those hours of operation?

The days themselves may vary (I'm not worried about this variation), but to make it easy:

2x days at 0830-1230
2x days at 0830-1530
2x days at 1000-1200

I would just make 3 separate rules each using the combination of days you need... for instance

required expression = day of week: Tues and Thurs
Trigger = time :08:30am
Action = Turn on plug
trigger= 12:30pm
action = turn off plug

Rinse and repeat for other needed days

2 Likes

If you wanted to stick with SA....
SA doesn't give you an option for days.
But, it allows a Date/Time variable.
Admittedly, I've only tried using a variable once, so I don't know what I'm doing.
Could a Date/Time variable be used, and how?
image

edit: I just tried creating a date/time variable. It's a specific date. By the time you figure out the hours, how to change the variable, etc, I do think RM would be easier with its day of week capability.

Just so I understand - Is there some consistency - like in your example, every 2 days there is a change - does this represent what is really happening, or does the variation change in a random way?

No, they are consistent, but may change in the future.

Currently:

M 10-12
T 830-330
T 830-330
F 10-12
S 830-1230
S 830-1230

If variables can be used, that would be cool, but I've not yet explored that option.

I'm thinking the simplest option would be the multiple if statements and delays, as mentioned above, or a separate rule for each day and state - that would be 6x rules though, and seems unnecessary.

One option is to maintain hours via Google Calendar and then use my app to automate based on the calendar entry:

4 Likes

I was just going to suggest this. As long as she has access to the calendar, she can adjust hours as she wants without needing to get into the guts of the rule.

2 Likes

Thanks everyone, I've just made 7x SA rules - one for each day of the week, and I will tweak them as needed.

Meanwhile, I'll look into the Google calendar integration. That was a thought when I first got into HE and I never revisited it. Thanks for the reminder!

3 Likes

If you live by your calendar like my family does the calendar integration opens up a ton of opportunities for announcements or rule execution. My kids depend on this to wake up for school each day. My neighbors depend on it to announce no mail or trash holiday notifications. I also use it for Guest coming and turning off certain automations or even unlocking my crawl doors if Terminix or HVAC guys are scheduled to come over.

You can set the polling to be as frequent as you want so your wife can adjust the calendar entry if she decides to leave early or stay late and the lights would dynamically adjust to the calendar entry vs having to adjust rules. You can have a rule trigger based on the optional child switch created by this integration or you can run rule actions directly from the app too and not require the child switch.

Please feel free to post any questions in the above linked thread.

2 Likes

The possibilities look awesome.

Thanks everyone, I've got Google Calendar up and running. Works flawlessly.

Now to look at what else I can do with the integration :thinking:

2 Likes

Glad you got it working to your satisfaction.

I'm honestly very surprised nobody suggested using the Room Lighting app, along with its easy-to-implement "Time Periods" activation option, which allows you to set a different time for each day of the week. RL makes the resulting automations straightforward to edit as needed.

In this way, RL acts as a one-stop shop compared with multiple RM or SA rules. But kudos for setting things up so nicely with the awesome Google Calendar app! I would never have thought of using that for this purpose.

2 Likes

We were just leaving that one for you! :wink:

I don’t use RL myself, but based on your description, it does sound like a very good option!

2 Likes

Shhh, don't tell anyone... I don't use it either. :slight_smile:

3 Likes