Super Simple!!.
I want to change the state of a service from ‘1’ to ‘2’ or viceversa when I tap the icon.
The code is:
type: custom:mushroom-template-card
primary: Level
secondary: ''
icon: mdi:home
tap_action:
action: call-service
service: select.select_option
service_data:
option: |
{% if is_state('select.calefactor_jose_temperature_level', '1') %}
'2'
{% else %}
'1'
{% endif %}
target:
entity_id: select.calefactor_jose_temperature_level
But I get the mensage:
Failed to call service select/selection_option. Option {% if is_state(‘select.calefactor_jose_temperature_level’, ‘1’) %} ‘2’ {% else %} ‘1’ {% endif %} not valid for Smart Heater Jose Temperature Level
I been craking my head to fix this and I cant find any thing.