This been mentioned before (see bottom) but the timer trigger is limited, and a cron timer would give us so much more flexibility.
I would like to setup an automation that fires:
At 16:00 monday, thuesday, wednesday
At 18:30 on thuesdays
At 15:30 on friday
During winter time.
So for first example i would use this trigger 00 16 1 JAN,FEB,MAR,SEP,OCT,NOV,DEC MON-WED
Since 00 16 1 SEP-MAR MON-WED does not really seems to be supported?
I don’t see how i would be able to set up that as one automation with current features, but it would be really easy with cron support. Then i would just define 3 triggers for the same automation
I think the real reason that we don’t have full cron support is that it is complex and error-prone.
The frequently used parts are already possible with a combination of triggers and conditions. For your example where you want three of them, I would move the action to a script and make three different automations.
I guess you mean 00 16 * JAN,FEB,MAR,SEP,OCT,NOV,DEC MON-WED but I had to look up the syntax to be sure.
Now i am ready for the winter and i don’t need to manually enable the car heater thru the Volvo on Call app. Now my smart home will know the car is at work and then its time to heat up
Glad I could help!!
In addition, I guess you saw than you can use msg input to create/update/delete entries in the cron node. So, you can, eg. enable cron if the temperature below is less than X°C independently of whether it is officially “winter”.
No one ever took a chance to implement crontab-like trigger, for example using ApScheduler lib (https://apscheduler.readthedocs.io/en/stable/)
The person who do this will be our hero
cron.guru and Node Red cron will “translate” the syntax in plain English.
With yaml (at least for me), it is quite difficult to test without multiple trial/error.
But, I agree, and said it many times already, the very good thing with HA is that you can do your “stuff” in yaml, nodered or python depending on your appetite. So, everyone’s happy
Been thinking about adding condition for the weather later on. For now Volvo on Call will not start the heater if the temperature is above 15 degrees Celsius.
I still don’t see any decent Cron type options. This is a big hold up for trying to migrate from OpenHAB. A lot of my rules are seasonal and explicitly run on certain days or times.
There’s nothing you can do in cron syntax that can’t be done in a template. Case in point, here’s the example at the top in one template trigger:
trigger:
platform: template
value_template: >-
{{ (now().hour == 16 and now().minute == 0 and now().weekday() < 3
or now().hour == 18 and now().minute == 30 and now().weekday() == 3
or now().hour == 15 and now().minute == 30 and now().weekday() == 4)
and (now().month < 4 or now().month > 8) }}
I’m all a fan of making this easier with a UI scheduler. Either bringing something like Edwin is showing to core or a local calendar option so we can build schedules in HA to use with the new calendar trigger.
But bringing cron syntax to HA? Why? HA already has one extremely technical syntax that can do everything cron can do and more and people already struggle to learn that. HA doesn’t need another language for people to learn.
I found SimpleScheduler but it seems the sort of thing that would be smart to bake into the core. Not everyone is good with YAML. One of the things I love about OpenHAB is I can be very sloppy as long as the right syntax is there. Spacing doesn’t make a lick of difference. I have some rules set to run 7 days a week and others on weekdays. Some are all year, some are specific months.