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

Help with mapping values from Input_select

$
0
0

@lkeays wrote:

Hi, I’ve been trying to map my input_select to an automation but I failed after long hours to figure out how to write the mapping code.

I need to feed this from my input select. data: {“event”:“DATA in HERE”}

Thanks for helping.

  - alias: set the heat
    trigger:
      - platform: state
        entity_id: input_select.thermostat_mode
    action:
      service: ifttt.trigger
      
      ##########################
      # The line here works.  But I fail to figure out how to write that command using the data from my input select.
      # data: {"event":"ha_evo_off"}
      ##########################
      
      # I fail to understand how to map my input_select values to replace the "ha_evo_off" above
      # This below doesn't work.
      
      data_template:
        preset_mode: >
          {% 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 %}
      data: {"event":preset_mode}

P.S. I am using IFTTT to achieve this since I wasn’t able to set my thermostat state directly from HA. :frowning:

Posts: 7

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 95397

Trending Articles



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