[SOLVED] Sonoff TH16, Almost working but not quite, can't see any mistakes

I’ve followed a few different examples before ending up on this one.


Bridge mqtt:broker:razamqtt [ host="", secure=false, username="hog", password="1234" ] {

Thing topic shed-heater "Shed Heater TH16 01" @ "Shed" {
    Type switch : power       "Power "               [ stateTopic="house/stat/shed-heater/POWER", commandTopic="house/cmnd/shed-heater/POWER" ]
    Type number : rssi        "WiFi Signal Strength" [ stateTopic="house/ele/shed-heater/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
    Type string : version     "Firmware Version"     [ stateTopic="house/stat/shed-heater/STATUS2", transformationPattern="JSONPATH:$.StatusFWR.Version"]
    Type switch : reachable   "Reachable"            [ stateTopic="house/tele/shed-heater/LWT", transformationPattern="MAP:reachable.map" ]
    Type number : temperature "Temperature"          [ stateTopic="house/tele/shed-heater/SENSOR", transformationPattern="JSONPATH:$.AM2301.Temperature"]
    Type number : humidity    "Humidity"             [ stateTopic="house/tele/shed-heater/SENSOR", transformationPattern="JSONPATH:$.AM2301.Humidity"]
    Type string : ssid        "WiFi"                 [ stateTopic="house/tele/shed-heater/STATE", transformationPattern="JSONPATH:$.Wifi.SSId"]
    Type datetime : time      "Time"                 [ stateTopic="house/tele/shed-heater/STATE", transformationPattern="JSONPATH:$.Time"]


Switch    Shed_Heater_Power_01          "Steckdosenleiste 1 [MAP(uk.map):%s]"             <poweroutlet>           (EG_Kind1,gPlugSwitch,gSonoff)  { channel="mqtt:topic:razamqtt:shed-heater:power"}
Number    Shed_Heater_Power_01_RSSI     "Steckdosenleiste 1 RSSI [%s]"                    <qualityofservice>      (EG_Kind1,gRSSI)                { channel="mqtt:topic:razamqtt:shed-heater:rssi" }
String    Shed_Heater_Power_01_Version  "Steckdosenleiste 1 Version 63[%s]"               <sonoff_pow>            (gSonoffs,gVer)                 { channel="mqtt:topic:razamqtt:shed-heater:version" }
Switch    Shed_Heater_Power_01_Unreach  "Steckdosenleiste 1 Reachablity [%s]"          <siren1>                (EG_Kind1,gLWT)                 { channel="mqtt:topic:razamqtt:shed-heater:reachable" }
//        For Fun and Test
Number    Shed_Heater_Power_01_Temp     "Steckdosenleiste 1 Temperature[%.1f °C]"          <temperature>           (gSonoffs,EG_Kind1,gRtIstI)     { channel="mqtt:topicrazamqtt:shed-heater:temperature"}
Number    Shed_Heater_Power_01_Hum      "Steckdosenleiste 1 Humidity[%.2f %%]"    <humidity>              (gSonoffs,EG_Kind1)             { channel="mqtt:topic:razamqtt:shed-heater:humidity" }
String    Shed_Heater_Power_01_SSID     "Steckdosenleiste 1 Wlan [%s]"                    <chart>                 (gSonoffs)                      { channel="mqtt:topic:razamqtt:shed-heater:ssid" }
DateTime  Shed_Heater_Power_01_Date     "Steckdosenleiste 1 Refresh [ %1$tH:%1$tM]"       <time>                  (gSonoffs)                      { channel="mqtt:topic:razamqtt:shed-heater:time" }

Any suggestions to get me moving forwards?

Well that was one mistake. But no results.


Did you change the default Full Topic of the Sonoff device the start with “home/” ? Since you get a JSON response for one Channel it looks that way, however just checking!

The Firmware Version would only be updated if the “Status 2” was called from the device! I do that with a rule.

One Typo:
Type number : rssi “WiFi Signal Strength” [ stateTopic=“house/tele/shed-heater/STATE”, transformationPattern=“JSONPATH:$.Wifi.RSSI”]

Do you see any logentries when a state is changing?
Did you install the used Map and JSONPath transformations?

Thanks for pointing out the typo. I hadn’t see that.

Yes added house/ at the start of path.

I can see the following broadcasted.

This made me smile and again thank you. I had been wondering if I had missed something and didn’t quite understand how the transformation would ‘just’ work. I have not installed the MAP or JSONPath transformations other than what you can see above.

I take this means I missed something on the example I followed and there should have been some additional information?
Where is this normally installed or placed?

I did edit my post above concerning “Status 2”!

Transformations can be installed immidiatly via PaperUI (AddOns -Transforamtions) or by adding them via the file “addons.cfg” (will work on next install).

I have some things to look into, thanks for giving me a direction. I’ll find the information I was missing and then see.

I’ll look at rules later, I have typed STATUS2 on the console but it won’t update as it still needs transformation.

I’ll update here when I find more.

You need to type in Staus 2 (with a space!).

This time that’s understood. It did make a difference. So that is progress!

I initially misunderstood what transformation services were, back the documentation for me. Now that json and map transformations are installed most of the results are in. Reachability still isn’t updating but I’ve not looked into that yet.

Setting this to solved. Thanks for the help @opus

Edit - Solved the reachability.