Using "Athom IR remote" with Tasmota and Home Assistant

I’m stuck on how to proceed setting up my new “Athom IR remote” with Home Assistant. The unit came with Tasmota pre-installed. I’ve got it connected to my wifi, and I can see it in the Tasmota integration in HA. I can also connect to the device via it’s Tasmota web interface, and have no trouble seeing it via Tasmota admin. If I monitor the devices web console I can even see it receiving IR messages when I ‘shoot’ various IR remotes at it. I’m stuck on what to do next. I would have expected to find a “learn command” function somewhere, but there is nothing of this nature in either the Tasmota web interface, nor in the device page in the Tasmota integration. Could someone please point me in the right direction to make this thing useful?

much thanks in advance from the catdad,

Apparently learning codes with Tasmota is a bit different than the Broadlink IR remotes, which use the Remote: commands in the Developer Tools → Actions section.

Instead, when you have the Tasmota console open, you should see a log message every time you press a button on your “real” remote pointing at the Athom. For example (thanks to digiblur for the notes):

11:11:27.565 MQT: tele/devicename/RESULT = {"IrReceived":{"Protocol":"UNKNOWN","Bits":20,"Hash":"0x85B1439D","Repeat":0,"RawData":"+5810-2840+1940-5620C-1845C-20420AbCdCeC-20415AbCdCeCfAbCdCeCgAbCdCeC","RawDataInfo":[39,39,0]}}

Where the important part is the RawData code, "+5810-2840+1940-5620C-1845C-20420AbCdCeC-20415AbCdCeCfAbCdCeCgAbCdCeC"

Knowing this code, you can execute the same button-press by sending a MQTT message to the Athom at cmnd/name/IRSend containing the code command, as seen in digiblur’s code.

What I do for my Broadlink IR remotes is I create individual template button entities in the Helpers GUI, so then I can simply press a button in the UI or call action button.press in my automatons. See example below, which is linked to the device page for the parent Tasmota device (the name at the bottom).

1 Like

Thanks for your tips. Tasmota setup looks to be somewhat arduous doesn’t it. I wonder if ESP-Home is easier to setup,… I could easily (I think) use OTA upgrade to flash ESP-Home onto the Athom.

IR can be somewhat arduous in general. Here is a discussion about using this device with ESPhome — note you either have to define a whole custom API call, or create buttons that send the codes when pressed. In either case it appears you have to recompile and reflash the firmware every time you want to add a new custom command/code/button, which seems arduous indeed.

Hay I have 2 of these they work

what I did is
created some basic rules

basically I did this

1st i created some rules

rule1
on IrReceived#Data do publish IR/REMOTE %value% endon
on IrReceived#Protocol do publish IR/Protocol %value% endon
on IrReceived#Bits do publish IR/Bits %value% endon
on IrReceived#DataLSB do publish IR/DataLSB %value% endon
on IrReceived#Repeat do publish IR/Repeat %value% endon

dont forget the rule1 1 to activate it

this will break out the codes

pressing the red button on the remote i get

Then I created the sensors to read those MQTT messages

then over the years I got smarter i think

think why can’t just send the RED command so

I created other rule

rule3
on IrReceived#Data=0X400401000E0F do publish IR/CODES RED endon

now I see the RED in the IR/CODES

image

now the trick in HA

then have this automation

- id: RED IR
  alias: RED IR
  triggers:
  - entity_id: sensor.ir_codes
    to: RED
    trigger: state
  conditions: []
  actions:
  - data:
      entity_id: light.kitchen
    action: light.toggle
  - data:
      payload: IR-RED
      topic: IR/CODES
    action: mqtt.publish

that last payload is to reset it and see what was last press also if i press the red one again the automation will retrigger.

now when I press the red bottom on the remote my kitchen lights toggle

Don’t do what the daughter did pointed the remote at the light to turn them on. and say it doesnt work LOL

my athom is under the TV as it a matural to point the remote to the TV

in the other lounge have a other one
with this rule

rule1
on IrReceived#Data=1004E4F do publish IR-2/CODES YELLOW endon
on IrReceived#Data=1000E0F do publish IR-2/CODES RED endon
on IrReceived#Data=1008E8F do publish IR-2/CODES GREEN endon
on IrReceived#Data=100CECF do publish IR-2/CODES BLUE endon
on IrReceived#Data=1002C2D do publish IR-2/CODES UP endon
on IrReceived#Data=100ACAD do publish IR-2/CODES DOWN endon

and the other dum thing i did was

Press the rec button on the remote that’s turns the jug on and when the jug has boiled it turn on the Kitchen light

now the I have a IR gas heater

so what a did was create 2 scripts

ir_turn_on_gas_heater:
  sequence:
  - data_template:
      payload: '{"Protocol":"NEC","Bits":32,"Data":0x416649B6}'
      topic: cmnd/IR-2/irsend
    action: mqtt.publish
  - data_template:
      entity_id: input_boolean.gas_heater_dummy
    action: input_boolean.turn_on
ir_turn_off_gas_heater:
  sequence:
  - data_template:
      payload: '{"Protocol":"NEC","Bits":32,"Data":0X4166B14E}'
      topic: cmnd/IR-2/irsend
    action: mqtt.publish
  - data_template:
      entity_id: input_boolean.gas_heater_dummy
    action: input_boolean.turn_off

note the single quote and the double quotes

now I create a template switch

  - platform: template
    switches:
      gas_heater: #gas_heater_ir
        unique_id: d5d8543d-05df-4498-b87f-68921c14b468
        friendly_name: Gas Heater
        value_template: "{% if is_state('input_boolean.gas_heater_dummy', 'on') %}on{% else %}off{% endif %}"
        turn_on:
          action: script.turn_on
          target:
            entity_id: script.ir_turn_on_gas_heater
        turn_off:
          action: script.turn_on
          target:
            entity_id: script.ir_turn_off_gas_heater

now i have switch for the gas heater that that i can turn on off

then I created a climate control for the ga heater and the climate control only come on whan the TV is on and the lounge lights are on That my safety for controling say some one is in the house.

I have also learnt that you can put a “expire_after”

  - name: "Last IR"
    state_topic: "tele/IR/RESULT"
    value_template: "{{value_json.IrReceived.Data}}"
    expire_after: 1
    qos: 1

this will else reset the Sensor after 1 sec

I use the mark 1 version “why fix what is not broken”