You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/_components/binary_sensor.workday.markdown
+21-4Lines changed: 21 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,6 @@ To enable the `workday` sensor in your installation, add the following to your `
30
30
binary_sensor:
31
31
- platform: workday
32
32
country: DE
33
-
workdays: [mon, wed, fri]
34
33
```
35
34
36
35
{% configuration %}
@@ -63,11 +62,14 @@ days_offset:
63
62
required: false
64
63
type: integer
65
64
default: 0
65
+
add_holidays:
66
+
description: "Add custom holidays (such as company, personal holidays or vacations). Needs to formatted as `YYYY-MM-DD`."
67
+
required: false
68
+
type: list
66
69
{% endconfiguration %}
67
70
68
71
Days are specified as follows: `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`.
69
-
The keyword `holiday` is used for public
70
-
holidays identified by the holidays module.
72
+
The keyword `holiday` is used for public holidays identified by the holidays module.
71
73
72
74
<p class='note warning'>
73
75
If you use the sensor for Norway (`NO`) you need to wrap `NO` in quotes or write the name in full.
@@ -76,6 +78,22 @@ If you use the sensor for Canada (`CA`) with Ontario (`ON`) as `province:` then
76
78
Otherwise the value is evaluated as `true` (check the YAML documentation for further details) and the sensor will not work.
77
79
</p>
78
80
81
+
## {% linkable_title Full example %}
82
+
83
+
This examples excludes Saturdays, Sundays and holiday. Two custom holidays are added.
84
+
85
+
```yaml
86
+
# Example configuration.yaml entry
87
+
binary_sensor:
88
+
- platform: workday
89
+
country: DE
90
+
workdays: [mon, wed, fri]
91
+
excludes: [sat, sun, holiday]
92
+
add_holidays:
93
+
- '2018-12-26'
94
+
- '2018-12-31'
95
+
```
96
+
79
97
## {% linkable_title Automation example %}
80
98
81
99
Example usage for automation:
@@ -98,4 +116,3 @@ automation:
98
116
<p class='note'>
99
117
Please remember that [as explained here](/docs/configuration/devices/) you can only have a single `automation:` entry. Add the automation to your existing automations.
0 commit comments