[SOLVED] IR Send with Tasmota MQTT Binding V2.5

I am having trouble integrating my IR Remote MQTT in the current version 2.5 binding.

.things

Thing mqtt:topic:irremote {
		Channels:
			// Type number : uptime    "LED Stripe uptime" [ stateTopic="MyS-Node/5/255/3/0/22" ]
			// String ZmoteString "Zmote IR [%s]" (IRGroup) {mqtt=">[broker:cmnd/zmote-01/IRSEND:command:*:default]", "<[broker:stat/zmote-01/RESULT:state:default]"}
			Type string	: ir_code		"IR Code" [ commandTopic="cmnd/ZMOTE-01/IRSEND", "MAP(iridual.map)"]
			Type number : ir_wifi		"IR Wifi Signal" [ stateTopic="tele/ZMOTE-01/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI" ]
			
	}

.items

// String IR-Remote
String IRCode_01		"IR Code"			{ channel="mqtt:topic:irremote:ir_code" }
Number IRWifiSignal_01	"IR Wifi Signal" 	{ channel="mqtt:topic:irremote:ir_wifi" }

.sitemap

Frame label="IR Remote" {
		Selection item=IR_Code_01 mappings=['AUS'='AUS', 'R2-1'='Kerze', 'R4-3'='Herz']
	}

.map

|{"Protocol":"NEC","Bits":32,"Data":"0x407F8877"}=R1-1|// Reihe 1 - 1|
|---|---|
|{"Protocol":"NEC","Bits":32,"Data":"0x407F6897"}=R1-2|//|
|{"Protocol":"NEC","Bits":32,"Data":"0x407F50AF"}=R1-3|//|
|{"Protocol":"NEC","Bits":32,"Data":"0x407FC03F"}=R1-4|//|

Would be nice if someone could help me there.

many many thanks

Karl Heinz

It is not possible to use transformations with the command (outbound) topic yet…
You will need to use a proxy item and a rule:

and change your thing:

Thing mqtt:topic:irremote {
		Channels:
			// Type number : uptime    "LED Stripe uptime" [ stateTopic="MyS-Node/5/255/3/0/22" ]
			// String ZmoteString "Zmote IR [%s]" (IRGroup) {mqtt=">[broker:cmnd/zmote-01/IRSEND:command:*:default]", "<[broker:stat/zmote-01/RESULT:state:default]"}
			Type string	: ir_code		"IR Code" [ commandTopic="cmnd/ZMOTE-01/IRSEND"]
			Type number : ir_wifi		"IR Wifi Signal" [ stateTopic="tele/ZMOTE-01/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI" ]
			
	}

item:

String proxyItem

rule:

rule "proxy IR mqtt"
when
    Item proxyItem received command
then
    IRCode_01.sendCommand(transform("MAP", "iridual.map", receivedCommand.toString))
end

Sitemap:

Frame label="IR Remote" {
		Selection item=proxyItem mappings=['AUS'='AUS', 'R2-1'='Kerze', 'R4-3'='Herz']
	}

Your map file seems strange, are you sure that’s it? Maybe it should be:

R1-1={"Protocol":"NEC","Bits":32,"Data":"0x407F8877"}
R1-2={"Protocol":"NEC","Bits":32,"Data":"0x407F6897"}
R1-3={"Protocol":"NEC","Bits":32,"Data":"0x407F50AF"}
R1-4={"Protocol":"NEC","Bits":32,"Data":"0x407FC03F"}

AUS=???
R2-1=???
R4-3=???

2 Likes

Thank you so much, I made the changes. With MQTT.fx also the string is not complete.
I then changed the normal one

" in \"

, I had done that with binding 1.x before in a rule. Has worked there.

okay I had only copied a part of the .map, sorry and then I turned the direction yet.

// iDUAL IR-Code

{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F807F\"}=EIN		// EIN
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F40BF\"}=AUS		// AUS
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F08F7\"}=DUNKLER	// Dunkler
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F906F\"}=HELLER		// Heller
                                    
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F8877\"}=R1-1	// Reihe 1 - 1
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F6897\"}=R1-2	//
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F50AF\"}=R1-3	//
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FC03F\"}=R1-4	//
                                    
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F48B7\"}=R2-1	// Reihe 2 - 1 Kerzen
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FE817\"}=R2-2	//
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FD02F\"}=R2-3	//
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F20DF\"}=R2-4
                                    
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FC837\"}=R3-1	//	Reihe 3 - 1
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F18E7\"}=R3-2	//
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F30CF\"}=R3-3	//
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FA05F\"}=R3-4	//
                                   
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F28D7\"}=R4-1	//	Reihe 4 - 1
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F9867\"}=R4-2	//
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FB04F\"}=R4-3	//	Herzlich
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F609F\"}=R4-4	//
                                   
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F708F\"}=Rot			// Rot
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FE01F\"}=Orange			// Orange
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F10EF\"}=GrĂĽn			// GrĂĽn
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FA857\"}=Blau			// Blau
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F58A7\"}=L-Farbkreis	// Links Farbkreis
{\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FF00F\"}=R-Farbkreis	// Rechts Farbkreis

in the protocol of the Zmote-01 then comes the following, “no protocol”.

01:45:17 MQT: stat/ZMOTE-01/RESULT = {“Command”:“Unknown”}
01:45:40 MQT: stat/ZMOTE-01/RESULT = {“IRSend”:“No Protocol, Bits or Data”}
01:45:40 CMD: 01:45:17 CMD: 01:45:05 CMD: 01:43:53 CMD: 01:42:55 CMD: 01:40:16 CMD: 01:35:38 CMD: 01:35:34 CMD: 01:35:16 CMD: 01:33:57 CMD: 0101:45:40 MQT: stat/ZMOTE-01/RESULT = {“IRSend”:“No Protocol, Bits or Data”}
01:45:40 MQT: stat/ZMOTE-01/RESULT = {“Command”:“Unknown”}
01:50:17 MQT: tele/ZMOTE-01/STATE = {“Time”:“1970-01-01T01:50:17”,“Uptime”:“0T01:50:13”,“Vcc”:3.186,“Wifi”:{“AP”:1,“SSId”:“www.asw-it.com”,“BSSId”:“78:8A:20:49:8D:8F”,“Channel”:11,“RSSI”:72}}
01:50:17 CMD: 01:45:40 CMD: 01:45:17 CMD: 01:45:05 CMD: 01:43:53 CMD: 01:42:55 CMD: 01:40:16 CMD: 01:35:38 CMD: 01:35:34 CMD: 01:35:16 CMD: 0101:50:17 MQT: tele/ZMOTE-01/STATE = {“Time”:“1970-01-01T01:50:17”,“Uptime”:“0T01:50:13”,“Vcc”:3.186,“Wifi”:{“AP”:1,“SSId”:“www.asw-it.com”,“BSSId”:“78:8A:20:49:8D:8F”,“Channel”:11,“RSSI”:72}}
01:50:17 MQT: stat/ZMOTE-01/RESULT = {“Command”:“Unknown”}

hello that was correct before, now he sends the code correctly

// iDUAL IR-Code

EIN			={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F807F\"}	// EIN
AUS			={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F40BF\"}	// AUS
DUNKLER		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F08F7\"}	// Dunkler
HELLER		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F906F\"}	// Heller
                                    
R1-1		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F8877\"}	// Reihe 1 - 1
R1-2		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F6897\"}
R1-3		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F50AF\"}
R1-4		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FC03F\"}
										
R2-1		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F48B7\"}	// Reihe 2 - 1 Kerzen
R2-2		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FE817\"}
R2-3		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FD02F\"}
R2-4		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F20DF\"}
										
R3-1		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FC837\"}	//	Reihe 3 - 1
R3-2		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F18E7\"}
R3-3		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F30CF\"}
R3-4		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FA05F\"}
									
R4-1		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F28D7\"}	//	Reihe 4 - 1
R4-2		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F9867\"}
R4-3		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FB04F\"}	//	Herzlich
R4-4		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F609F\"}
                                   
Rot			={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F708F\"}	// Rot
Orange		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FE01F\"}	// Orange
GrĂĽn		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F10EF\"}	// GrĂĽn
Blau		={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FA857\"}	// Blau
L-Farbkreis	={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407F58A7\"}	// Links Farbkreis
R-Farbkreis	={\"Protocol\":\"NEC\",\"Bits\":32,\"Data\":\"0x407FF00F\"}	// Rechts Farbkreis

Great, please tick the solution, thanks

1 Like

Hi Vincent, I already had all the Sonoff switches in the MQTT binding 2.5 running, today suddenly nothing turns off.
Last time I changed only the inputs.

.things

    Thing mqtt:topic:sonoff {
        Channels:

Type switch : socket_08 "3D-Printer " [ stateTopic="tele/SONOFF-08/STATE" , transformationPattern="JSONPATH:$.POWER" , commandTopic="cmnd/SONOFF-08/POWER", on="ON", off="OFF", autoupdate="true" ]
    }

.items

Switch Socket_3DPrinter_08 		"3D-Printer "    ["Switchable"] { channel="mqtt:topic:sonoff:socket_08" }

.sitemap

	Frame label="BĂĽro"  {
		Switch item=Socket_3DPrinter_08
    }

.rules

rule "Schalte Pumpe ein"
when
	Time cron "0 0 5 ? * MON-SUN *" //jeden Tag um 5:00  EIN
then	
	Socket_3DPrinter_08.sendCommand(ON)
end

With MQTT.fx I can with the command:
cmnd / SONOFF-08 / POWER ON or OFF switch as normal.

Sorry but I use the paperUI to configure my things

Vincent i have reboot openhab2.services and now running :slight_smile:

yes I would like to do that in the PAPERUI, where can you then view the results, in which folder on RBPI and what files is saved?

Hi guys, I’m struggling trying to find a solution from my case…

I’m using Tasmota 8.4 and I’m able to read and write commands by local Tasmota console but I’m not able to do the same by MQTT FX (I’m trying here before go OH2).

This is from Tasmota Console:
01:52:53 CMD: Irsend {“Protocol”:“NEC”,“Bits”:32,“Data”:0x20DF10EF}
01:52:53 MQT: stat/Tasmota_135/RESULT = {“IRSend”:“Done”}

This is from MQTT FX:
Input on MQTT FX: cmnd/Tasmota_135/Irsend {“Protocol”:“NEC”,“Bits”:32,“Data”:“0x20DF10EF”}
Output on Tasmota Console: 01:54:11 MQT: stat/Tasmota_135/RESULT = {“Command”:“Unknown”}

Do you guys have any tip for me?
Thank you in advance,
From Brazil!!!