Workday Binary Sensor

The workday binary sensor indicates, whether the current day is a workday or not. It allows specifying, which days of the week counts as workdays and also uses the python module holidays to incorporate information about region-specific public holidays.


Check the country list for available province.


To enable the workday sensor in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
  - platform: workday
    country: DE
    workdays: [mon, wed, fri]

Configuration Variables


(string)(Optional)A name for this sensor.

Default value: Workday Sensor


(string)(Required)Country code according to holidays notation.


(string)(Optional)Province code according to holidays notation.


(list)(Optional)List of workdays.

Default value: [mon, tue, wed, thu, fri]


(list)(Optional)List of workday excludes.

Default value: [sat, sun, holiday]


(integer)(Optional)Set days offset (e.g., -1 for yesterday, 1 for tomorrow).

Default value: 0

Days are specified as follows: mon, tue, wed, thu, fri, sat, sun. The keyword holiday is used for public holidays identified by the holidays module.

If you use the sensor for Norway (NO) you need to wrap NO in quotes or write the name in full. Otherwise the value is evaluated as false. If you use the sensor for Canada (CA) with Ontario (ON) as province: then you need to wrap ON in quotes. Otherwise the value is evaluated as true (check the YAML documentation for further details) and the sensor will not work.

Automation example

Example usage for automation:

  alias: Turn on heater on workdays
    platform: time
    at: '08:00:00'
    condition: state
    entity_id: 'binary_sensor.workday_sensor'
    state: 'on'
    service: switch.turn_on
    entity_id: switch.heater

Please remember that as explained here you can only have a single automation: entry. Add the automation to your existing automations.