I 've got a heater which is operated by different modes displayed in a select menu :
- Comfort
~~- Comfort -1 - Comfort -2~~
- Eco
- Frost protection
- OFF
I'd like to make a button to go through the options that aren't crossed
Because making a button with a tap-action that would be: perform_action: select.select_next
would have the correct behavior but would make me go through comfort -1 and comfort -2 that I don't want.
That's why I tried this:
tap_action: action: perform-action perform_action: select.select_option target: device_id: da9e0899fc6239769448a6e5f1b1121d data: option: > {% set state = states['select.radiateur_salon_pilot_wire_mode'].state %} {% if (state == "comfort" %} eco {% elif state == "eco" %} comfort {% elif state == "frost_protection" %} off {% else %} mdi:power {% endif%}
But it won't work, displaying the following error:
the option {% set state = states['select.radiateur_salon_pilot_wire_mode'].state %} {% if (state == "comfort") %} eco {% elif state == "eco" %} comfort {% elif state == "frost_protection" %} off {% else %} mdi:power {% endif%} isn't valid for the following entity: select.radiateur_salon_pilot_wire_mode, correct options are : comfort, eco, frost_protection, off, comfort_-1, comfort_-2.
It seems like the "option" field can't get any templating... I don't what to do...
Can anyone help ?
Thank you in advance