Workday

The Workday integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] indicates whether the current day is a workday or not.

It allows specifying which days of the week will count as workdays and also uses the Python module holidays library to incorporate information about region-specific public holidays.

This can be used to make daily automations that act differently on workdays than non-workdays. For example, you could make your bedroom lights turn on (gently) at 7 in the morning if it is a workday but wait until 11 if it is a non-working day.

The workday integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] also provides a calendarA calendar entity represents a schedule of events coming from a local or external calendar source. It can be used to trigger automations based on the start or end of an event, react to offsets (like 15 minutes before), or retrieve event details through services. [Learn more] entity that may be used to see upcoming workdays.

Setup

Check the country list for available subdivisions (such as provinces, states and territories) for each country.

Configuration

To add the Workday service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

Country

The country whose public holidays you want to use. Leave it empty to start with an empty set of holidays.

Days to include:

The weekdays that are workdays.

Days to exclude

The days that are not workdays. Note below the important information regarding the Holidays keyword.

Offset

Days offset from current day. It can be used to see if future days are workdays. For example, enter 1 to see today if tomorrow is a workday.

Add holidays

Provide dates formatted with YYYY-MM-DD or a date range formatted with YYYY-MM-DD,YYYY-MM-DD to add them as holidays.

Remove holidays

Provide dates formatted with YYYY-MM-DD, a date range formatted with YYYY-MM-DD,YYYY-MM-DD or partial of name, (for example, christmas will find Christmas Day) to remove them from the list of holidays.

Language for named holidays

The language that will be used in the configuration of the holidays exclusion.

Subdivision of country

The subdivision of the chosen country, if any or wanted.

Additional category

Additional holiday categories to include. Check the supported categories for each country in the holidays library webpage.

Important

The Holidays keyword represents the list of holidays imported from the holidays library and the holidays added in the Add holidays configuration option. When you select Holidays in the configuration option Days to exclude, the days that are in the holidays list are excluded from the workdays list. This means that if a holiday falls on a weekday defined as workday, that day does not count as workday (the workday sensor will have the Off state).

List of actions

The Workday integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following actions. Each link below opens a dedicated page with examples, parameters, and a step-by-step UI walkthrough.

  • Check date (workday.check_date) Checks whether a given date is a workday.

For an overview of every action across all integrations, see the actions reference.

Automation example

Example usage for automation:

automation:
  alias: "Turn on heater on workdays"
  triggers:
    - trigger: time
      at: "08:00:00"
  conditions:
    - condition: state
      entity_id: binary_sensor.workday_sensor
      state: "on"
  actions:
    - action: switch.turn_on
      target:
        entity_id: switch.heater

Data fetching and limitations

Data is loaded completely offline from the holidays library and there is no data fetching.

Newly created holidays or other configuration options are completely based on the releases of the holidays library

Troubleshooting

The integration completely relies on the information provided by the holidays library.

Check the holidays repository if you are missing a certain holiday. Some holidays in your country may not be actual official holidays and are therefore set in a special category that needs to be selected. Missing holidays or incorrect days need to be raised directly in the holidays repository.

Remove the integration

To remove an integration instance from Home Assistant

  1. Go to Settings > Devices & services and select the integration card.
  2. From the list of devices, select the integration instance you want to remove.
  3. Next to the entry, select the three dots menu. Then, select Delete.