Der-Eine
(Martin)
November 22, 2022, 12:17pm
1
Hey Guys,
i set in my configuration.yaml this
binary_sensor:
- platform: workday
country: DE
workdays: [mon, tue, wed, thu, fri]
excludes: [sat, sun, holiday]
After this i create a shutter automation where the workday sensor is a condition.
condition: state
entity_id: binary_sensor.workday_sensor
attribute: workdays
state: "On"
When i look on my info, i see that the sensor work correct.
When i test the condition under the automation i became the error:
Condition did not pass.
And the shutter automation dont work.
Can someone tell me wheres the issue?
crlogic
November 22, 2022, 12:30pm
2
Remove attribute from the condition.
2 Likes
m0wlheld
(Christoph Dahlen)
November 22, 2022, 12:48pm
3
Precisely, the workday sensor is On at workdays, Off otherwise.
Also: You could simplify your configuration by adding your province
(Bundesland) to the configuration, one of BB, BE, BW, BY, BYP, HB, HE, HH, MV, NI, NW, RP, SH, SL, SN, ST, TH. This way the workday sensor will be Off on national and regional holidays. No need to exclude weekends and holiday anymore.
binary_sensor:
- platform: workday
country: DE
province: NW
1 Like
Der-Eine
(Martin)
November 22, 2022, 1:00pm
4
Where did this province settings take the infos?
i loaded at the moment the HACS Holidays AddOn
When i test this condition without an attribute:
Condition did not pass
123
(Taras)
November 22, 2022, 1:08pm
5
It’s a binary_sensor
entity so its nominal states are on
and off
not On
and Off
.
condition:
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
1 Like
m0wlheld
(Christoph Dahlen)
November 22, 2022, 1:09pm
6
Check the country list for available provinces (and other subdivisions, like states and territories) for each country.
Then you’re doing it wrong. I do also automate the blinds depending on workday sensor:
I raise them later in the morning, on weekends and holidays
I close them later in the evening, if the next day is a weekend day or a holiday
From my configuration.yaml
binary_sensor:
- platform: workday
name: workday_today
country: DE
province: NW
From my automations.yaml:
- alias: open covers
trigger:
- at: 07:15:00
platform: time
- at: 09:30:01
platform: time
condition:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.workday_today
state: 'on'
- after: 09:30:00
condition: time
action:
As you can see (maybe this is relevant), the state is ‘o n’, not ‘O n’. Blinds will open 7:30am on workdays, 9:30h off workdays.
Der-Eine
(Martin)
November 22, 2022, 2:29pm
7
This is crazy… when i click on on the state selection field there is also an upper letter On. But now this passed.
petro
(Petro)
November 22, 2022, 2:43pm
8
The UI translates states for the user. Under the hood, states are all in English and lowercase. In the frontend, it will be the translation to your language and shown as a title.