Or of course, user error. Either way can someone shed some light on this please?
I want a wait_template
based on the contents of an input_text
.
In the following four examples,
input_text.sonos_group_master
contains the string
“media_player.pool_room”
but none of them work. They wait forever despite it being True
The last one does work but doesn’t meet my requirements.
Thanks for looking and for any comments even if it’s to tell me I’m doing something wrong
- wait_template: >
{{ is_state(states('input_text.sonos_group_master'), 'playing') }}
- wait_template: >
{% if states(states('input_text.sonos_group_master')) == 'playing' %}
True
{% else %}
False
{% endif %}
- wait_template: >
{% set master = states('input_text.sonos_group_master') %}
{% if states(master) == 'playing' %}
True
{% else %}
False
{% endif %}
- wait_template: >
{% set master = states('input_text.sonos_group_master') %}
{{ is_state(master, 'playing') }}
This works
- wait_template: >
{{ is_state('media_player.pool_room', 'playing') }}
EDIT: So, if I create a sensor based on the state of media_player.pool_room
like this,
- platform: template
sensors:
sonos_master_state:
friendly_name: Sonos Master state
value_template: >
{{ states('media_player.pool_room') }}
then use a wait_template
like this,
{% if states('sensor.sonos_master_state') == 'playing' %}
True
{% else %}
False
{% endif %}
Then it works.
Surely this is a bug or at least a deficiency?