Add weekday as an optional field on time triggers

@nickrout thank you so much for the reply! In my mind what I was envisioning was being able to do something like this:

trigger:
- platform: time
  at: '05:00' 
- platform: time
  at: '08:00' 
  weekday:
     - mon
     - wed
- platform: time
  at: '09:00'
  weekday:
      - tue

Not sure if that makes sense or not!

What about using it in the condition part of the automation

- id: 28c7af8f-3227-4aac-b33c-b9b5f8c05380
  alias: Just a morning reminder empty the dishwasher
  triggers:
  - trigger: time
    at: 08:00:00
  condition:
  - condition: state
    entity_id: sensor.dishwasher_status
    state: clean
  - condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  action:
  - action: notify.alexa_media
    data_template:
      target:
      - media_player.bedroom
      message: Can I ask you to do one Job before you leave empty the Dishwasher.
      data:
        type: announce
        method: all

@myle the problem is that it doesn’t let you do it at different times on different days of the week (like in the example I posted). You have to kind of check if trigger id == X AND day of week == Y (for each day of week and time permutation)

you could add a ID to each time

something like

description: ""
mode: single
triggers:
  - trigger: time
    at: "05:00:00"
    id: at_5
  - trigger: time
    at: "08:00:00"
    id: at_8
  - trigger: time
    at: "09:00:00"
    id: at_9
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - at_8
          - condition: time
            weekday:
              - mon
              - wed
        sequence:
          - action: light.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: light.dinning
      - conditions:
          - condition: trigger
            id:
              - at_9
          - condition: time
            weekday:
              - tue
        sequence:
          - action: light.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: light.dinning
      - conditions:
          - condition: trigger
            id:
              - at_5
        sequence:
          - action: light.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: light.dinning

there always more than one way to skin a cat.

@myle yes totally agree! That is how I have it now. But it’d be a lot cleaner if the tigger supported weekdays. Hence this FR!

yeap it a bit messy. but job done

can post your automation.

then other use will be able to copy it and paste it with last month copy paste update.

Closed as a duplicate FR. Please search before posting a new request. You can vote and comment here: Select WEEKDAY as an option for automation trigger

2 Likes