IR receiver code for binary sensor

Hello community,

In Home Assistant I’d like to react on IR remote by pressing on a button. As receiver I am using a Wemos D1 Mini combined with IR receiver (KY-022).

The logs show me the following:

[00:14:07][D][remote.raw:041]: Received Raw: 950, -829, 1837, -1714, 1838, -828, 947, -828, 948, -829, 947, -829, 946, -831, 948, -1714, 947, -832, 1839, -827, 948
[00:14:09][D][remote.raw:041]: Received Raw: 948, -831, 947, -831, 947, -832, 1810, -857, 944, -830, 946, -830, 946, -831, 945, -834, 943, -1716, 922, -857, 1811, -855, 945
[00:14:09][D][remote.raw:041]: Received Raw: 947, -833, 945, -833, 946, -832, 1810, -855, 945, -832, 943, -834, 923, -857, 940, -833, 944, -1718, 946, -833, 1810, -856, 921

In order to define a sensor in Home Assistant, I am using the following in Esphome:

- platform: remote_receiver
    name: "Remote Button On/Off"
    raw:
      code: [XXXXX]
    filters:
      - delayed_off: 1000ms

Which values do I need to use instead of XXXXX that the sensor reacts on my signal?

Many thanks in advance! Cheers, red

From the docs:

  • raw: Trigger on a raw remote code with the given code.

And

remote_transmitter.transmit_raw Action

This action sends a raw code to a remote transmitter.

on_…: - remote_transmitter.transmit_raw: code: [4088, -1542, 1019, -510, 513, -1019, 510, -509, 511, -510, 1020, -1020, 1022, -1019, 510, -509, 511, -510, 511, -509, 511, -510, 1020, -1019, 510, -511, 1020, -510, 512, -508, 510, -1020, 1022, -1021, 1019, -1019, 511, -510, 510, -510, 1022, -1020, 1019, -1020, 511, -511, 1018, -1022, 1020, -1019, 1021, -1019, 1020, -511, 510, -1019, 1023, -1019, 1019, -510, 512, -508, 510, -511, 512, -1019, 510, -509]

Hi @nickrout, many thanks for your quick response! Ok I understood.
But, what I did not yet understand: I have three rows in my log output…
How can I combine them to add them as code to my remote_receiver sensor?