Hi, i want an tap action with conditional data so i can execute a service with different values!.
The service does work when i execute it without condition.
I can use some help with the condition, because it gives an error…
the error shows up in the screen and disappears…
error:
(possible options: selecteer, opstarten, afsluiten)
code
tap_action:
action: call-service
service: input_select.select_option
data:
option: |-
{% if (entity.state == 'Verbonden') %}
afsluiten
{% else %}
opstarten
{% endif %}
target:
entity_id: input_select.nastypen
i also tried, also no luck
option: |-
[[[
if (entity.state == 'Verbonden')
return "afsluiten";
else
return "opstarten";
]]]