I’m not very experienced in the technical ways too. But when I look in your first post I see, that you got a string from mosquitto
For me it looks like i fyour JSON-Transformation is not correct. So the first question is if you have installed the JSONPath-Transformation-Service ?
The next point I observed is the way how you handle your topics. I don’t know really, but as I understand there three ways to communicate with a Tasmoata-flashed devices: tele, stat, cmnd. You’re using something like this “sonofftele” and the syntax of the Transformation-String seems to be not correct and you are mixing mqtt2 (.things) and mqtt1 (.items)
There are some examples of @H102 how to deal with that and hints from Jürgen, Udo, Rolf, rossko57 and Elias of which I have my knowings too.
I already have installed Mosquitto as Broker, as I came from MQTT1. So for me there was nothing else to do (I think) only installing the MQTT2-Binding.
As I have a TH16 with AM2301-Sensor, will give you my setup here:
mqtt2.things:
Bridge mqtt:broker:hans "Mosquitto" [ host="localhost", port=1883, secure=false, clientID="OH2_hans" ]
{
//Gruppe TH10/16 Monitoring WiFi Smart Switch
Thing topic TH1601 "Sonoff TH16 01" @ "MQTT2" {
Channels:
Type switch : power "Power " [ stateTopic="stat/th16_01/POWER", commandTopic="cmnd/th16_01/POWER" ]
Type number : rssi "WiFi Signal Strength" [ stateTopic="tele/th16_01/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
Type string : version "Firmware Version" [ stateTopic="stat/th16_01/STATUS2", transformationPattern="JSONPATH:$.StatusFWR.Version"]
Type switch : reachable "Reachable" [ stateTopic="tele/th16_01/LWT", transformationPattern="MAP:reachable.map" ]
Type number : temperature "Temperature" [ stateTopic="tele/th16_01/SENSOR", transformationPattern="JSONPATH:$.AM2301.Temperature"]
Type number : humidity "Humidity" [ stateTopic="tele/th16_01/SENSOR", transformationPattern="JSONPATH:$.AM2301.Humidity"]
Type string : ssid "WiFi" [ stateTopic="tele/th16_01/STATE", transformationPattern="JSONPATH:$.Wifi.SSId"]
Type datetime : time "Time" [ stateTopic="tele/th16_01/STATE", transformationPattern="JSONPATH:$.Time"]
}
}
and the corresponding Items-File:
Switch Sonoff_PowerStrip_01 "Steckdosenleiste 1 [MAP(de.map):%s]" <poweroutlet> (EG_Kind1,gPlugSwitch,gSonoff) { channel="mqtt:topic:hans:TH1601:power"}
Number Sonoff_PowerStrip_01_RSSI "Steckdosenleiste 1 RSSI [%s]" <qualityofservice> (EG_Kind1,gRSSI) { channel="mqtt:topic:hans:TH1601:rssi" }
String Sonoff_PowerStrip_01_Version "Steckdosenleiste 1 Version 63[%s]" <sonoff_pow> (gSonoffs,gVer) { channel="mqtt:topic:hans:TH1601:version" }
Switch Sonoff_PowerStrip_01_Unreach "Steckdosenleiste 1 Erreichbarkeit [%s]" <siren1> (EG_Kind1,gLWT) { channel="mqtt:topic:hans:TH1601:reachable" }
// For Fun and Test
Number Sonoff_PowerStrip_01_Temp "Steckdosenleiste 1 Temperatur[%.1f °C]" <temperature> (gSonoffs,EG_Kind1,gRtIstI) { channel="mqtt:topic:hans:TH1601:temperature"}
Number Sonoff_PowerStrip_01_Hum "Steckdosenleiste 1 Luftfeuchtigkeit[%.2f %%]" <humidity> (gSonoffs,EG_Kind1) { channel="mqtt:topic:hans:TH1601:humidity" }
String Sonoff_PowerStrip_01_SSID "Steckdosenleiste 1 Wlan [%s]" <chart> (gSonoffs) { channel="mqtt:topic:hans:TH1601:ssid" }
DateTime Sonoff_PowerStrip_01_Date "Steckdosenleiste 1 Refresh [ %1$tH:%1$tM]" <time> (gSonoffs) { channel="mqtt:topic:hans:TH1601:time" }
and a screenshot of my MQTT-Setup of the TH16
Hope this can help you for your additional tests.