Sending IR codes on OpenBeken

I had flashed a genereic IR blaster with a BK7231N chip. Receiving IR codes was easy. Just go to webapp and the log tab, press button on the IR remote and a code like "IR_NEC2 0x6DD2 0x2 1 " would appear. This was easy to use in Mqtt automations.
It was mujch more difficult to find out how to send IR codes. I had to convert the code.

From the logs command line you could convert the received code from;
IR_NEC2 0x6DD2 0x2 1 to NEC2 6DD2-2-1

You could then send that code form the command line of the device in the webapp.

To send from http “http://192.168.0.111/cm?cmnd=IRSend NEC2 6DD2-2-1”

To use it in an automation with mqtt;

  - action: mqtt.publish
    metadata: {}
    data:
      qos: 0
      retain: false
      topic: cmnd/obk1irBlaster/IRSend
      payload: NEC 6DD2-2-1

Great info, you can also format the messages like so (remove the IR_ prefix):

IR_NEC 0x40FC3 0x12 0 = NEC 0x40FC3 0x12 0

button:
  - unique_id: toshiba_tv_power_toggle
    name: "Toshiba - Power"
    command_topic: "cmnd/BK7231N_IR_Blaster/IRSEND"
    availability:
      - topic: "BK7231N_IR_Blaster/connected"
    qos: 1
    payload_press: "NEC 0x40FC3 0x12 0"
    retain: false
1 Like

Good to know. I’ll give that a try.