Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95459

Pls help w/ service template for climate (heater)

$
0
0

@prankousky wrote:

Hi everybody,

below is my automation for toggling an SPZB0001 zigbee thermostat depending on the window state (determined by a Xiaomi Aqara Door Sensor). Unfortunately, it does not work. I am not quote sure what I am doing wrong, so would somebody please guide me in the right direction?

I have read the docs, that why I don’t understand how this could be wrong… It should set the hvac_mode depending on the window state…?

Thank you in advance for your ideas :slight_smile:


automation:
  - id: "heizung_az_aus"
    alias: "[Heizung] AZ Aus"
    trigger:
      - platform: state
        entity_id: binary_sensor.arbeitszimmer_fenster_contact
    action:
      - service: climate.set_hvac_mode
        entity_id: climate.arbeitszimmer_heizung_climate
        service_template:
          hvac_mode: >
            {% if states("binary_sensor.arbeitszimmer_fenster_contact") == "on" %}
              "off"
            {% elif states("binary_sensor.arbeitszimmer_fenster_contact") == "off" %}
              "on"
            {% endif %}

I have also tried this

automation:
  - id: "heizung_az_aus"
    alias: "[Heizung] AZ Aus"
    trigger:
      - platform: state
        entity_id: binary_sensor.arbeitszimmer_fenster_contact
    action:
      - service: climate.set_hvac_mode
        data_template:
          entity_id: climate.arbeitszimmer_heizung_climate
          hvac_mode: >
            {% if states("binary_sensor.arbeitszimmer_fenster_contact") == "on" %}
              "off"
            {% elif states("binary_sensor.arbeitszimmer_fenster_contact") == "off" %}
              "on"
            {% endif %}


Posts: 9

Participants: 5

Read full topic


Viewing all articles
Browse latest Browse all 95459

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>