can anyone help me to get the value in a string an show that string on basicUI?
i read this values from my tuya thermostat with mqtt:
{“1”:true,“2”:125,“3”:265,“4”:“Manual”,“6”:false,“12”:0,“101”:false,“102”:false,“103”:0,“104”:1,“105”:15,“106”:true,“107”:true,“108”:true,“109”:-10,“110”:10,“111”:2,“112”:45,“113”:5,“114”:35,“115”:5,“116”:“in”,“117”:“keep”,“118”:“2days”}
my sonoff TH16 gives me this:
Subscribed to: tele/sonoff_th16/SENSOR {"Time":"2019-11-24T15:53:04","SI7021":{"Temperature":21.0,"Humidity":39.5},"TempUnit":"C"}
i want to read the Temperature and Humidity. How should the code look like ?
this is my test .thing ( Power and State are already working )
Thing mqtt:topic:sonoff_th16 "MQTT Thing: Sonoff TH16" (mqtt:broker:riot) @ "MQTT-Things"
{
Channels:
Type switch : power "Power Switch" [
stateTopic="stat/sonoff_th16/POWER",
commandTopic="cmnd/sonoff_th16/POWER",
on="ON",
off="OFF"
]
Type string : state "Power State" [
stateTopic="stat/sonoff_th16/POWER",
on="ON",
off="OFF"
]
Type number : temperature "Temperature" [
stateTopic="tele/sonoff_th16/SENSOR",
transformationPattern="JSONPATH:$.Temperature"
]
}
thank you
EDIT: Ok i got it, sorry
Type number : temperature "Temperature" [
stateTopic="tele/sonoff_th16/SENSOR",
transformationPattern="JSONPATH:$.SI7021.Temperature"
]