IR receiver for triggering automations

Hello,

I bought a XIAO Smart IR Mate with ESPHOME so Home Assistant could send IR commands to my ceiling fan. That works fine.

Now I'm trying to do the opposite: use an old IR remote to trigger actions on Home Assistant. I haven't found any simple and easy solutions.

Do you have any recommendations for ready-made Wi-Fi receivers like my XIAO?

Thank you for your help.

Use this it has triggers so you can use a old remote to trigger something in HA.

thank you i've read this. but I don't know witch device should I buy ?

Can I use my Seeed XIAO for IR receving too ?

I have this one the range is really good.

Hello

I just got an ATHOM IR/RF unit.
I assigned it an IP, added it to ESPhome, and upload a quick YAML config:

substitutions:
  name: athom-rf-ir-remote-3504d8
  friendly_name: Athom RF IR Remote 3504d8
packages:
  China Athom Technology.Athom RF IR Remote: github://athom-tech/esp32-configs/athom-rf-ir-remote.yaml
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  encryption:
    key: blablabla
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

I do have the infrared.athom_rf_ir_remote_3504d8_ir_proxy_receiver entity, and it reacts whenever I press a button on any of my remotes.

I added HAIR…
It successfully sniff and send commands from an IR fan remote, but it fails to sniff from the TV remote.

Actually, that’s not quite it; I’m trying to get it to learn the four colored buttons on my remote, but it seems to be picking up the same code regardless of which button is pressed.

Have a look at esphome logs to see what’s going on and what you really receive from your remote.

Hi a click on the red button show me this in logs:

[22:43:18.888][I][remote.pronto:231]: Received Pronto: data=
[22:43:18.944][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 002D 0018 0016 0018 002D 0018 0017 0017 0016 0018 002D 0018 0016 0018 002D 0018 002D 0018 002D 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0181 
[22:43:18.944][I][remote.sony:064]: Received Sony: data=0x000052E9, nbits=15
[22:43:18.956][I][remote.pronto:231]: Received Pronto: data=
[22:43:18.956][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 002D 0018 0016 0018 002D 0018 0016 0017 0017 0018 002D 0018 0016 0018 002D 0018 002D 0018 002D 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0181 
[22:43:18.956][I][remote.sony:064]: Received Sony: data=0x000052E9, nbits=15
[22:43:18.977][I][remote.pronto:231]: Received Pronto: data=
[22:43:18.981][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 002D 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0018 0016 0018 002D 0018 002D 0017 002E 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0181 
[22:43:18.985][I][remote.sony:064]: Received Sony: data=0x000052E9, nbits=15
[22:43:19.079][I][remote.pronto:231]: Received Pronto: data=
[22:43:19.085][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 002D 0018 0017 0017 002D 0018 0016 0018 0016 0018 002D 0018 0016 0018 002D 0018 002D 0018 002D 0017 0017 0018 002D 0018 0016 0018 0016 0018 002D 0181 
[22:43:19.085][I][remote.sony:064]: Received Sony: data=0x000052E9, nbits=15

green button:

[22:44:37.968][I][remote.pronto:231]: Received Pronto: data=
[22:44:37.969][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 0016 0018 002D 0018 002D 0018 0016 0018 0016 0018 002D 0018 0016 0017 002E 0018 002D 0018 002D 0018 0016 0018 002D 0018 0016 0017 0017 0018 002D 0181 
[22:44:37.969][I][remote.sony:064]: Received Sony: data=0x000032E9, nbits=15
[22:44:37.991][I][remote.pronto:231]: Received Pronto: data=
[22:44:37.995][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 0016 0018 002D 0018 002D 0018 0016 0018 0016 0018 002D 0018 0016 0018 002D 0018 002D 0018 002D 0018 0016 0017 002E 0018 0016 0018 0016 0018 002D 0181 
[22:44:37.999][I][remote.sony:064]: Received Sony: data=0x000032E9, nbits=15
[22:44:38.086][I][remote.pronto:231]: Received Pronto: data=
[22:44:38.086][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 0016 0017 002E 0018 002D 0017 0017 0018 0016 0017 002E 0018 0016 0018 002D 0018 002D 0018 002D 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0181 
[22:44:38.086][I][remote.sony:064]: Received Sony: data=0x000032E9, nbits=15
[22:44:38.092][I][remote.pronto:231]: Received Pronto: data=
[22:44:38.092][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 0016 0018 002D 0018 002D 0018 0016 0017 0017 0018 002D 0017 0017 0017 002E 0018 002D 0018 002D 0018 0016 0017 002E 0018 0016 0018 0016 0018 002D 0181 
[22:44:38.092][I][remote.sony:064]: Received Sony: data=0x000032E9, nbits=15
[22:44:38.127][I][remote.pronto:231]: Received Pronto: data=
[22:44:38.131][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0017 0017 0017 002E 0018 002D 0018 0016 0017 0017 0017 002E 0017 0017 0017 002E 0017 002E 0017 002E 0017 0017 0017 002E 0017 0017 0018 0016 0017 002E 0181 
[22:44:38.138][I][remote.sony:064]: Received Sony: data=0x000032E9, nbits=15

yellow button

[22:45:18.150][I][remote.pronto:231]: Received Pronto: data=
[22:45:18.150][I][remote.pronto:239]: 0000 006D 0010 0000 005D 0016 002E 0017 002E 0017 002F 0016 0017 0017 0017 0017 002E 0017 0018 0016 002E 0017 002E 0017 002F 0016 0017 0017 002E 0016 0018 0016 0017 0017 002F 0181 
[22:45:18.150][I][remote.sony:064]: Received Sony: data=0x000072E9, nbits=15
[22:45:18.154][I][remote.pronto:231]: Received Pronto: data=
[22:45:18.154][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0017 002F 0016 002E 0016 002F 0016 0018 0016 0017 0017 002E 0017 0018 0016 002E 0017 002F 0016 002F 0016 0018 0016 002E 0017 0018 0016 0017 0017 002F 0181 
[22:45:18.158][I][remote.sony:064]: Received Sony: data=0x000072E9, nbits=15
[22:45:18.201][I][remote.pronto:231]: Received Pronto: data=
[22:45:18.205][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0017 002E 0017 002F 0016 002E 0017 0017 0017 0018 0016 002E 0017 0018 0016 002E 0017 002E 0017 002F 0016 0017 0017 002E 0017 0018 0016 0017 0017 002E 0181 
[22:45:18.261][I][remote.sony:064]: Received Sony: data=0x000072E9, nbits=15
[22:45:18.272][I][remote.pronto:231]: Received Pronto: data=
[22:45:18.273][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0017 002F 0016 002E 0017 002E 0017 0017 0017 0017 0017 002F 0016 0017 0017 002E 0017 002E 0017 002E 0017 0017 0017 002F 0016 0017 0017 0017 0017 002E 0181 
[22:45:18.273][I][remote.sony:064]: Received Sony: data=0x000072E9, nbits=15

blue button

[22:45:49.371][I][remote.pronto:231]: Received Pronto: data=
[22:45:49.376][I][remote.pronto:239]: 0000 006D 0010 0000 005D 0017 0016 0018 0017 0017 002D 0018 0016 0018 0016 0018 002D 0018 0016 0018 002D 0018 002D 0018 002D 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0181 
[22:45:49.380][I][remote.sony:064]: Received Sony: data=0x000012E9, nbits=15
[22:45:49.404][I][remote.pronto:231]: Received Pronto: data=
[22:45:49.409][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 0016 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0018 0016 0018 002D 0018 002D 0018 002D 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0181 
[22:45:49.409][I][remote.sony:064]: Received Sony: data=0x000012E9, nbits=15
[22:45:49.484][I][remote.pronto:231]: Received Pronto: data=
[22:45:49.484][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 0016 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0018 0016 0018 002D 0017 002E 0018 002D 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0181 
[22:45:49.484][I][remote.sony:064]: Received Sony: data=0x000012E9, nbits=15
[22:45:49.500][I][remote.pronto:231]: Received Pronto: data=
[22:45:49.505][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 0016 0018 0016 0018 002E 0017 0016 0018 0016 0017 002E 0018 0016 0018 002E 0017 002D 0018 002D 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0181 
[22:45:49.505][I][remote.sony:064]: Received Sony: data=0x000012E9, nbits=15
[22:45:49.608][I][remote.pronto:231]: Received Pronto: data=
[22:45:49.608][I][remote.pronto:239]: 0000 006D 0010 0000 005C 0018 0016 0018 0016 0018 002D 0018 0016 0018 0016 0018 002D 0018 0016 0018 002D 0018 002D 0018 002D 0017 0017 0018 002D 0018 0016 0018 0016 0017 002E 0181 
[22:45:49.608][I][remote.sony:064]: Received Sony: data=0x000012E9, nbits=15

Those codes you posted are all different though:
R: Received Sony: data=0x000052E9, nbits=15
G: Received Sony: data=0x000032E9, nbits=15
Y: Received Sony: data=0x000072E9, nbits=15
B: Received Sony: data=0x000012E9, nbits=15

The example I posted above are just the Sony ones, since it’s easier to show the difference. However even the Pronto data is unique per button.

Hello
Yes I’m ok with that.
but what I want is start script on key press. So I’m using HAIR and the Sniffer TAB. in this app only pronto codes are aviable.
Do you know how can those sony codes can start my automation ?

This part here should give you a sensor in ESP-Home that is sent to HA.
When sensor is on you pressed a button, trigger your automation on this sensor.

I think you’re missing my point. The Pronto codes you posted are also different depending on which button you pressed.

If HAIR is recognising them as the same button, that’s a HAIR issue, probably same as this one.

HAIR dev here. @ShadowFist has it right on both counts: the four buttons are sending genuinely different codes, and the collapse is a HAIR issue, the same one tracked in GitHub issue #43. Thanks for the logs @loic.gouraud, they made this diagnosable, and no need to open a separate issue – this thread is linked from the tracking.

What’s happening, short version: HAIR identifies a signal by classifying each IR pulse as short or long. Sony remotes encode their bits in pulse widths that both land below HAIR’s short/long cutoff, so every button on a Sony remote tends to read as the same coarse pattern. HAIR keeps a finer byte-level identity underneath (which is why the Sniffer can still show separate rows), but triggers currently match on the coarse pattern only. So to answer your question directly: triggers are exactly the HAIR feature meant to start your scripts on key press (each trigger becomes an event entity your automations listen to), and they’re precisely what this bug breaks for Sony remotes. A trigger made for the red button today would fire for all four.

The fix is scoped and has been through review: triggers and the matcher learn to use the finer identity. It’s targeted for the next release, and I’ll post back here when it’s out. Longer term, Sony decoding goes into the shared infrared-protocols library HA bundles, which gives Sony remotes the same first-class treatment NEC remotes have today. Your logs are good test data for both, thank you.

Until then, two practical notes. I’d hold off assigning any of the four signals to a HAIR device command (assigning one currently makes the other three match it). And @Hellis81’s suggestion is a solid interim: an ESPHome binary_sensor with on_sony per code (0x52E9 / 0x32E9 / 0x72E9 / 0x12E9) gives you four sensors to trigger on today, and nothing about the HAIR fix will conflict with it later. Also, to reassure on one point: the Test button just transmits the code back out of your Athom, so with a broken TV there’s nothing to verify against, and for your use case you don’t need transmit at all.

~ DAB

Following up: this is fixed in HAIR v0.5.8, released today.

Your four colored buttons each drive their own trigger now. Two things needed fixing, and your hardware found both. The first was the one I described above. Triggers only looked at the coarse short/long pattern, which all the buttons on your remote share, so one trigger fired for every button. Triggers now match on the byte-level identity underneath, which the Sniffer was already using to keep your buttons apart.

The second surfaced on my own bench while validating the first. Sony’s long pulse sits right at the short/long cutoff, so the same button can read as a different coarse pattern from one capture to the next. With only the first fix in place, some of your buttons would have triggered reliably and others would not. Every identity check in HAIR now falls back through decoded protocol, then byte-level identity, then the coarse pattern, and the byte-level layer is stable across that wobble.

Also, the captures you posted from your ESPHome logs are now test fixtures in HAIR’s suite, so this area stays covered going forward. Thank you for those.

The proper cure is a Sony SIRC decoder upstream in infrared-protocols, which would also improve transmit fidelity. That is still on my list, and HAIR will pick it up automatically when it lands.

~ DAB

Hello
thanks for the update.

unfortunatly now, each time I press RED I’ve got a diffrent code :

here I’ve pressed RED 12 times.

Hello
I’ve tested your advice, but it doesn’t works for me.

Here is my esphome YAML:

substitutions:
  name: athom-rf-ir-remote-3504d8
  friendly_name: Athom RF IR Remote 3504d8
packages:
  China Athom Technology.Athom RF IR Remote: github://athom-tech/esp32-configs/athom-rf-ir-remote.yaml
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  encryption:
    key: wMz4xgk7lNbmyCqsfsqdfsqdfsqdfqsfTDVnRLBKoug=


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

binary_sensor:
  - platform: remote_receiver
    receiver_id: ir_receiver
    name: Télécommande Sony Btn ROUGE
    id: binary_sensor_remote_receiver_1
    sony:
      data: 0x52e9
      nbits: "15"
  - platform: remote_receiver
    receiver_id: ir_receiver
    name: Télécommande Sony Btn VERT
    id: binary_sensor_remote_receiver_2
    sony:
      data: 0x32E9
      nbits: "15"
  - platform: remote_receiver
    receiver_id: ir_receiver
    name: Télécommande Sony Btn JAUNE
    id: binary_sensor_remote_receiver_3
    sony:
      data: 0x72E9
      nbits: "15"
  - platform: remote_receiver
    receiver_id: ir_receiver
    name: Télécommande Sony Btn BLEU
    id: binary_sensor_remote_receiver_4
    sony:
      data: 0x12E9
      nbits: "15"

You can see 4 sensors.
the entities are shown correclty:

the logs of esphome shows that on key press :

but it seems that my sensors doesn’t update


so automation doesn’t start.

can you explain me where I’m wrong ?

Try adding a delayed off filter.

Edit it seems your logs is saying turned off.
Perhaps it’s inverted.
Not sure if that means you need to invert the IR receiver or if you can just invert the binary sensor.

Did you read the NOTE section on the Remote Receiver - Binary Sensor page Hellis81 linked to?

Sorry I’ve read but not understood, so forgot.

I’ve added batch_delay: 0ms in api section. and now the IR triggers the binairy sensor.

thank you so much.

v0.6.0 is out and it is built around what you found.

HAIR now decodes Sony remotes properly instead of comparing waveform shapes, so a short tap, a held press, and a jittery capture of the same button all resolve to one signal row. Your twelve rows case is the exact test we built against, and your captures from this thread are permanent test fixtures in HAIR now, so this cannot quietly regress without failing the build.

After you update through HACS and restart, your existing catalog should clean itself up: the split rows merge into one row per button at startup, keeping nicknames and hit counts. From there the four colored buttons should each hold a stable identity you can hang triggers on, which was your original goal, and the ESPHome sensor workaround stops being necessary.

A note on the philosophy, since it changed with this release: the plan was always to rely on Home Assistant’s shared protocol library, but the library decodes very few protocols today and that gap was hurting people. So the decoders now live in HAIR, written in the library’s style, and each is headed upstream as a pull request. When a Home Assistant release ships a library that can decode Sony itself, HAIR steps aside for it automatically.

Please let me know how the update lands on your setup.

Thank you for the fast, precise report. :clinking_beer_mugs::barber_pole:

~ DAB