ESP Home IR transmitter sending Onkyo format instead of NEC

Hey, I am trying to setup an IR remote using ESP home.

I am trying to send an NEC command. However, when I use the IRemote library for arduino to check the command, it says that I am sending it in Onkyo protocol instead of NEC.

Does anyone know how to fix this?
I have attached my code below.
Thank you!

esphome:
  name: "ir-controller"

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:


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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-0Ee874"
    password: "WmJlnxvvWmmC"

captive_portal:
  
remote_transmitter:
  pin: GPIO32
  carrier_duty_percent: 50%

switch:
  - platform: template
    name: "Porjector On"

    turn_on_action:
      remote_transmitter.transmit_nec:
        address: 0x5583
        command: 0x90

#button:
#  - platform: template
#    name: "Projector Off"
#    id: projector_off
#
#    on_press:
#      remote_transmitter.transmit_nec:
#        address: 0x60D5
#        command: 0x9

#        repeat:
#          times: 1
#          wait_time: 0.5s

Hi,

I had the same issue and I was able to solve it.

The Onkyo protocol is NEC with 16 bit instead of 8 bit command and it seems like that the remote_transmitter component won’t format 8 bit commands (and addresses) in the required format for NEC (i.e. 8 bit command and 8 bit of inverse of the command) but sends it as is.

So you need to append the inverted values of the command to the command as well.
For me this was the original address and command:

address: 0x0
command: 0x45

So the full address and command in the end had to be:

address: 0xFF00
command: 0xBA45

(Note: 0x00 inverted is 0xFF, and 0x45 inverted is 0xBA)

So in your case I think you need to use:

address: 0x5583
command: 0x6F90

(Note: your address is 16 bit already so I think you need to use that as is)

But if you already have the arduino and IRemote set up, then it’s easiest to get the raw-data from there when you decode the signals from the original remote (In the raw-data the first 16 bit is the command and second 16bit is the address).
image

2 Likes

Thank you.

I ended up using the raw data recorded from IR remote on the Arduino to send the data. I will certainly give your solution a test. It would be much easier than having to setup the raw data.

I got it working!

The IRremote transmitter code gave me the following:
Protocol=NEC Address=0x7A Command=0x1F Raw-Data=0xE01F857A 32 bits LSB first

Using the first 4 characters (E01F) as the command and the last 4 characters (857A) as the address.

ESPHome code:

remote_transmitter:
  pin: 4
  carrier_duty_percent: 50%

  - platform: template
    name: "Yamaha POWER"
    turn_on_action:
      remote_transmitter.transmit_nec:
        address: 0x857A
        command: 0xE01F