Hello Homies,
at first, thanks a lot for this incredible community and project.
I think my problem is simple af, but after 2 days trying and failing I give up and start my first thread. I read neraly every page with topic condition, ifelse but theres nothing about data template.
What I want to do:
A button starts a script
- show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: script.heizung_set_temperatur_template_wohn_ess
data:
state: 'ON'
target: {}
icon: mdi:radiator
name: An (20°C)
show_state: false
hold_action:
action: none
The submit of Data:STATE template to the script works correctly, checked on multiple levels.
The Script:
heizung_set_temperatur_template_wohn_ess:
sequence:
- service: climate.set_temperature
data:
entity_id: climate.essen_heizung
temperature: >
(% if '{{ state }}' == 'ON' %)
{{states('variable.heizung_tmp_on') | float}}
(% elif '{{ state }}' == 'OFF' %)
{{states('variable.heizung_tmp_off') | float}}
(% endif %)
mode: single
Everthing but the if condition is working. Its not possible for me to check the state in the condition. I tried a lot, i only show this example because I think this is the best example to explain.
Hope anybody can help me.
Grüße