Faking an IR remote control using ESPHome

Thanks, this is how I added to my yaml

#astro button presses 
binary_sensor:
  - platform: remote_receiver
    name: "astro numpad 1"
    rc6:
      address: 0x00
      command: 0x01
    on_state:
      - remote_transmitter.transmit_pronto:
          data: "0000 006D 001E 0000 0067 0022 0011 0012 0011 0012 0012 0022 0012 0022 0034 0022 0012 0012 0011 0011 0012 0012 0010 0012 0012 0011 0012 0012 0011 0011 0023 0023 0024 0023 0022 0012 0011 0023 0024 0022 0023 0023 0011 0013 0023 0011 0011 0012 0011 0023 0012 0012 0010 0012 0012 0012 0010 0013 0011 0011 0012 0011 0024 06C3 0000 006D 001E 0000 0068 0021 0011 0012 0011 0011 0010 0023 0011 0023 0034 0022 0011 0012 0012 0012 0011 0011 0011 0012 0012 0011 0012 0011 0012 0011 0023 0024 0023 0023 0022 0012 0012 0022 0024 0023 0022 0024 0010 0013 0023 0012 0011 0011 0011 0024 0011 0012 0011 0012 0010 0013 0011 0011 0011 0012 0012 0012 0022 06C3"

Didnā€™t get it working at first because I didnā€™t copy all the pronto codes

2 Likes

Iā€™m dealing with the same ā€œissueā€.

I want to switch from Pilight to ESPHome.
With Pilight, my plugs work via MQTT with:

command_topic: "rf434/send/arctech_switch"    
  payload_on: '{"id":51819502,"unit":14,"on":1}'                       
  payload_off: '{"id":51819502,"unit":14,"off":1}' 

But with ESPHome Iā€™m getting this:

[20:18:34][D][remote.pronto:238]: data=0000 006D 0054 0000 003D 0031 003D 001D 000D 002A 0022 0012 000E 0013 000C 0011 0011 0013 001A 000F 0010 0019 001B 0017 000B 0032 002C 000F 005E 002F 0011 000D 0012 000B 000B 000D 0013 002A 004E 0057 006B 000E 000A 000E 0030 000D
[20:18:34][D][remote.pronto:240]: 000C 000E 002F 000E 002F 000D 000B 000D 0030 000C 000C 000D 000C 000C 0030 000C 000C 000C 0031 000D 0030 000C 000C 000C 000C 000C 0031 000C 000C 000C 0031 000C 0031 000C 000C 000C 000C 000C 0030 000C 000C 000C 0030 000D 0030 000D 000C 000D 0030 000D 000C 000D 000C 000D 0030 000D 0030 000D 000B 000D 0030 000D 000B 000D 002F 000D 000B 000D 000B 000D 002F 000D 002F 000E 000B 000D 000B 000E 002F 000E 000B 000D 002F 000D 002F 000D 000B 000E 002F 000E 000B 000E 002F 000E 000B 00
[20:18:34][D][remote.pronto:238]: Received Pronto: data=0000 006D 0040 0000 007F 006B 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 0010 0021 000F 0021 001C 0046 000F 002E 000E 000A 000E 000B 000E 002F 000E 000A 000E 002F 000E 002F 000E 000A 000E 000A 000E 002F
[20:18:34][D][remote.pronto:240]: 000F 0009 000E 002F 000E 002F 000E 000B 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000B 000E 002F 000E 000A 000E 000B 000E 002F 000E 002F 000E 000A 000E 000B 000E 002F 000E 000B 000E 002F 000E 002F 000E 000A 000E 002F 000F 000A 000E 002F 000E 000B 000E 000A 000F 002E 000F 000A 000E 002F 000F 000A 000E 002E 000F 002E 000E 000B 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 06C3
[20:18:34][D][remote.pronto:238]: Received Pronto: data=0000 006D 0041 0000 000E 006B 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 000E 000A 000E 001C 0011 001A 000E 000A 000F 000B 000B 0018 0010 0045 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 0010 0020
[20:18:34][D][remote.pronto:240]: 000F 002E 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 000B 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 002E 000E 000A 000F 002E 000F 0009 000E 002F 000F 0009 000F 000A 000E 002E 000E 000A 000F 002E 000E 000A 000E 002F 000E 002F 000E 000B 000E 002E 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 06C3
[20:18:34][D][remote.pronto:238]: Received Pronto: data=0000 006D 0040 0000 000E 006B 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 0010 0021 000F 000F 0013 000C 0010 0046 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 000F 0009 0010 0046
[20:18:35][D][remote.pronto:240]: 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 0010 0009 000E 000A 000E 002F 000E 000A 000E 002F 000F 002D 000F 000A 000E 002F 000F 000A 000E 002E 000F 000A 000E 000A 000E 002F 000E 000B 000E 002F 000F 000A 000E 002E 000F 002E 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 06C3
[20:18:35][D][remote.pronto:238]: Received Pronto: data=0000 006D 0040 0000 000E 006B 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 000E 000A 000E 0018 0011 001E 000E 000A 000F 000A 000E 000A 001D 0043 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 0011 001F
[20:18:35][D][remote.pronto:240]: 000F 002F 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 0010 0045 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000F 002E 000E 000A 000E 002F 000E 002E 000F 000A 000E 002E 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 06C3
[20:18:35][D][remote.pronto:238]: Received Pronto: data=0000 006D 0041 0000 000E 006B 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 000E 000A 000E 0015 0012 001F 000F 000A 0010 000D 000D 0013 000E 000A 000E 002F 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F
[20:18:35][D][remote.pronto:240]: 0015 001C 000F 002E 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 002E 0011 0044 000F 0009 000E 002F 000E 000A 000E 000A 000E 002F 000F 000A 000F 002D 000E 000A 000E 002E 000E 002E 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 06C3
[20:18:35][D][remote.pronto:238]: Received Pronto: data=0000 006D 0041 0000 0069 006B 000E 000A 000E 0016 0027 000A 000E 002F 000E 002E 000E 000A 000E 002F 000E 000A 000F 0046 0017 0018 001C 000B 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 000E 000A 000E 000A
[20:18:35][D][remote.pronto:240]: 000E 0019 0014 001A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 000E 000A 0010 002D 000F 000A 000F 002E 000F 000A 000E 000B 000E 002E 000F 000A 000F 002E 000E 000A 000E 002F 000E 002F 000E 000A 000E 002E 000E 000A 000E 000A 000E 002F 000E 002E 000E 000A 000E 06C3
[20:18:35][D][remote.pronto:238]: Received Pronto: data=0000 006D 0001 0000 06C3
[20:18:35][D][remote.pronto:238]: Received Pronto: data=0000 006D 0041 0000 006B 0015 0040 000E 000A 000E 002F 000E 002E 000E 000A 000E 0018 0012 001C 000E 000A 001C 0020 0032 0023 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 000E 000A 000E 000A 0010 0011 000D
[20:18:35][D][remote.pronto:240]: 0010 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000F 002E 000E 000A 000E 0026 0018 000A 000F 002E 000E 000A 000E 000A 000E 002E 000E 000A 000F 002E 000E 000A 000E 002F 000F 002E 000E 000A 000E 002F 000E 000A 000E 000A 000E 002E 000E 002E 000E 000A 000E 06C3
[20:18:35][D][remote.pronto:238]: Received Pronto: data=0000 006D 0044 0000 0026 000D 000D 001B 000F 000E 0046 0056 0011 001C 0018 0025 000E 000A 000F 002E 000F 002E 000F 000A 000E 002E 000E 000A 000E 000A 000E 002F 000E 000A 000E 002E 000F 002E 000E 000A 0014 0041 000E 000A 000E 002F
[20:18:35][D][remote.pronto:240]: 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 0010 002D 000E 002E 000E 000A 000E 002E 000E 000A 000E 000A 000E 002F 000E 002E 000E 000A 000E 002F 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002E 000E 002F 000E 000A 000E 002E 000E 000A 000E 002F 000E 000A 000E 000A 000E 002F 000E 000A 000E 002F 000E 000A 000E 002F 000E 002F 000E 000A 000E 002E 000E 000A 000E 000A 000E 002E 000E 002F 000E 000A 000E 06C3
[20:18:35][D][remote.pronto:238]: Received Pronto: data=0000 006D 0003 0000 0015 001C 001F 0038 0015 06C3
[20:18:35][D][remote.pronto:238]: Received Pronto: data=0000 006D 0002 0000 0038 001A 0016 06C3

I tried to sort it out but with no luck.
Sadly there is no implementation for the ā€œArctechā€ protocol so I would be very thankful if someone could help me understand what to do.

I donā€™t understand your question. Pilight is based on RF in the 433MHz band. You cannot control it with infrared.

Of cause Iā€™m using RF Hardware but both (RF and IR) uses the category ā€œRemote-Receiverā€ in ESP Home.

The problem is that I donā€™t know how to use the data Iā€™m receiving to transmitā€¦

I recently decoded/emulated an IR remote for a room heater. The ESP remote receiver interpreted the commands as protocol 4 and something binary for each button, like ā€˜11000101010ā€™. When I used these as an rc_switch transmission I had no success. So I used the raw values and now my transmitter works.

Iā€™d prefer to use the protocol 4 values though. Any idea why I wouldnā€™t have had success in my attempts?

Hi, I have a device (HDMI Switch) that uses an IR receiver like this picture


I just connected the pinout to an esp8266 and can read the inputs just like your tutorial (great btw). My data is identical (JVC, LG, NEC, Pioneer), and if I connect (i donā€™t have one) a transmitter I am pretty sure it will work but, I want to make a 3.5 jack cable that connects GND and IR in between the HDMI sw and the ESP but I am not pretty sure how to send the same messages through that line, do you think your tutorial code directly pasted will work? Thanks.

Please donā€™t try that direct connection without any further analysis and measuring. Reasons are:

  • You donā€™t know about the voltage levels used on the other side. If they are not 3.3 Volt you will damage your ESP and maybe the other side too.

  • There may also be a general DC voltage offset between both sides that may damage your components if connected directly.

To separate the sides electrically you could use an opto coupler which is basically an IR transmitter and receiver in one electronic component. But it needs additional circuitry to work correctly.

TL;DR: If you are not equipped to do further analysis with a voltmeter and oscilloscope you should buy an IR transmitter and be happy.

I only can assure the voltage is the same, 3.3 V and thought it could work, I just trying to figure out a smaller ESP box with all the components. Given I donā€™t have an oscilloscope (and donā€™t know what/how to measure) Iā€™ll buy the transmitter and cutoff the receiver cable to the right length and put it in front of the receiver, a bulky diy octo lol. Thanks for you help.

1 Like

Anyone had any luck with Daikin AC units? Following the guide in this thread I get either Aeha or Panasonic protocols from the AC remote, but it always sends 3 signals for each button. This is my dump of on/off

# on
[22:04:47][D][remote.panasonic:070]: Received Panasonic: address=0x885B, command=0xE400A308
[22:04:47][D][remote.panasonic:070]: Received Panasonic: address=0x885B, command=0xE40042B4
[22:04:47][D][remote.panasonic:070]: Received Panasonic: address=0x885B, command=0xE4000096

# off
[22:04:53][D][remote.panasonic:070]: Received Panasonic: address=0x885B, command=0xE400A308
[22:04:53][D][remote.panasonic:070]: Received Panasonic: address=0x885B, command=0xE40042B4
[22:04:53][D][remote.panasonic:070]: Received Panasonic: address=0x885B, command=0xE4000016

My resulting yaml is

remote_transmitter:
  pin: D2
  carrier_duty_percent: 50%

button:
- platform: template
  name: "${device_name}-daikin-on"
  on_press:
    - remote_transmitter.transmit_panasonic:
        address: 0x885B
        command: 0xE400A308
    - remote_transmitter.transmit_panasonic:
        address: 0x885B
        command: 0xE40042B4
    - remote_transmitter.transmit_panasonic:
        address: 0x885B
        command: 0xE4000096
- platform: template
  name: "${device_name}-daikin-off"
  on_press:
    - remote_transmitter.transmit_panasonic:
        address: 0x885B
        command: 0xE400A308
    - remote_transmitter.transmit_panasonic:
        address: 0x885B
        command: 0xE40042B4
    - remote_transmitter.transmit_panasonic:
        address: 0x885B
        command: 0xE4000016

But to no avail. Any ideas?

Your YAML looks good to me.
Some thoughts for your next steps:

Is your control LED blinking when you send? If no such LED you might check for a faint glow from the IR LED(s) in total dark.

Did you try the AEHA protocol instead?

Try short delays (10 to some 100 milliseconds) between the three commands.

If nothing else works, try to use raw transmission mode.

Hi! What pins did you use for this? I tried with one pin to ground and one to the signal pin (I chose 23 on my ESP32 devkit V1) on a similar emitter, and i mostly got this:

10:08:59	[D]	[remote.pronto:238]	
Received Pronto: data=0000 006D 0006 0000 0001 0000 0001 0000 0001 0000 0001 0000 0002 0000 0167 06C3
10:08:59	[D]	[remote.pronto:238]	
Received Pronto: data=0000 006D 000A 0000 0001 9D89 0001 0000 0001 0000 0002 0000 0001 0000 0001 0000 0001 9D89 0001 9D89 0161 9D89 0001 06C3
10:08:59	[D]	[remote.pronto:238]	
Received Pronto: data=0000 006D 0009 0000 0001 0000 0001 0000 0001 0000 0001 0000 0001 0000 0001 0000 0001 9D89 015D 0000 0001 06C3
10:08:59	[D]	[remote.pronto:238]	
Received Pronto: data=0000 006D 0015 0000 0001 0001 0001 9D89 0001 0000 0001 0000 0001 0000 0001 0000 0001 0000 0001 0001 0001 0000 0001 0000 0001 0000 0002 9D89 0001 9D89 0001 9D89 0116 9D89 0001 9D89 0001 9D89 0001 9D89 0001 9D89 0001 9D89 0001 06C3
10:08:59	[D]	[remote.pronto:238]	
Received Pronto: data=0000 006D 0008 0000 0001 0001 0001 0000 0001 0000 00A0 9D89 0001 9D89 0001 9D89 0001 9D89 0001 06C3
10:08:59	[D]	[remote.pronto:238]	
Received Pronto: data=0000 006D 0021 0000 0001 0000 0001 0001 0064 9D89 0001 0000 0001 0000 0001 9D89 0001 0000 0025 9D89 0002 0000 0001 9D89 0001 9D89 0001 9D89 0001 9D89 0001 9D89 0001 9D89 0001 9D89 0001 9D89 0001 0000 0001 9D89 0001 9D89 0001 9D89
10:08:59	[D]	[remote.pronto:240]	
0001 9D89 0002 9D89 0001 9D89 0001 9D89 0001 9D89 0001 9D89 0001 0000 0001 0001 0001 0001 0001 9D89 0001 0001 0001 06C3

I tried to reverse the ground and signal leads, but that didnā€™t change anything. I am reluctant to connect it to 5V power in case that will burn up anything, at least until I know thatā€™s the way to do it.

More details needed to help you. You talk about emitter but I guess you mean transceiver. What transceiver model are you using? Pins for D1 Mini (ESP8266) are given in the guide.

I didnā€™t ask you. :rofl: If you look at the upper right corner of the post you will see that Iā€™m asking Pidiot what pins he used. And no, I donā€™t mean emitter. I have been working with IR for 20 years, so I do know the difference. Pidiot is using a cheap IR emitter instead of the one youā€™re talking about. I have around 20 of those laying around.

Oh sorry, got that wrong.
But then again: How do you receive (as in you log dump) with an emitter?

No problem, itā€™s easy to overlook. And actually many of the so called emitters are dual purpose, at least the ones have from when I worked with them. They can be used both ways, they have four leads in, with common ground. It depends on what part of the block I connect them to. They need 5V or 12V in to receive, but emitting will work without that extra power. If Iā€™m not mistaken (I have not opened them) they have two IR diodes in there. Hereā€™s a somewhat similar model, newer than those I have, with USB power supply:

Edit: Come to think of it, maybe it wonā€™t work that way with an ESP at all, and what I thought was as signal was just noiseā€¦ Maybe I should try to get one of the receivers you have up at the top.

Turns out I have one, a VS1838B based device, Iā€™ll try that tomorrow and see what happens. :smiley:

1 Like

Of course I couldnā€™t wait! :wink: Not really a problem at all, this. I have a Pioneer car audio player in a marine box in my boat, the Mad Max, and I want to be able to control power and volume from Hass. Turns out that setting the dump to Pioneer worked perfectly, since itā€™s a Pioneer device that shouldnā€™t suprised me. This is volume up, volume down and source/power. A bit annoying that the thing doesnā€™t have discreet power codes.

21:28:01][D][remote.pioneer:149]: Received Pioneer: rc_code_X=0xB50A
[21:28:03][D][remote.pioneer:149]: Received Pioneer: rc_code_X=0xB50B
[21:28:09][D][remote.pioneer:149]: Received Pioneer: rc_code_X=0xB51A

Totally consistent, same code every time. So next step will be to try the emitting part. Iā€™ll probably program another ESP for that to have in the boat, so I can use this one in the house in case I need to put in more buttons. Thanks for the guide, and flag me a happy camper! :grin:

@pidiot I would still like to know what pins you use for that emitter of yours, I found some two wire emitters here too, so I can probably use the same! Taking a chance on GPIO22 and ground first, weā€™ll see if anything friesā€¦

Edit: Nothing fried, it didnā€™t even smell funny. Almost boring how little drama there was on this! :rofl: :joy: So GPIO22 and ground for plus and ground on the emitter, and I was able to send a code that the IR receiver interpreted as the Pioneer code I was trying to send. I have to go down to my boat tomorrow and check it out, but Iā€™m pretty sure this is working!

1 Like

So, I am trying to do this, but I am using the 1/8" IRs from most home automation systems. However, when trying to connect to 3.3 and pin D4 on a ESP8266 it just lights solid red?

I canā€™t seem to find any articles on using a two wire but tons on a 3 wire? Any have videos or guide on using a two wire and what I am missing?

I am getting this log for ā€œoffā€
[16:48:40][D][remote.pronto:238]: Received Pronto: data=0000 006D 0022 0000 015C 00AC 0018 0015 0016 0015 0016 0015 0016 0040 0017 0014 0017 0015 0016 0015 0016 0015 0017 0040 0017 0040 0018 003F 0018 0014 0017 0040 0017 0040 0017 0040 0018 003F 0018 003F 0017 0015 0017 003F 0017 0015
[16:48:40][D][remote.pronto:240]: 0017 0014 0017 0015 0017 0014 0018 0014 0017 0014 0017 0040 0018 0014 0018 003F 0018 003F 0018 003F 0018 003F 0018 003F 0018 06C3
[16:48:40][V][remote.drayton:172]: Decode Drayton: Fail 1, - 1
[16:48:40][D][remote.pronto:238]: Received Pronto: data=0000 006D 0002 0000 015D 0054 0017 06C3
[16:48:40][D][remote.pronto:238]: Received Pronto: data=0000 006D 0002 0000 015D 0054 0018 06C3

Its work:

switch:

  • platform: template

    name: ā€œPower ONā€

    turn_on_action:

    • logger.log: ā€œSleep Off!ā€

    • remote_transmitter.transmit_pronto:

      data: ā€œ0000 006D 0022 0000 015C 00AC 0018 0015 0016 0015 0016 0015 0016 0040 0017 0014 0017 0015 0016 0015 0016 0015 0017 0040 0017 0040 0018 003F 0018 0014 0017 0040 0017 0040 0017 0040 0018 003F 0018 003F 0017 0015 0017 003F 0017 0015 0017 0014 0017 0015 0017 0014 0018 0014 0017 0014 0017 0040 0018 0014 0018 003F 0018 003F 0018 003F 0018 003F 0018 003F 0018 06C3 0000 006D 0002 0000 015D 0054 0017 06C3 0000 006D 0002 0000 015D 0054 0018 06C3ā€

    turn_off_action:

    • logger.log: ā€œSleep On!ā€

Hi, Iā€™m trying to get this working but looks like my transmitter does not work. Should you receive anything in the log file other than button pressed? This is the only thing I see in the logs of my esp device, was expecting the IR transmitter also to have a log line.

|13:21:49|[D]|[button:010]|ā€˜On/Off JVCā€™ Pressed.|
|13:21:50|[D]|[button:010]|ā€˜On/Off JVCā€™ Pressed.|
|13:21:57|[D]|[button:010]|ā€˜On/Off JVCā€™ Pressed.|
|13:21:59|[D]|[button:010]|ā€˜On/Off JVCā€™ Pressed.|
|13:21:59|[D]|[button:010]|ā€˜On/Off JVCā€™ Pressed.|
|13:22:01|[D]|[button:010]|ā€˜On/Off JVCā€™ Pressed.|
|13:22:01|[D]|[button:010]|ā€˜On/Off JVCā€™ Pressed.|

Yes, there is missing something.
A normal log entry of a button press and a subsequent transmission should look something like this:

[04:10:38][D][button:010]: 'Kind Bett LED, an/aus' Pressed.
[04:10:38][D][remote_transmitter:075]: Sending remote code...

Have you checked the initial part of your log (violet text) for any errors during the initialization phase of your transmitter? Show use the relevant YAML config for your button and your transmitter config.