Smart IR bridge with Tasmota, problem with home assistant by MQTT

Hello Everyone , I’m trying to control the air conditioner, television and sound here in the living room. I bought a bridge called SMART IR WIFI, probably generic. I’ve already flashed the device with Tasmota-ircustom.bin firmware, it works well, i instaled too a AM2301 Temperature sensor Everything works well , but when integrating with Smart IR there in the home assistant things are not working out. I can connect to the MQTT server, send the sensor data and everything, but I can’t use the IR functions. I have already configured the library files, but send no IR signal.

Printscreen of my configuration archive :

tela do config

Sorry for my weak english, and thank you

I am not so aware about smartir custom component. I believe you are able to make the IR functions with mqtt using the command IRSend. In that case, I believe instead of going with smartir you can try creating mqtt switches to send IRsend command with the payload in json format.

will I be able to put some other firmware on this hardware that has a easier integration?
I use this firmware and the Mqtt because in the documentation of smarir have examples using him

I have seen the commands and these are configured for broadlink device which is in b64 or hex format. But since you are having tasmota firmware, it is working with another format. Also you said that tasmota was working fine so i think you have configured the modules correctly in tasmota. Are you able to send and learn commands using the tasmota UI or console?

Yes, when i put the ac controller and press the button, the code appears in Tasmota console. I haven’t tried to send commands yet

Thats great. you must be seeing some code like this.

{"IrReceived":{"Protocol":"PIONEER","Bits":64,"Data":"0xA55A50AFA55A50AF"} 

Now to send the Ir code, just replace IrReceived with IRsend and paste it in the console and press enter. eg:

IRsend {"Protocol":"PIONEER","Bits":64,"Data":"0xA55A50AFA55A50AF"}

Let me know if this works

Yes, this is a example of code what i’m receiveing

"IrReceived":{"Protocol":"COOLIX","Bits":24,"Data":"0xB27BE0","DataLSB":"0x4DDE07","Repeat":0,"IRHVAC":{"Vendor":"COOLIX","Model":-1,"Mode":"Off","Power":"Off","Celsius":"On","Temp":17,"FanSpeed":"Auto","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}

Im sending this code :

IrSend {"Protocol":"COOLIX","Bits":24,"Data":"0xB27BE0","DataLSB":"0x4DDE07","Repeat":0,"IRHVAC":{"Vendor":"COOLIX","Model":-1,"Mode":"Off","Power":"Off","Celsius":"On","Temp":17,"FanSpeed":"Auto","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}

Everything is working well, the air condicioner accepts the commands

So now its simple now. I can now think of 3 methods to achieve it but this method is simpler in which you should create a script for all the buttons you want to use with the IR device. You can create scripts by going to Configuration>scripts>add script. Give it any name and in the actions type tab select “call service” and in services tab “mqtt.publish”. In the service data tab paste this.

topic: cmnd/<your_mqtt_topic>/IRsend
payload: {"Protocol":"COOLIX","Bits":24,"Data":"0xB27BE0","DataLSB":"0x4DDE07","Repeat":0,"IRHVAC":{"Vendor":"COOLIX","Model":-1,"Mode":"Off","Power":"Off","Celsius":"On","Temp":17,"FanSpeed":"Auto","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}

Save it, thats all. Now you just have to call this script to perform the function of that button. You need to repeat it with all other buttons you want. In the front end also you can create buttons or anything calling this script.

1 Like

Sure, do you think there are some templates ready for the remote control buttons?
and, i activate these scripts using a button ?

You can look at this lovelace custom card for remote templates but there is very limited options and also you need to configure them.

you can call scripts from button entity like this
image

Thank you so much for the help, when i finish the integration, i will post here

When i test the script, one error appear

Failed to call service script/1610861354673. value should be a string for a dictionary value @ data[‘payload’]

Try this as data

topic: cmnd/<your_mqtt_topic>/IRsend
payload: '{"Protocol":"COOLIX","Bits":24,"Data":"0xB27BE0","DataLSB":"0x4DDE07","Repeat":0,"IRHVAC":{"Vendor":"COOLIX","Model":-1,"Mode":"Off","Power":"Off","Celsius":"On","Temp":17,"FanSpeed":"Auto","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}'

It Works, Thank you again