Platform: time_pattern should also support month, day, and day of week

I have been using homeassistant to implement alarm clock type functions. Currently to make automations time and date aware, the trigger will fire daily based on time and the conditions must be used to filter based on date. However if you want to combine multiple date and time triggers for the same automation, things really start becoming complicated. It would be much easier to make the date handling part of the trigger.

For example, I would like to be able to trigger the same automation on different times based on whether or not at is a weekend with time_pattern supporting weekdays and ranges similar to how it is implemented in cron.

- alias: 'Wakeup Routine'
  trigger:
    # MON-FRI
    - platform: time_pattern
      hours: 4 
      minutes: 0 
      weekday: 1-5
    # SAT-SUN
    - platform: time_pattern
      hours: 6   
      minutes: 0  
      weekday: 6-7
  action:

Similarly, it would also be nice to be able do the same with month or day.

Right now my workaround for complicated time rules is to use cron and curl to trigger an automation via a webhook. But it would nice to have an elegant native solution for homeassistant.

I think you might like this … it uses timedelta and relativedelta datetimes combined with Rrules :
Universal Persistent Timer
It can add a timer to anything including multiple scripts, lights etc. with separate start and stop actions, and will resume in the event of downtime and requires no programming skills once installed. All lights, switches etc can be accessed from auto populated lists; and you can specify days of the week, repetitions, intervals, and much more. Timers can be paused, backed up and give activation notifications etc.
https://youtu.be/rUeTIU1uAP0

1 Like

This feature request could also fulfill this request

harac, this FR is about the time_pattern trigger, not a cron trigger… While they are similar, they are not the same feature request.