Day of the week picker for automation on dashboard

I’m currently using a condition in an automation to only run the automation on Mon, Wed, and Fri.

  - condition: time
    before: '23:59:59'
    - mon
    - wed
    - fri
    after: 00:00:00

I’d prefer an option to pick the days of the week the automation runs that isn’t hard coded. Is there a way to add a day of the week picker on the dashboard that I can use as a condition in an automation?

Input booleans and the custom button card:

Screenshot 2022-06-21 at 14-46-11 Overview – Home Assistant


I’m having trouble figuring out how you are using the input booleans. Presumably, those day of the week buttons on the bottom turn on/off the boolean, correct? If so, how are those used in the automation? Do you have an automation for each day of the week and those day buttons are turning on/off the automations?

My input booleans are named like this:


For use with a template condition like this:

condition: template
value_template: >
  {% set day = strptime(states(''), '%Y-%m-%d').strftime('%a')|lower %}
  {{ is_state('input_boolean.zone_1_' ~ day, 'on') }}

If you are going to be using this in lots of places it makes sense to create a day sensor (and tomorrow sensor if you wish) sensor:

  - sensor:
      - name: "Day Today"
        state: "{{ strptime(states(''), '%Y-%m-%d').strftime('%a')|lower }}"

      - name: "Day Tomorrow"
        state: "{{ (strptime(states(''), '%Y-%m-%d') + timedelta(days=1)).strftime('%a')|lower }}"

So you can simplify the condition template to:

condition: template
value_template: >
    {% set day = states('sensor.day_today') %}
    {{ is_state('input_boolean.zone_1_' ~ day, 'on') }}