Help Creating Routine based on time and dates (Yearly)

Hi guys,i will be honest to you,im over 2 years with hubitat but im still having dificulties when is about complex rules, im hopping you can help me.

i use to have a rutine to turn a light on (electric candle) everydays 365 of year from sunset to 11 pm.... everything fine so far,
but recently i saw i can now on the rule machine do rules based on days and yearly so heres my idea i need help creating the next rule:

The light turn on all 365 days, from sunset to 11 pm ,but the days 24 december of every year turn on on sunset BUT turn off until 12am of the 26, and the same for the 31 (turn on on sunset of 31,and turn off until january 2 at 12am)

and i want to make the same with other 3 or 4 days of the year,but i hope can figure out how after your help..thanks for your time and help,have a nice day :smiley: :melting_face:

What to do is to restrict your existing your existing rule so that it doesn't mess with a new rule you will create. You can do this with Required Expression. Basically, you don't want your current rule to run on Dec 24, 25 or 31. Like this:

Now, you need a new rule that will turn the light on on Jan 24 and off at 12 am on the 26th:

And another one just like that for New Years.


Thanks so much for your help :slight_smile: i will try that rule/ more thing i forgot to original rule no longer exist, i deleted, i delete my original rule while i was trying and testing a new rule ,one with the time and dates exception jeje

Would it be too much trouble/ hassle if you help me creating that rule as one ,a new one who include everything instead of having my original and the modification you gave me? thanks again so much for the time

This is the one for every day, except for Christmas and New Years. Example device shown.

1 Like

Thanks again so much,i will try it :slight_smile:

An all-in-one rule could be something like this

You could add more ELSE-IF actions for the other 3/4 days. Note to select the "Annually?" slider for the "Wait for event: When time is" action


Hi there, thanks¡¡ i saw your the rule yesterday and i try it since then,but somethings is not good,somethings missing or my hub is bug, the rule dont turn off the lights and i dont know what can be (this is a clone of the rule,but yesterday all my test was made on the original,having the same result :frowning: any idea? im missing something maybe?

Ps: I always update the rule

It looks like you ran the action at 3:24:37 and the rule was at the point of waiting until 3:26 PM. There is an initialized at 3:24:39. I suspect after using Run Actions you hit the Done for the rule. That'll reset the rule and wipe out any Waits. I'd suggest you try the Run Actions again but don't hit Done until the rule has time to complete.

1 Like

Thanks it work,¡¡¡ but...Im kind of confused,it work. (at least on my temporal testings)

After editing the time event,
(clicking on ¨done with wait event¨, then ¨done with actions¨)
In the page of the screenshot ,i only click on run actions and it work...but this means when i do changes like this ones i should click on run actions and not in update rule or even on done?or what @_@

Run Actions is a way to bypass the trigger and just run the actions of the rule. It's really a debugging tool. When you have you're rule set just hit the Done button and the rule will run when triggered.

Thanks for Everything,im testing tonight the rule,hope everything works fine...

Just one more question, i made yesterday another rule (is paused ),not a clone but i made it exacly the same manually, you know why in the other in the local variables was no present the
%device% ___device___Certain time
and in this one is present? and only private bolean is there?

Thanks again

From RM 5.1 documentation
%device%: name of the device that generated the event (or "timeout"` after a "Wait..." action if a timeout is specified on a wait and the next action is reached because the timeout expires)

I suspect your rule hasn't triggered, yet. Once it does it should populate the "device" variable.

Download the Hubitat app