Help with first MQTT IR remote control

I have an IR Blaster similar to NEO Coolman (https://templates.blakadder.com/neo_coolcam_NAS-IR03W.html) I have flashed Tasmota and am able to read the IR commands it receives in console.

This is power ON/OFF for the TV
22:15:51 MQT: tele/IRBlaster2/RESULT = {“IrReceived”:{“Protocol”:“SAMSUNG”,“Bits”:32,“Data”:“0xE0E040BF”,“DataLSB”:“0x070702FD”,“Repeat”:0}}

I am able to turn the TV on and off by sending in console:
IrSend:{“Protocol”:“SAMSUNG”,“Bits”:32,“Data”:“0xE0E040BF”,“DataLSB”:“0x070702FD”,“Repeat”:0}

SO, the IRBlaster is setup and functioning.

I have setup MQTT and it has discovered IRBlaster1 and IRBlaster2

Entities

‘IRBlaster2 status’ ( sensor.irblaster2_status )
MQTT discovery data:

  • Topic: homeassistant/sensor/0CAE0F_status/config
  • Payload
    Subscribed topics:
  • tele/IRBlaster2/LWT

I realise that I have to learn every button of every remote, save the code in script and then add a button on LoveLace to send them… but how on earth do I actually set them up in HA and send command to the IR Blaster?! I have been reading countless posts and haven’t found anything simple enough for a windows user :frowning:

If anyone has a spare 10mins, can you please use the example command above and guide me through where I add the script, how I reference it in LoveLace and hwo I actually send it via MQTT.

I will then replicate the code for all remote buttons and share the results for anyone else with a Samsung and Daikin AC =D

Many thanks!!

Ahhhhh So I need to use cmnd with mqtt.publish

cmnd/IRBlaster2/IrSend
{
    "Protocol": "SAMSUNG",
    "Bits": 32,
    "Data": "0xE0E040BF",
    "DataLSB": "0x070702FD",
    "Repeat": 0
  }

OK, I can control the TV from MQTT Explorer… still need to get the scripts and lovelace working

I just make them up as a switch in configuration.yaml or switch.yaml, they can then be added to lovelace etc. You should just need to swap /tasmota-ir/ to /irblaster1/

switch:
    - platform: mqtt
    name: "IR Power"
    command_topic: "cmnd/tasmota-ir/IRSEND"
    availability_topic: "tele/tasmota-ir/LWT"
    qos: 1
    payload_on: '{"Protocol":"nec","Data":0x4EBB708F,"Bits":"32"}'
    payload_available: "Online"
    payload_not_available: "Connection Lost"
    retain: false
    
  - platform: mqtt
    name: "IR Source"
    command_topic: "cmnd/tasmota-ir/IRSEND"
    availability_topic: "tele/tasmota-ir/LWT"
    qos: 1
    payload_on: '{"Protocol":"nec","Data":0x4EBB7887,"Bits":"32"}'
    payload_available: "Online"
    payload_not_available: "Connection Lost"
    retain: false   

If I want to play around with them in nodered I just add

 {"Protocol":"NEC","Data":0x4EBB708F,"Bits":"32"}

to msg.payload via a change or injection node and send that to a mqtt node setup for cmnd/IRBlaster2/irsend

edit:
to make it even easier…

switch:
    - platform: mqtt
    name: "IRBlaster2 Power"
    command_topic: "cmnd/IRBlaster2/IRSEND"
    availability_topic: "tele/IRBlaster2/LWT"
    qos: 1
    payload_on: '{"Protocol":"samsung","Data":0xE0E040BF,"Bits":"32"}'
    payload_available: "Online"
    payload_not_available: "Connection Lost"
    retain: false
1 Like

Could you help me to use the code in node-red? I am not able to use

You haven’t supplied anything to help with.