OPENMQTTGateway MQTTtoIR

Hello,

i usw a ESP8266 mit OpenMQTTGateway to send with open hab a MQTT signal to send a IR signal.

If i send

mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m ‘{“value”:551494365,“protocol”:“3”,“repeat”:4,“bits”:32}’

or

mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m ‘{“raw”:“9046,4568,518,612,540,588,542,1718,544,586,544,584,544,584,542,588,542,586,540,1718,544,1714,544,588,540,1720,518,1738,520,1740,544,1718,540,1718,542,588,542,588,542,1718,542,588,540,588,540,588,518,1742,544,588,542,1718,546,1712,542,588,542,1718,542,1716,546,1714,542,588,542,1718,544”,“protocol_name”:“IR_Raw”}’

everything works.

How can i include this code in *.things and *.sitemap to send the IR signal?

Create your Thing in PaperUI, as advised by others, and Items in files. When you have that complete and working, watch the logs for errors, then make your sitemap file.

and

Looking at your message, you will also need JSON transformation service installed.

Here’s an example, I use files for everything:

Thing:

Bridge mqtt:broker:pibroker "pibroker" [ host="10.0.1.19", port=1883, secure=false, username="xxxxxxxxx", password="xxxxxxxxx" ]
{
    // Sonoffs
    Thing topic sonoff11 "Living Room Light" @ "Living Room" {
    Channels:
        Type switch : power       "Power"         [ stateTopic="stat/sonoff11/POWER", commandTopic="cmnd/sonoff11/POWER" ]
        Type number : temperature "Temperature"   [ stateTopic="tele/sonoff11/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature" ]
        Type number : humidity    "Humidity"      [ stateTopic="tele/sonoff11/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity" ]
        }
    }

Item:

Switch LivingRoom_Light "Living Room Light" <light>  ["Lighting"] { channel="mqtt:topic:pibroker:sonoff11:power" }
Number LivingRoom_Light_Temp "Temperature [%.1f °F]"      <temp>             { channel="mqtt:topic:pibroker:sonoff11:temperature" }
Number LivingRoom_Light_Humidity    "Humidity [%.1f %%]"    <humidity>       { channel="mqtt:topic:pibroker:sonoff11:humidity" }

Hope this helps, if you run into issues post your configuration and error message in log.

thank you, but i don’t really understand where i can add my sendet code.

i got this IR Signal:

Hey I got a callback

Store signal

Min ind:

1

store code :

551494365/10583

Col: val/timestamp

0:551494365/10554

1:551494365/10583

2:0/0

3:0/0

4:0/0

5:0/0

6:0/0

7:0/0

8:0/0

9:0/0

10:0/0

11:0/0

Data JSON stored

Creating IR buffer

Rcv. IR

9048,4562,548,582,546,582,546,1714,574,554,544,584,542,590,542,584,546,582,546,1712,546,1714,546,588,544,1708,548,1710,548,1712,550,1710,544,1718,548,580,550,580,548,1712,542,594,538,584,546,582,546,1712,546,586,542,1714,548,1710,548,586,544,1712,548,1710,542,1718,546,582,548,1708,548

isAduplicate?

--don't pub. duplicate--

where can i add the raw signal?

In PaperUI everything works fine but how can i program in with *.items *.sitemap files?

where can i send the raw code?

Read Here.

i don’t really understand how to send this command:

{“message”:“{"systemcode":1,"programcode":4,"off":1}”,“protocol”:“rsl366”}

her i will change off to on with a switch item

Did you try with:

message/off/1
message/on/0

do you mean:

Switch Subwoofer “Subwoofer” {mqtt=">broker:home/OpenMQTTGateway/commands/MQTTtoPilight/message/on/0]}

That is mqtt v1 and it’s been awhile since using it but if that is the message your device uses then yes.

Have you used a mqtt tool to get and test the correct msg?

i use open hab 2.5 and yes i use MQTT.fx to check the correct msg.

on my ESP8266 i installed OPENMQTT.

this command works:

pi@raspberrypi : ~ $ mosquitto_pub -t “home/OpenMQTTGateway/commands/MQTTtoPilight” -m ‘{“message”:“{"systemcode":1,"programcode":4,"on":1}”,“protocol”:“rsl366”}’

That is your topic.

Try just this with your item:

home/OpenMQTTGateway/commands/MQTTtoPilight/on

you mean?

*.item

String Subwoofer “Subwoofer” {mqtt=“>[mqtt:broker:pibroker:home/OpenMQTTGateway/commands/MQTTtoPilight/on]”}

This:

Switch Subwoofer “Subwoofer” {mqtt=">[mqtt:broker:pibroker:home/OpenMQTTGateway/commands/MQTTtoPilight:message:on:1]"}

Edit:

Switch Subwoofer “Subwoofer” {mqtt=">[pibroker:/OpenMQTTGateway/commands/MQTTtoPilight:message:on:1]"}

I tried that, but to no avail.
MQTT.fx also does not show a sent command

See the edit above^^^

Same problem

the “systemcode” and “programcode” is also importante to send

Did the on/off work?

this only works:

OFF

pi@raspberrypi : ~ $ mosquitto_pub -t “home/OpenMQTTGateway/commands/MQTTtoPilight” -m ‘{“message”:“{"systemcode":1,"programcode":4,"off":1}”,“protocol”:“rsl366”}’

ON

pi@raspberrypi : ~ $ mosquitto_pub -t “home/OpenMQTTGateway/commands/MQTTtoPilight” -m ‘{“message”:“{"systemcode":1,"programcode":4,"on":1}”,“protocol”:“rsl366”}’

Ok, so what is in the log if you use the info as a switch like this:

Switch Subwoofer “Subwoofer” {mqtt=">[pibroker:OpenMQTTGateway/commands/MQTTtoPilight:message:on:1]"}


This version of mqtt is old and you may not get the best support for trying to use it. I did look at the one device I still have that uses this version. Here’s the item file so you can see an example:

Switch ESP_Easy_Temp_Led "Esp8266 Led" <switch>
	{ mqtt=">[pibroker:/Esp/GPIO/13:command:On:1],>[pibroker:/Esp/GPIO/13:command:Off:0],
	<[pibroker:/Esp/Led/State:state:MAP(ONOFF.map)]" }
Group:Number:AVG gTemp
Number Esp2_BMP_Temp "Esp8266 Temp [%.1f °F]" <temperature> (gTemp)
	{ mqtt="<[pibroker:/Esp2/BMP/Temp:state:default]" }

Number Esp2_BMP_Humid "Esp8266 Humid [%.1f %%]" <humidity> 
	{ mqtt="<[pibroker:/Esp2/BMP/Humid:state:default]" }	

Number Esp2_BMP_Pressure "Esp8266 Pressure [%.1f mbar]" <pressure> 
    {mqtt="<[pibroker:/Esp2/BMP/Pressure:state:default"}

You may want to change and use mqtt2.x version if you’re continuing to struggle with the correct syntax.