Air conditioner automation with IR

The problems I didn’t expect to have

George Shuklin
Loyal home
3 min readJul 24, 2024

--

My very good air conditioners (Mitsubishi Heavy Industries Diamond series) are a bit old for a proper ‘wifi dongle’ things. There are some dongles, but they are costly and I have no idea if they will work with Home Assistant or not.

The next best way to automate them, is Universal smart IR remote control:

An example of Zigbee IR remote

I thought it would be super easy. Turned out, it’s not.

Problem1: recording IR sequence

Abilities of the remote are super simple:

Available options: State, Learn, Send

The purposed way to use it:

  1. Turn ‘state’ in ‘ON’ position (start the capture).
  2. Device will lid an indicator.
  3. Press a button on the original remote.
  4. Wait for few seconds, get code in ‘Learned IR code’.
  5. If you want to transmit it, put it into ‘IR code to send’.

(We will go into automation part later).

The problem I got is… How to say? I’m getting different codes every time for the same button, and some of them does not cause expected behavior.

Codes are different length (which is unexpected!) and does not have anything common. Here people are saying about magical bytes at the beginning, I don’t see this at all in the decoded output (the ‘learned IR code’ is base64 encoded binary sequence).

Also, some sequences are doing about the same I want (e.g. turn A/C in cooling mode), but I feel settings are different (e.g. speed is lower, or desired temperature is higher).

Why?

Given that some sequences does not work, I suspect, it’s an IR remote problem (bad capture). But, may be, there is something odd happening in the remote protocol.

The problem with many sequences is that it’s really hard to debug. Every A/C has built-in compressor protection for on/off cycle, so every validation take a bit of time. Also, it’s hard to say what happens after A/C is on. Does it cool or not?

As result, I barely got three sequences for minimal use of A/C in summer, and I still not sure they are completely fine.

Problem2: Message is too long

The sequences I’m getting have different length, including, more than 255 bytes (in base64 form). Due to some odd reasons (unrelated device with the same 255 bytes problem), the payload can’t be more than 255 bytes. Which is odd. Is it mqtt problem? Should I switch device back to ZHA network? I have it, but it’s sparse and does not have all blows and whistles of Zigbee2MQTT.

Automation

Until I solve those problems, there is no point to make it fancy. I done the minimal thing, created three scripts (on, off, high-power mode), and use them, with working sequences.

The way to do it: in the device, Scripts, (+) button, Set value for (device name) Ir code to send, and paste the code (if it fits 255 symbols!):

Script examples for IR automation

Save it, and add to any dashboard for running.

A simple panel for three scripts to control A/C via Zigbee

Very rudimentary, much less than I expected. I’ll continue to try to get proper codes for A/C, but, as I said, it’s much harder and slower task than I expected.

--

--

George Shuklin
Loyal home

I work at Servers.com, most of my stories are about Ansible, Ceph, Python, Openstack and Linux. My hobby is Rust.