AC Split System integration via Harmony Remote

I have been able to integrate my AC Split System into HA using a Harmony Hub and IR commands.

This took a while to setup but I am now able to perform many different air conditioner actions via Home Assistant in an intuitive fashion.

The end result allows me to control the Operating Mode (COOL / FAN / OFF), the Fan Mode (AUTO / LOW / MED / HIGH), the Swing Mode (SWING or TOP) and the Target Temperature (18 - 22).

I started by making a generic Air Conditioner device within Harmony and teaching a Power On and Power Off command via the AC Remote Control. As these remotes send all the setting whenvever a change is made I then taught a list of IR Commands to the device for temperatures and settings which I would generally use. I came up with the convention of TEMPERATURE-FANMODE-SWINGMODE. After this I created a long list of all the separate commands which would be required (examples below).

18-AUTO-SWING
18-AUTO-TOP
…
18-MED-SWING
19-AUTO-SWING
…
FAN-LOW-SWING
FAN-MED-SWING

Once the list was created I started to manually teach each individual command to the Harmony Hub - this was quickest (although still slooooowww) via the PC application rather than the mobile app. In order for the remote to send the correct command it had to be turned off with the correct setting and then turned back on whilst the Harmony Hub was ready to learn the command.

Once all the IR commands had been setup I needed to integrate the device into Home Assistant.

Once it was integrated and the ‘harmony_harmony_hub.conf’ file was populated with the IR commands, I setup the required configurations. I won’t dig into the configurations far but basically I use a Template Sensor to format the Input_Select and Input_Slider data and then Automations to send the commands to the Harmony Hub whenever the inputs are updated.

input_select:
  ac_operation_mode:
    name: Operating Mode
    options:
      - COOL
      - FAN
      - Power Off
    initial: Power Off
    icon: mdi:settings
  ac_fan_mode:
    name: Fan Mode
    options:
      - AUTO
      - LOW
      - MED
      - HIGH
    initial: AUTO
    icon: mdi:fan
  ac_swing_mode:
    name: Swing Mode
    options:
     - TOP
     - SWING
    icon: mdi:arrow-expand
    
input_slider:
  ac_target_temp:
    name: Set Target Temp
    min: 18
    max: 22
    step: 1
    initial: 21

sensor:	  
  - platform: template
    sensors:
      ac_setting_cool:
        friendly_name: 'Current AC Cool Setting'
        value_template: '{{ states.input_slider.ac_target_temp.state | int }}-{{ states.input_select.ac_fan_mode.state }}-{{ states.input_select.ac_swing_mode.state }}'
      ac_setting_fan:
        friendly_name: 'Current AC Fan Setting'
        value_template: 'FAN-{{ states.input_select.ac_fan_mode.state }}-{{ states.input_select.ac_swing_mode.state }}' 
      ac_target:
        friendly_name: 'Target Temperature'
        value_template: '{{ states.input_slider.ac_target_temp.state | int }}'
        unit_of_measurement: '°C'
  
automations:
  # Start Air Conditioner - Cool
  - id: ac_start_cool
    alias: AC Start Cool
    hide_entity: True
    trigger:
    - platform: state
      entity_id: input_select.ac_operation_mode
    - platform: state
      entity_id: input_select.ac_fan_mode
    - platform: state
      entity_id: input_select.ac_swing_mode
    - platform: state
      entity_id: input_slider.ac_target_temp    
    condition:
    - condition: state
      entity_id: input_select.ac_operation_mode
      state: 'COOL'
    action:
    - service: remote.send_command
      entity_id: remote.living_room
      data_template:
        device: "44392204"      
        command: "{{ states.sensor.ac_setting_cool.state }}"
    
  # Start Air Conditioner - Fan
  - id: ac_start_fan
    alias: AC Start Fan
    hide_entity: True
    trigger:
    - platform: state
      entity_id: input_select.ac_operation_mode
    - platform: state
      entity_id: input_select.ac_fan_mode
    - platform: state
      entity_id: input_select.ac_swing_mode
    condition:
    - condition: state
      entity_id: input_select.ac_operation_mode
      state: 'FAN'
    action:
    - service: remote.send_command
      entity_id: remote.living_room
      data_template:
        device: "44392204"      
        command: "{{ states.sensor.ac_setting_fan.state }}"
    
  
  # Stop Air Conditioner
  - id: ac_stop
    alias: AC Stop
    hide_entity: True
    trigger:
    - platform: state
      entity_id: input_select.ac_operation_mode
      to: 'Power Off'
    action:
    - service: remote.send_command
      entity_id: remote.living_room
      data_template:
        device: "44392204"
        command: "PowerOff"

group:		
  airconditioner:
    name: AC Split System
    entities:
      - input_select.ac_operation_mode
      - input_select.ac_fan_mode
      - input_select.ac_swing_mode
      - input_slider.ac_target_temp
      - sensor.ac_target
      - sensor.fibaro_system_fgms001zw5_motion_sensor_temperature

So far this has proven work reliably for me and was worth the effort! Let me know if there are any questions, you can also checkout my current setup at my GitHub repository.

11 Likes

Great share! I was looking into reverse engineering an AC remote through decoding IR codes. Tedious and can be frustrating but this approach seems to be intuitive and simple enough not to pull out some hairs on the head. I did not know you can teach harmony hub to learn ir codes? I was thinking of getting a harmony hub for my Google Home+set top box+changing TV input through IFTTT (google home is still not officially available here in Australia). Thanks again for sharing!

Thanks @charlesdalid, it’s good to see someone getting something out of it :slight_smile:
It did take a while to get all the codes in but I just had the TV on in the background so it wasn’t too tedious!

Logitech teaching process can be found at https://support.myharmony.com/en-us/teach-harmony-a-missing-command, as mentioned above I recommend using the desktop application as I found the phone app to be much slower.

I’m also from Australia and have a Google Home, still haven’t played around with the Harmony integration that much as of yet although I am planning to at some stage with shortcuts.

Thanks, great project! :smile:

Interface looks really cool… Not sure if this can be done with rm pro? I dont have a harmony hub and not sure how it links to HA… cheers

Hey @LaFed ,
Sorry I don’t have a Broadlink RM Pro but it shouldn’t have any problems being used in a similar way although it may take a while to setup the IR Commands. Based on the Broadlink documentation you should be able to learn the IR Packet for each AC command, add each command as a switch within the Broadlink platform and then call the Broadlink switch command within the action stage of the automation.

I believe your Broadlink Switch configuration should look something like…

switch:
  - platform: broadlink
    host: 192.168.1.2
    mac: 'B4:43:0D:CC:0F:58'
    timeout: 15
    switches:
      18-AUTO-SWING:
        command_on: 'JgAcAB0dHB44HhweGx4cHR06HB0cHhwdHB8bHhwADQUAAAAAAAAAAAAAAAA='
		command_off: 'JgBIAAABH5YPFBETETgUERAUEBURFBATETgROBEUETcSNxE4ETcSOBISEBUQFREUEjUSFBA5ETcRNxE4ETkQOBAUEjcRFRAUEQANBQ=='
      18-AUTO-TOP:
        command_on: 'JgAcAB0dHB44HhweGx4cHR06HB0cHhwdHB8bHhwADQUAAAAAAAAAAAAAAAA='
		command_off: 'JgBIAAABH5YPFBETETgUERAUEBURFBATETgROBEUETcSNxE4ETcSOBISEBUQFREUEjUSFBA5ETcRNxE4ETkQOBAUEjcRFRAUEQANBQ=='

too bad it doesnt seem to work… will have to try other AC setup then… thanks!!

Yep. Problem is that with Broadlink we can only use “command_on” and “command_off” since it’s a switch component.

It would be nice to see this in here: https://home-assistant.io/components/#remote

Congrats on your configuration @stanvx

Thanks @abanaru, also if using a broadlink device, I recommend checking out the Broadlink IR Climate custom component.
https://community.home-assistant.io/t/broadlink-ir-climate-component/27406

1 Like

Hi @stanvx, please suggest me to modify your code so it’s compatible with Broadlink. Thanks

I know this is late, but I have actually just finished configuring my RF Ceiling Fan to be controlled by a Broadlink RM Pro in a similar way. The package file is linked below, basically it uses the switch.turn_on service against the appropriate Broadlink switch.

https://github.com/stanvx/Home-Assistant-Configuration/blob/master/packages/broadlink_fan_control.yaml

@stanvx Pls share your harmony_xxxx.conf file which include AC command. Thanks

@Joethanh

Configuration file is attached, as you’ll notice I don’t have every setting added but I have most. - Also ‘.yaml’ was added to allow the upload.

harmony_harmony_hub.conf.yaml (2.2 KB)

1 Like

Thank you so much

@stanvx did you have issues with the AC not responding to harmony IR commands after you’ve learned the commands?

Not really, my commands have been spot on once I found the right location for the Harmony device.

Hi all, I ended up creating a custom climate component for AC Integration via Harmony. The benefit of this, is it appears as a climate device in home assistant so you can use the built in way of controlling climate devices or even the lovelace thermostat card.

thermostat_harmony

2 Likes

Stupid question from a noob like me :slight_smile: …How can I get this interface on my harmony one… (step by step)…please anyone help a beginner. Thanx!