ESPhome problem with Ir_Remote and LG TV

Hello,
i have been trying to turn my LG TV 42LA6208 on and off with esphome for days now. I use a NodeMcu, IR receiver and IR transmitter. The readout works well:

[19:47:32][D][remote.jvc:048]: Received JVC: data=0x20DF
19:47:32][D][remote.lg:053]: Received LG: data=0x20DF10EF, nbits=32
[19:47:32][D][remote.nec:068]: Received NEC: address=0x20DF, command=0x10EF

But if I send the code to the TV, nothing happens. Here’s my config:

remote_receiver:

  • pin:
    number: 14
    mode: INPUT
    inverted: true
    dump: all

remote_transmitter:
pin: 4
carrier_duty_percent: 50%

switch:

  • platform: template
    name: “LG TV Power”
    turn_on_action:
    remote_transmitter.transmit_nec:
    address: 0x20DF
    command: 0x10EF

or:

 remote_transmitter.transmit_lg:
  data: 0x20DF10EF
  nbits: 32

Can anyone help me with this?

Hi,

My first suggestion would be to use receiver to capture “raw” messages, eg. like:

remote_receiver:
  pin: 
    number: GPIO2
###### Maybe use also: ##    inverted: True
    mode: INPUT_PULLUP
  dump: raw

Make sure you take all values returned by remote in “raw” format in console (all lines) for a button press.

Second, use transmitter eg. like:


remote_transmitter:
  pin: GPIO2
  # Infrared remotes use a 50% carrier signal
  carrier_duty_percent: 50%
  
switch:
  - platform: template
    name: "Power"
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [ 9839, -4372, 752, -423, 752, -423, 752, -423, 752, -422, 752, -423, 752, -423, 752, -423, 752, -423, 752, 
-1529, 751, -1529, 752, -1528, 751, -1529, 751, -1529, 751, -1529, 751, -1529, 751, -1528, 752, -422, 751, 
-423, 751, -422, 752, -422, 751, -423, 751, -423, 751, -422, 752, -422, 752, -1529, 751, -1528, 752, -1528, 
751, -1528, 752, -1528, 753, -1526, 752, -1528, 752, -1527, 9837, -2107, 9822, -2121 ]
          carrier_frequency: 38kHz

Hint, when you’re capturing codes, stay with remote close to receiver.

Good luck.

Have your found a solution. I do have the same problem.

Best

Maybe to try sending RAW messages to TV…

I have the same Problem with a fan

[19:34:31][D][remote.jvc:048]: Received JVC: data=0x807F
[19:34:31][D][remote.lg:053]: Received LG: data=0x807FC03F, nbits=32
[19:34:31][D][remote.nec:068]: Received NEC: address=0xFE01, command=0xFC03
[19:34:31][D][remote.pioneer:144]: Received Pioneer: rc_code_X=0x8003

and a Sony DVD Player

[20:12:41][D][remote.sony:064]: Received Sony: data=0x000A8B47, nbits=20

All the other devices are reacting properly

Raw code is also not working.
Any other suggestions?

Hi everyone. Did you have success getting this to work?
This does work re-creating codes from an LG AKB72914048 remote control
image here
This does work either in raw mode or using the LG codes.

remote_transmitter:
  pin: 
    number: D8
  carrier_duty_percent: 50%

  - platform: template
    name: 'LG Vol+'
    id: lg_vol_up
    on_press:
     - remote_transmitter.transmit_raw:
         code: [9000, -4580, 563, -563, 537, -589, 539, -1716, 540, -586, 540, -588, 512, -616, 536, -591, 537, -589, 538, -1716, 565, -1690, 536, -591, 511, -1744, 512, -1742, 537, -1716, 516, -1739, 563, -1692, 510, -615, 539, -1716, 515, -616, 507, -616, 563, -564, 536, -590, 538, -589, 538, -590, 538, -1716, 536, -590, 511, -1745, 535, -1717, 537, -1717, 510, -1743, 512, -1742, 536, -1718, 510]        
         carrier_frequency: 38kHz 

  - platform: template
    name: "LG home button"
    on_press:
    - remote_transmitter.transmit_lg:
         data: 0x20DFC23D
         nbits: 32

BTW, I’m using an ESP8266MOD device, but I would expect most ESP devices to work
I found the easiest way to make sure something is coming out of the IR-LED is by watching it with your mobile phone camera. The code should be a brief flash.

With the IR-LED connected straight to your GPIO pin and ground, a 5mm IR-LED has a range of around 1 meter.
Its not best practice to directly connect, but I’ve not managed to damage any ESP chips by doing this (yet!).
I might log all the codes out of this remote. Does anyone know if there is a dedicated area on the site for this?

Good Luck,
Ian.