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

Multiple input selects in automation

$
0
0

Hello,

I have three A/C units which I would like to “control” via multiple input_selects.

First input_select holds the actual units
Second input_select holds the swing mode
Third input_select holds the fan mode

My goal is to create a “flexibel” automation and/or script which can control each device and each setting without creating many automation/scripts for each unit.

For example, I can set the swing mode via a boolean with this code;

- alias: Set swing mode on AC unit
  trigger:
    platform: state
    entity_id: input_boolean.ac_set_swing_mode

  action:
    - service: climate.set_swing_mode
      data_template:
        entity_id: >
          {% if is_state("input_select.ac_device", "Unit 1") %} climate.unit1
          {% elif is_state("input_select.ac_device", "Unit 2") %} climate.unit2
          {% elif is_state("input_select.ac_device", "Unit 3") %} climate.unit3
          {% endif %}
      data:
        swing_mode:  "{{ states('input_select.swing_mode') }}"

This code sets the swing mode selected (in input_select.swing_mode) at the correct unit (chosen from input_select.ac_device by switching a boolean. No problem so far…

I want to make my automation fault proof. As for now, if somebody hits the boolean, the AC unit it switch on to set fan mode or swing mode. This is not my intent. I want the automation to run only if the selected AC unit is on (so status != “off”). Normally I would say, you need to create a condition for this, but I can’t seem to find out how.

I need a condition where the entity_id is based on input_select.ac_device value and status is different then off

Anybody who can help me out?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105534

Trending Articles



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