Very basic input select with thermostat states

Hi,
I’ve tried many things so far and I can’t get to do this:

Input select
-Home
-Away
-Reset

# in configuration.yaml
input_select:
  thermostat_mode:
    name: Thermostat Mode
    options:
      - "away"
      - "home"
      - "Reset"
    icon: mdi:target

and then in

# in automation.yaml
  - alias: set the heat
    trigger:
      - platform: state
        entity_id: input_select.thermostat_mode
    action:
      - service: switch.turn_on
        entity_id: climate.home
        preset_mode: "{{ trigger.to_state.state }}"

in the official doc, there is even this specific case used as an example. But I can’t find anywhere in that doc where to link my entidy_ID.

The platform I’m using for heat is Honnywell EvoHome. Thersmostats etc work fine in my dashboards.

Thanks

Your action block is incorrect if you’re trying to change the climate mode. See here. Try something like this for the action:

  action:
    - service: climate.set_preset_mode
      data_template:
        entity_id: climate.home
        preset_mode: "{{ trigger.to_state.state }}"

This is also assuming those options are valid preset modes for your thermostat integration.

Thanks for helping. I can load it, but it doesn’t trigger anything. The logs shows
Error rendering data template: UndefinedError: ‘trigger’ is undefined

Tue Nov 12 2019 18:48:44 GMT+0100 (Central European Standard Time)
Error rendering data template: UndefinedError: 'trigger' is undefined

My input values are the same as in the state of the element

I’d check the capitalization on home and away to see if those need to be capitalized. Also, did you try changing the input_select when it gave you that error? Manually triggering the automation by pressing the trigger button in the UI will give you that error since there was no actual trigger.

Hi,

I’ve checked both versions of the capitalization. Something gets to my system because I can see something flashing on the Honnywell app as if it received a directive. But it’s not acting on it.

Working solution:
I ditched the approach to use input_select directly to my thermostat (I was fedup of failing).
I used IFTTT instead and it works

Instructions if anybody need:

# in configuration.yaml
input_select:
  thermostat_mode:
    name: Thermostat Mode
    options:
      - "Zet Uit (off)"
      - "Reset"
      - "Woonkamer Opwarmen"
      - "Tijdelijk Weg"
    icon: mdi:target

#This will use webhooks from IFTTT.  
#You need to generate a webhook read the doc here: 
#https://www.home-assistant.io/integrations/ifttt/
ifttt:
  key:  [replace with your api key from webhook]

Then in my automation:

#in automation.yaml
  - alias: set the heat
    trigger:
      - platform: state
        entity_id: input_select.thermostat_mode
    action:
      service: ifttt.trigger
      data_template:
        event: >
          {% if is_state("input_select.thermostat_mode", "Zet Uit (off)") %}
            ha_evo_off
          {% elif is_state("input_select.thermostat_mode", "Reset") %}
            ha_evo_reset
          {% elif is_state("input_select.thermostat_mode", "Woonkamer Opwarmen") %}
            ha_evo_warmup
          {% elif is_state("input_select.thermostat_mode", "Tijdelijk Weg") %}
            ha_evo_away
          {% else %}
            ha_evo_reset
          {% endif %}

Honnywell - Evohome (my thermostats) have apps avalable in IFTTT. It was a simple matter of:
In IFTTT:
If :“webhooks” event = ha_evo_off,
then
That: “evohome” set status to whatever
(it’s all in the app - I needed to also configure access from evohome to IFTTT)

Finally, my widget styled in HADashboard

and its code:

huis:
    widget_type: input_select
    entity: input_select.thermostat_mode
    title: Radiatoren van het hele Huis
    title2: Welke stand?
    title_style: "color: lightblue; font-size: 150%; font-weight: bold;"
    title2_style: "color: lightblue; font-size: 150%; font-weight: bold; position: relative; top: 20px;color: #FFAA01"
    select_style: "position: relative; top: 0px;"
    widget_style: "background: linear-gradient(to bottom, rgba(22,123,191,1) 0%,rgba(0,57,132,1) 100%);"