Closed Switch123456789 closed 9 months ago
This has actually nothing to do with the integration, rather the way the state condition is implemented.
When you look at this article, you can see there is a condition for numeric state, and "regular" state, no boolean state.
The actual code itself is clear on the matter. It accepts strings or lists of strings.
So, I am afraid you will need to either use a template condition or use 'on'
for true
or 'off'
for false
This is a possible solution
condition: template
value_template: >-
{{ not state_attr("media_player.ha_media_player","consume_mode") }}
Hey thank you for clarifying! Sorry for the delay, I was pretty busy recently.
That's the thing, 'on'
& 'off'
doesn't work with conditions but true
& false
does for whatever reason (even if not officially supported). So my scripts works fine with the action I screenshoted. From my example, only repeat
works properly because it returns on
or off
, instead of true
or false
.
Some attributes return
on
/off
and some returntrue
/false
. The true/false values cause issues when I use conditions in scripts, because these states aren't recognized by HA if i put them in quotation-marks. I can work around that by removing them manually but this disables the ui-editor. I guess HA doesn't like booleans in attribute-values and persists on having strings (on/off).