Hello,
I am looking to set up a condition based on the entity below
I would like the condition to be true if the attribute “ID” contains the string “hamoed”. I have tried the following without any luck.
{{ 'hamoed' in state_attr('sensor.jewish_calendar_holiday_3, 'ID') }}
which I based on this post
Thank you in advance!
1 Like
Hi
try this
{{ 'hamoed' in state_attr('sensor.jewish_calendar_holiday_3', 'ID') }}
1 Like
tom_l
3
In case you don’t see the difference in PickOne’s template, you missed a quote after ...holiday_3
2 Likes
Thank you! I get an error message: TypeError: argument of type ‘NoneType’ is not iterable
Any idea what caused this? I tried googling it and I am not sure.
@tom_l can you please help with this question?
Troon
(Troon)
7
Show the YAML code for the automation, template, whatever you’re using, that gives this error.
Also show a screenshot for your holiday sensor (if that is what it is) from Developer Tools / States.
Thank you, will keep in mind going forward
the Yaml is as follows:
{{ 'hamoed' in state_attr('sensor.jewish_calendar_holiday_3', 'ID') }}
Thank you for the help!
Troon
(Troon)
11
A problem is visible though — the attribute you want is 'id'
not 'ID'
.
1 Like
tom_l
13
So even the pop-up card gives translated attribute keys.
Damn, that’s bad.
1 Like