Date based automations

There is time based triggering of automation. There is time based conditions in automations. But there is no date based triggering and date based conditions.
At least half of world could use date based heating automations. If condition is 1st of april to 31st of september, dont execute any heating automations (or disable those automations). Also christmas lights automation. Automations that run every year the same but only in certain months.

The problem with dates is that many times it is not even fixed, like holidays that move from year to year.
The solution is probably to use the calendar trigger instead, since the calendar can handle both dates and times.

Hi Henry,

Have you looked int the calendar integration?

Local calendar - Home Assistant.

One issue with “Date triggers” is that the date changes at midnight, so the majority of users are really going to want a Date and Time trigger. Between Calendar triggers, Time triggers with Input datetime helpers, and Template triggers there are already 3 ways to trigger on a specific date and time.

As to a Date condition, a State condition based on a properly set up Calendar entity would work. Or there are a few Template-based options available. There are also custom integrations like Anniversaries and Scheduler that provide sensors that can be used for these purposes.

While many of us start out relying on time or date-based automations, those automations often become a source of frustration because they are so static. In the same way it is better to turn lights on based on a room’s occupancy not at a fixed time of day; it is usually better to run climate automations based on actual sensor values and/or closely contemporaneous forecasts instead of broad generalizations.

1 Like

i don’t know where you live but weather forecast is least reliable. yesterday, forecast showd rain… there was no rain. today it show’d sunny day, rightnow it’s raining.

If there would be date condition… i can start automation every day at 7PM but if condition is only from 1st of october to 1st of April, its not starting it and if it is between those dates, it starts them in time i want them to start.

I think you can use a template binary sensor for this. I wanted to send a notification every first day of the month to send an energy usage report.

{{ now().day == 1 }}

My automations has a trigger on this sensor and does the trick.

The Calendar integration and related Trigger is an extremely poor solution to this problem. If you want to have multiple events in a single Calendar, the Trigger cannot handle that by itself, and you have to use a Template condition to check the data for the specific event, which is inconvenient at best.

Calendar triggers are inadequate for multiple events, Time triggers with datetime helpers do not support recurrence, and Template triggers are convoluted and inconvenient to deal with. And the Calendar and Time triggers both require pre-configuration outside the Automation setup itself, which is also inconvenient. These are woefully inadequate solutions to the OP’s use case.

There needs to be a simple trigger where you specify a date, with an optional recurrence period. That’s it. None of these user-unfriendly workaround ideas where you have to first create a Calendar, then create an event, then write out a template. Or first go create a datetime helper that doesn’t support recurrence.

Just put a Date picker and a recurrence dropdown into a trigger interface, or fix the Calendar trigger so it actually supports triggering on specific events instead of triggering on every event only.

1 Like