Dear Community,
I need your help once again.
I want to control my air conditioner via Hassio. For this I have written a script (started by an automation), which should switch the air conditioning “on” or “off” depending on a sensor.
For this I want to use the following template in a script, which however does nothing. What I am doing wrong with this template?
sequence:
# Frostwaechter Poolhaus Hauptbereich EIN oder AUS schalten
- service_template: >-
{% if is_state('input_boolean.test_schalter', 'on') %}
climate.set_hvac_mode
target:
entity_id: climate.klima_poolhaus
data:
hvac_mode: 'heat'
{% else %}
climate.set_hvac_mode
target:
entity_id: climate.klima_poolhaus
data:
hvac_mode: 'off'
{% endif %}
If I only address the service (do not use a template) it works:
sequence:
# Frostwaechter Poolhaus Hauptbereich EIN oder AUS schalten
- service: climate.set_hvac_mode
target:
entity_id: climate.klima_poolhaus
data:
hvac_mode: 'off'
What is wrong with my template? Is there perhaps a problem with the tabs (formatting)?
I thank you already for your support.
KR Markus