What is wrong with my automation configuration?

Hello I’m trying to control my air conditioner with a broadlink rm pro. I have it set up 2 ways. First as a switch that allows me to turn it on & off. This works as expected.

The second way I’m trying to set it up is with an input_select. The reason I wish to do this is to be able to eventually control the strength of the AC rather than just on/off. I am unable to get this to work however. The input_select appears in the overview UI but nothing happens when I select the respective states. Have searched around the docs and forums but am still stuck. Appreciate your help.

configuration.yaml below:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate


switch:
  - platform: broadlink
    host: 192.168.1.236
    mac: '78:0f:77:18:0a:60'
    switches:
       ac_study:
          friendly_name: "Study AC"
          command_on: 'JgBMAnQ2EScQKRELEA0QDBApEAwQDg8oECkQDBEoEAoSDREnESgRCxApEScRDBAMECkQDBELECoQDBEMEAwQDBANEAwRDBAMEQwQDBANEAwQDRANEAwQDBAMEA0PDhAMESgQDBAMEA0QDRAMECgRKBELEA0QDQ8NEAwQKRELEQwQDBANDw0QDQ4qECgRDBAoESgRDBANDykQKBELESgRDBAMECgRDBANEAwQDRAMEAwRCxEMEQsRDBANDw0QDRAMEAwRCxEMEA0QDBELEQwQDBEMEQsQDRAMEA0QDRAMEAwQDBEMEA0QDBEMDwwRDBAMEQwQDRAMEAwRDBAMEA0QDBAMEA0QDBELEQwQDBEMEA0QDBAMEQwRCxEoEQsQDRAoEA0QKBEoEAACLXg2EScQKREJEwwQDBEoEAwRDBApECgQDRAoEQwRDBAoESgRCxApECgQDRAMECkQDBEMEScRDBELEQwQDBEMEAwQDRAMEA0QDBAMEQwQDBANEAwRDBAMEQsRDBEMDykRDBAMEQwQDBAMECkRJxANEAwQDRAMEA0QKBEMEQsQDQ8NEQwODhApEScRDBAoESgRDBANECgQKBEMECgQDRAMECkRCxEMEAwQDRAMEQwQDRAMEA0QCxANEAwQDRAMEA0QDBAMEA0QDBEMEAwRDBAMEAwRDBAMEA0QDRAMEAwQDRAMEA0QDBAMEQwQDBEMEA0QDBAMEQsRDBAMEA0QDBEMEQsRDBANDw0QDBELEQwRCxEMEQsRDBEnEQwQDBEoEQsQKRAoEQANBQAAAAAAAAAAAAAAAA'
          command_off: 'JgBMAnQ1ESgRJxEMEQsRDBEnEQwQDBEoECgRDBAoEQsRDBEoECgRDBAoESgRCxANEScRDBELDisRCxEMEAwRDBAMEQwRCxEMEAwRCxILEAwRDBELEQwQDBELEgsRCxEMEQwRCxELEQwRCxEMECgRKBAMEQwQDBEMDg4RKBAMEQsRDBAMEQwQDBEoECgRDBEnESgRCxEMESgQKBEMEScRDBAMESgQDBEMEQsRDBAMEQwQDBEMEAwRDBAMEQwQDBAMEQwRCxEMEQsRCxEMEQsODxEMEAwRCw4PEQsRDBAMEQwRCxEMEAwQDRAMEAwPDhELEQwRDBELEQwQDQ8NEAwQDBEMEAwQDRELEQsRDBELEQwQDBEMEAwRDA8qEQsRDBEnESgQDBEoEAACLXU5ESgQKBEMEAwRDBAoEQwQDBEoEScRDA4qEQwQDBEoECgRDBAoESgODhELEicRCxEMEScRDBAMEQwQDBENDwwRDBAMEQwRCxELEQwRDBELEQsRDBELEQwQDBEMDw0RCxEMEQsRDBAMDisQKBEMEQsRDBAMEQwQKRAMEAwPDhAMEQwRCxEoECgRDBEoDyoQDBEMECgRKBELESgRCxELEicRCxEMEAwRDBAMEQwRCxANEAwRDBAMEQsRDBELEQwQDBANEAwQDBEMEAwRDBELEQwQDBEMEAwRDA4OEQwNDxAMEQwRCw4PEAwRDBAMEQsRDBELEQwQDBANEAwQDQ0PEQwQDBEMEAwRDBELEQsRDBAMEQwRCxEoEAwRDBAoESgRCxEoEQANBQAAAAAAAAAAAAAAAA'

input_select:
  ac_study_select:
    name: "AC Study"
    options:
      - "OFF"
      - "HI"
          
group: !include groups.yaml
#automation: !include automations.yaml
script: !include scripts.yaml

automation:
- alias: Select AC OFF
  trigger:
    - platform: state
      entity_id: input_select.ac_study_select
      to: "OFF"
  action:
    - service: broadlink.send
      data:
        host: "192.168.1.236"
        packet: 'JgBMAnQ1ESgRJxEMEQsRDBEnEQwQDBEoECgRDBAoEQsRDBEoECgRDBAoESgRCxANEScRDBELDisRCxEMEAwRDBAMEQwRCxEMEAwRCxILEAwRDBELEQwQDBELEgsRCxEMEQwRCxELEQwRCxEMECgRKBAMEQwQDBEMDg4RKBAMEQsRDBAMEQwQDBEoECgRDBEnESgRCxEMESgQKBEMEScRDBAMESgQDBEMEQsRDBAMEQwQDBEMEAwRDBAMEQwQDBAMEQwRCxEMEQsRCxEMEQsODxEMEAwRCw4PEQsRDBAMEQwRCxEMEAwQDRAMEAwPDhELEQwRDBELEQwQDQ8NEAwQDBEMEAwQDRELEQsRDBELEQwQDBEMEAwRDA8qEQsRDBEnESgQDBEoEAACLXU5ESgQKBEMEAwRDBAoEQwQDBEoEScRDA4qEQwQDBEoECgRDBAoESgODhELEicRCxEMEScRDBAMEQwQDBENDwwRDBAMEQwRCxELEQwRDBELEQsRDBELEQwQDBEMDw0RCxEMEQsRDBAMDisQKBEMEQsRDBAMEQwQKRAMEAwPDhAMEQwRCxEoECgRDBEoDyoQDBEMECgRKBELESgRCxELEicRCxEMEAwRDBAMEQwRCxANEAwRDBAMEQsRDBELEQwQDBANEAwQDBEMEAwRDBELEQwQDBEMEAwRDA4OEQwNDxAMEQwRCw4PEAwRDBAMEQsRDBELEQwQDBANEAwQDQ0PEQwQDBEMEAwRDBELEQsRDBAMEQwRCxEoEAwRDBAoESgRCxEoEQANBQAAAAAAAAAAAAAAAA'
- alias: Select AC HI
  trigger:
    - platform: state
      entity_id: input_select.ac_study_select
      to: "HI"
  action:
    - service: broadlink.send
      data:
        host: "192.168.1.236"
        packet: 'JgBMAnQ2EScQKRELEA0QDBApEAwQDg8oECkQDBEoEAoSDREnESgRCxApEScRDBAMECkQDBELECoQDBEMEAwQDBANEAwRDBAMEQwQDBANEAwQDRANEAwQDBAMEA0PDhAMESgQDBAMEA0QDRAMECgRKBELEA0QDQ8NEAwQKRELEQwQDBANDw0QDQ4qECgRDBAoESgRDBANDykQKBELESgRDBAMECgRDBANEAwQDRAMEAwRCxEMEQsRDBANDw0QDRAMEAwRCxEMEA0QDBELEQwQDBEMEQsQDRAMEA0QDRAMEAwQDBEMEA0QDBEMDwwRDBAMEQwQDRAMEAwRDBAMEA0QDBAMEA0QDBELEQwQDBEMEA0QDBAMEQwRCxEoEQsQDRAoEA0QKBEoEAACLXg2EScQKREJEwwQDBEoEAwRDBApECgQDRAoEQwRDBAoESgRCxApECgQDRAMECkQDBEMEScRDBELEQwQDBEMEAwQDRAMEA0QDBAMEQwQDBANEAwRDBAMEQsRDBEMDykRDBAMEQwQDBAMECkRJxANEAwQDRAMEA0QKBEMEQsQDQ8NEQwODhApEScRDBAoESgRDBANECgQKBEMECgQDRAMECkRCxEMEAwQDRAMEQwQDRAMEA0QCxANEAwQDRAMEA0QDBAMEA0QDBEMEAwRDBAMEAwRDBAMEA0QDRAMEAwQDRAMEA0QDBAMEQwQDBEMEA0QDBAMEQsRDBAMEA0QDBEMEQsRDBANDw0QDBELEQwRCxEMEQsRDBEnEQwQDBEoEQsQKRAoEQANBQAAAAAAAAAAAAAAAA'

I can’t see anything obviously wrong with it. Is the automation on?

If you trigger the automation manually does the action occur?

If so then double check the input_select entity id in the development tools states panel.

This is the way I do it:

- id: lounge_aircon_manual
  alias: 'Lounge Room Aircon'
  trigger:
    platform: state
    entity_id: input_select.lounge_ac_mode
  action:
  - service_template: >
      {% if is_state('input_select.lounge_ac_mode', 'Powerful Heat') %} shell_command.lounge_ac_powerful_heat
      {% elif is_state('input_select.lounge_ac_mode', 'Normal Heat') %} shell_command.lounge_ac_normal_heat
      {% elif is_state('input_select.lounge_ac_mode', 'Silent Heat') %} shell_command.lounge_ac_silent_heat
      {% elif is_state('input_select.lounge_ac_mode', 'Powerful Cool') %} shell_command.lounge_ac_powerful_cool
      {% elif is_state('input_select.lounge_ac_mode', 'Normal Cool') %} shell_command.lounge_ac_normal_cool
      {% elif is_state('input_select.lounge_ac_mode', 'Silent Cool') %} shell_command.lounge_ac_silent_cool
      {% elif is_state('input_select.lounge_ac_mode', 'Dry') %} shell_command.lounge_ac_dry
      {% elif is_state('input_select.lounge_ac_mode', 'Off') %} shell_command.lounge_ac_off
      {% endif %}

You can replace the shell commands with scripts that send your broadlink packets.

Hi tom_l, it was indeed the case that the automation wasn’t turned on. (I suppose it makes sense that it needs to be enabled first but I can’t seem to find the documentation referring to the same)

Thanks for your help!

Theoretically all new automations should be enabled by default.

Occasionally this has been reported as not true. No idea why it happens.