Is it possible to control a Split AC (generic brands)

Hi.

I’d like to control my AC devices using IR enabled ESPs modules (ie: replace remotes) using HA. Is this possible?

Yes it’s possible.

1 Like

Found a suitable IR receiver and mounted it on a test environment as described here:

Then added this to ESPHome code:

remote_receiver:
  pin: D4
  dump: all

Now, with nothing pointing at the receiver, I’m continuously getting values from the IR receiver. Is this normal?

[08:10:43][C][remote_receiver.esp8266:059]: Remote Receiver:
[08:10:43][C][remote_receiver.esp8266:060]:   Pin: GPIO2 (Mode: INPUT)
[08:10:43][W][remote_receiver.esp8266:063]: Remote Receiver Signal starts with a HIGH value. Usually this means you have to invert the signal using 'inverted: True' in the pin schema!
[08:10:43][C][remote_receiver.esp8266:065]:   Buffer Size: 1000
[08:10:43][C][remote_receiver.esp8266:066]:   Tolerance: 25%
[08:10:43][C][remote_receiver.esp8266:067]:   Filter out pulses shorter than: 50 us
[08:10:43][C][remote_receiver.esp8266:068]:   Signal is done after 10000 us of no changes
[08:10:43][C][captive_portal:169]: Captive Portal:
[08:10:43][C][ota:029]: Over-The-Air Updates:
[08:10:43][C][ota:030]:   Address: wemosd1.local:8266
[08:10:43][C][api:095]: API Server:
[08:10:43][C][api:096]:   Address: wemosd1.local:6053
[08:10:43][D][remote.raw:041]: Received Raw: -219, 6096, -121
[08:10:43][D][remote.raw:041]: Received Raw: -218, 5303, -164, 3976, -142
[08:10:44][D][remote.raw:041]: Received Raw: -219
[08:10:44][D][remote.raw:041]: Received Raw: -218
[08:10:44][D][remote.raw:041]: Received Raw: -86
[08:10:44][D][remote.raw:041]: Received Raw: -160
[08:10:44][D][remote.raw:041]: Received Raw: -220
[08:10:44][D][remote.raw:041]: Received Raw: -87
[08:10:48][D][remote.raw:041]: Received Raw: -143, 4666, -209
[08:10:48][D][remote.raw:041]: Received Raw: -94, 4996, -197
[08:10:48][D][remote.raw:041]: Received Raw: -89, 988, -89, 352, -98
[08:10:48][D][remote.raw:041]: Received Raw: -146
[08:10:48][D][remote.raw:041]: Received Raw: -209
[08:10:48][D][remote.raw:041]: Received Raw: -143
[08:10:48][D][remote.raw:041]: Received Raw: -82, 680, -83
[08:10:48][D][remote.raw:041]: Received Raw: -89, 6839, -145
[08:10:48][D][remote.raw:041]: Received Raw: -100
[08:10:48][D][remote.raw:041]: Received Raw: -137
[08:10:48][D][remote.raw:041]: Received Raw: -97
[08:10:48][D][remote.raw:041]: Received Raw: -215
[08:10:48][D][remote.raw:041]: Received Raw: -103
[08:10:48][D][remote.raw:041]: Received Raw: -145
[08:10:49][D][remote.raw:041]: Received Raw: -120
[08:10:49][D][remote.raw:041]: Received Raw: -84
[08:10:49][D][remote.raw:041]: Received Raw: -75, 1192, -91

When I press a key on my remote control,l here is what was displayed:

[08:22:20][D][remote.raw:028]: Received Raw: -4395, 4379, -572, 1611, -571, 525, -571, 1614, -572, 1637, -545, 542, -552, 524, -571, 1610, -571, 555, -542, 553, -544, 1615, -572, 524, -570, 525, -572, 1635, -546, 1611, -571, 524, -570, 1618, -570, 553, -546, 1610, -571, 1639, -542, 
[08:22:20][D][remote.raw:028]:   1639, -544, 1611, -571, 523, -572, 1615, -571, 1612, -573, 1615, -572, 523, -572, 549, -545, 551, -544, 551, -546, 1635, -546, 525, -570, 525, -573, 1615, -573, 1609, -573, 1610, -572, 549, -545, 524, -571, 550, -546, 550, -545, 552, -545, 551, -546, 
[08:22:20][D][remote.raw:028]:   524, -571, 548, -546, 1614, -573, 1610, -571, 1610, -572, 1611, -571, 1637, -515, 5251, -4431, 4360, -572, 1637, -546, 549, -546, 1641, -544, 1636, -545, 552, -544, 551, -544, 1617, -565, 526, -570, 553, -544, 1641, -545, 550, -545, 524, -571, 1637, 
[08:22:20](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[08:22:20][D][remote.raw:041]:   1637, -544, 552, -543, 552, -544, 524, -571, 550, -545, 552, -546, 551, -545, 553, -541, 556, -539, 1615, -573, 1637, -544, 1611, -572, 1637, -545, 1612, -541

I noticed this while no key is pressed (41):
[08:22:20][D][remote.raw:041]

and, this, when I press a key on the remote (28):
[08:22:20][D][remote.raw:028]

What do these values mean?

Try the suggestion on the ESPhome website:

Note

If the log output is flooded with “Received Raw” messages, you can also disable raw remote code reporting and rely on rc_switch to decode the values.

remote_receiver:
  pin: D0
  dump:
    - rc_switch
  tolerance: 50%
  filter: 250us
  idle: 4ms
  buffer_size: 2kb

If the codec is already implemented in ESPHome, you will see the decoded value directly - otherwise you will see the raw data dump (which you can use just as well). You have just successfully captured your first RF code.

Make sure you have no CFL or fluorescent lights in the room and adding some decoupling capacitors to the ESP and IR Vcc line are also worth a try. Keep the capacitor leads as short as possible, a 0.1uF and a 100uF should do. Keep the IR receiver leads short as possible too but keep the IR diode away from the ESP antenna.

An IR pass filter in front of the IR diode that cuts visible light might be required as might a grounded shielded enclosure around the IR receiver and cabling (not the ESP antenna obviously!).

Thanks @tom_l.

I tried with rc_switch but then noticed it is just for RF receivers, not IR.

Added a decoupling capacitor. Still no luck. Will keep trying.

Is your phone near? It probably has a proximity sensor that emits IR. Try putting your phone away (and other electronics that may have proximity sensors, or cameras with night vision).