Workday Custom Condition Input

I am using the Workday integration in a couple of places, primarily to drive scheduler cards. It is very helpful, but I need to frequently add holidays for things like school vacations.

It would be helpful to be able to add a condition input to the configuration that could be mapped to another state so that we could have more flexibility in automating additional holidays. I am thinking this holiday condition evaluating to true would force the workday sensor to false.

You can do this with a template sensor. Here is my “work today” sensor that integrates a workday sensor, a handful of calendar entities, and a couple of other sensors. This is likely over complicated for what you need, it’s just an example to show you what you can do.

- binary_sensor:
    - name: "Work Today"
      unique_id: work_today
      icon: "{{ state_attr('sensor.work_shift_today', 'icon') }}"
      state: >
        {% if is_state('input_boolean.work_schedule', 'on') %}
          {% if is_state('input_boolean.work_today_on', 'on') %} true
          {% elif is_state('input_boolean.work_today_off', 'on')
              or is_state('binary_sensor.work_vacation', 'on')
              or is_state('binary_sensor.work_layoff', 'on') %} false
          {% elif is_state('calendar.work_holiday', 'on') %} {{ is_state('input_boolean.holiday_workday', 'on') }}
          {% elif now().weekday() == 5 %} {{ is_state('input_boolean.saturday_workday', 'on') }}
          {% elif now().weekday() == 6 %} {{ is_state('input_boolean.sunday_workday', 'on') }}
          {% else %} {{ is_state('binary_sensor.workday', 'on') }}
          {% endif %}
        {% else %} false
        {% endif %}

Thanks for the suggestion!

I like your approach but I don’t think it would work for my specific scenario. The issue I am running into is that I’m using a scheduler card (GitHub - nielsfaber/scheduler-card: HA Lovelace card for control of scheduler entities) to manage HVAC. That component directly references the workday sensor as a scheduling option. This works well most of the time, but requires me to manipulate the workday sensor directly to modify the schedule.