Hi,
I’m trying to update the icon dynamically on an template type select entity as described in the documentation (Template - Home Assistant) however the icon never changes:
Here is the template cote:
select:
- name: "Radiateur Bureau"
unique_id: radiateur_bureau_mode
state: >
{% set pilote = states('switch.radiateur_bureau_switch_pilote') %}
{% set normal = states('switch.radiateur_bureau_switch_normal') %}
{% if pilote == 'off' and normal == 'off' %}
Confort
{% elif pilote == 'on' and normal == 'on' %}
Eco
{% elif pilote == 'on' and normal == 'off' %}
Arrêt
{% endif %}
icon: >
{% if is_state("select.radiateur_bureau", "Confort") %}
mdi-radiator
{% elif is_state("select.radiateur_bureau", "Eco") %}
mdi-radiator-disabled
{% else %}
mdi-radiator-off
{% endif %}
options: "{{ ['Eco', 'Confort', 'Arrêt'] }}"
select_option:
- service: script.radiateur
data:
mode: "{{ option }}"
radiateur: "switch.radiateur_bureau_switch"
Everything else in the template is Ok. The script is correctly called etc… Just nothing happens on the icon. Does anybody see what is wrong here ?
Thanks