Climate Automation Question

I have this automations section inside of a package.

automation:
  - alias: Set Thermostat Mode Off
    trigger:
      platform: template
      value_template: "{% if is_state('input_select.thermostat_mode', 'off') %}true{% endif %}"
    action:
      service: switch.turn_Off
      entity_id: switch.remotec_zfm80_switch
  - alias: Set Thermostat Mode On
    trigger:
      platform: template
      value_template: "{% if not is_state('input_select.thermostat_mode', 'off') %}true{% endif %}"
    action:
      service: switch.turn_on
      entity_id: switch.remotec_zfm80_switch
  - alias: Set Thermostat Mode
    trigger:
      - platform: state
        entity_id: input_select.thermostat_mode
    action:
      - service: climate.set_operation_mode
        data:
          entity_id: climate.['2gig_technologies_ct101_thermostat_iris_cooling_1']
          operation_mode: "{{ trigger.to_state.state }}"

The set mode on/off works. My next attempt was to set the mode of the actual device. climate.[‘2gig_technologies_ct101_thermostat_iris_cooling_1’].
Does anyone see my syntax error.

You’ll want data_template: rather than data: in that last action block. And that entity_id doesn’t look right to me. You probably want just: climate.2gig_technologies_ct101_thermostat_iris_cooling_1. Look for the entity in your states dev tool.

The reason why I did that was when I was templating the other day since it started with a number 2gig, I had to.
Not sure how many issues, fixed the one you mention, I changed the order of entity_id and data. Then I hardcoded to data and operation_mode: Auto and it worked. Then switched to data_template, still no joy. So I hardcoded the template to {{ ‘Off’ }} and it would work. Then I looked back at the input_select part of the package (not shown before) and all my list was lower case. Set the case right and it worked. Thanks for getting me pointed right. :slight_smile:

Also, the was a hello world test. Normally you would just use the input zwave provided. But there are other attributes that if I want to change, I have to set. I see there are input_select, input_slider, is there a input_textbox? Back to googling. :slight_smile:

So here is the entire package that worked.

input_select:
  thermostat_mode:
    name: Thermostat Mode
    options:
      - "Auto"
      - "Off"
      - "Cool"
      - "Heat"
    icon: mdi:target

group:
  thermostat_views:
    view: yes
    name: Thermostat
    entities:
    - group.thermostat_mode
  thermostat_mode:
    name: Thermostat Modes
    entities:
    - climate.2gig_technologies_ct101_thermostat_iris_cooling_1
    - sensor.thermostat_battery


sensor:
- platform: template
  sensors:
    thermostat_battery:
      friendly_name: "Thermostat Battery"
      unit_of_measurement: "%"
      value_template: >-
        {%- if states.zwave['2gig_technologies_ct101_thermostat_iris'].attributes.battery_level %}
            {{ states.zwave['2gig_technologies_ct101_thermostat_iris'].attributes.battery_level }}
        {% else %}
            Unknown
        {%- endif %}


automation:
  - alias: Set Thermostat Mode Off
    trigger:
      - platform: template
        value_template: "{% if is_state('input_select.thermostat_mode', 'off') %}true{% endif %}"
    action:
      - service: switch.turn_Off
        entity_id: switch.remotec_zfm80_switch
  - alias: Set Thermostat Mode On
    trigger:
      - platform: template
        value_template: "{% if not is_state('input_select.thermostat_mode', 'off') %}true{% endif %}"
    action:
      - service: switch.turn_on
        entity_id: switch.remotec_zfm80_switch
  - alias: Set Thermostat Mode
    trigger:
      - platform: state
        entity_id: input_select.thermostat_mode
    action:
      - service: climate.set_operation_mode
        entity_id: climate.2gig_technologies_ct101_thermostat_iris_cooling_1
        data_template:
          operation_mode: "{{ trigger.to_state.state }}"
#{{ states.climate['2gig_technologies_ct101_thermostat_iris_cooling_1'].state }}
#{"entity_id": "climate.2gig_technologies_ct101_thermostat_iris_cooling_1", "operation_mode": "Off"}

Unfortunately, there’s no input_textbox yet. Something like that’d be handy, tho.