MQTT and json problem
Domotique
eric.berdah.domotique at gmail.com
Sun Feb 5 15:34:47 EST 2023
james,
i have tried to use the display tab,
then have error in the log
5 Feb 2023 21:16:21 MQTT Client v0.1 (Subscribe To MQTT Endpoints): error in data.merge key=Value value=b'0,' error='<' not supported between instances of 'str' and 'int'
5 Feb 2023 21:16:21 MQTT Client v0.1 (Subscribe To MQTT Endpoints): Traceback (most recent call last):
5 Feb 2023 21:16:21 File "/Users/ericberdah/Desktop/xtension9.5 test/XTension 9.5.1.app/Contents/Resources/python3/Resources/xtension_plugin/xtension_plugin.py", line 2875, in merge
5 Feb 2023 21:16:21 self.set( key, newData.get( key)) #use the get so that the type is set and carried forward
5 Feb 2023 21:16:21 File "/Users/ericberdah/Desktop/xtension9.5 test/XTension 9.5.1.app/Contents/Resources/python3/Resources/xtension_plugin/xtension_plugin.py", line 2422, in set
5 Feb 2023 21:16:21 self.subscribersNotify( key, value)
5 Feb 2023 21:16:21 File "/Users/ericberdah/Desktop/xtension9.5 test/XTension 9.5.1.app/Contents/Resources/python3/Resources/xtension_plugin/xtension_plugin.py", line 2750, in subscribersNotify
5 Feb 2023 21:16:21 theCallback( theKey, theValue, theTag, self)
5 Feb 2023 21:16:21 File "/Users/ericberdah/Desktop/xtension9.5 test/XTension 9.5.1.app/Contents/Resources/Plugins/mqtt.isf/mqtt.py", line 550, in subscribedValueChanged
5 Feb 2023 21:16:21 if value < 0 or value >= len( enums):
5 Feb 2023 21:16:21 TypeError: '<' not supported between instances of 'str' and ‘int’
on the SENSOR and STATE topic there is a double {{ in the json response and don’t know how to parse them with the "parse json » verb of xtension
for the parsing problem the data are below
i’m intersting for this device in :
- LWT (Online/offline)
- RSSI (x dbm)
- POWER (ON/OFF)
- Temperature (x°C)
- Humidity (x%)
- DewPoint (x°C)
thank’s
Eric
Localhost
▼tele
▼tasmota_004CBD
LWT = Online
STATE = {"Time":"2023-02-05T21:24:10","Uptime":"0T04:50:12","UptimeSec":17412,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":3,"POWER":"OFF","Wifi":{"AP":1,"SSId":"FamilyBusinessWifi","BSSId":"D8:47:32:62:0B:66","Channel":2,"Mode":"11n","RSSI":100,"Signal":-47,"LinkCount":1,"Downtime":"0T00:00:07"}}
SENSOR = {"Time":"2023-02-05T21:24:10","SI7021":{"Temperature":20.8,"Humidity":52.4,"DewPoint":10.7},"TempUnit":"C"}
▼tasmota
▼discovery
▼4C11AE004CBD
config = {"ip":"192.168.0.31","dn":"Tasmota","fn":["Tasmota",null,null,null,null,null,null,null],"hn":"tasmota-004CBD-3261","mac":"4C11AE004CBD","md":"Sonoff TH","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"12.3.1","t":"tasmota_004CBD","ft":"%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[1,0,0,0,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,nul…
sensors = {"sn":{"Time":"2023-02-05T21:09:41","SI7021":{"Temperature":20.8,"Humidity":53.3,"DewPoint":10.9},"TempUnit":"C"},"ver":1}
▼stat
▼tasmota_004CBD
POWER = OFF
LOGGING = 21:24:10.393 MQT: tele/tasmota_004CBD/SENSOR = {"Time":"2023-02-05T21:24:10","SI7021":{"Temperature":20.8,"Humidity":52.4,"DewPoint":10.7},"TempUnit":"C"}
RESULT = {"POWER":"OFF"}
▶$SYS (43 topics, 2700 messages)
▼cmnd
▼tasmota_004CBD
POWER = OFF
localhost
▼tele
▼tasmota_004CBD
LWT = Online
STATE = {"Time":"2023-02-05T21:24:10","Uptime":"0T04:50:12","UptimeSec":17412,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":3,"POWER":"OFF","Wifi":{"AP":1,"SSId":"FamilyBusinessWifi","BSSId":"D8:47:32:62:0B:66","Channel":2,"Mode":"11n","RSSI":100,"Signal":-47,"LinkCount":1,"Downtime":"0T00:00:07"}}
SENSOR = {"Time":"2023-02-05T21:24:10","SI7021":{"Temperature":20.8,"Humidity":52.4,"DewPoint":10.7},"TempUnit":"C"}
▼tasmota
▼discovery
▼4C11AE004CBD
config = {"ip":"192.168.0.31","dn":"Tasmota","fn":["Tasmota",null,null,null,null,null,null,null],"hn":"tasmota-004CBD-3261","mac":"4C11AE004CBD","md":"Sonoff TH","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"12.3.1","t":"tasmota_004CBD","ft":"%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[1,0,0,0,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,nul…
sensors = {"sn":{"Time":"2023-02-05T21:09:41","SI7021":{"Temperature":20.8,"Humidity":53.3,"DewPoint":10.9},"TempUnit":"C"},"ver":1}
▼stat
▼tasmota_004CBD
POWER = OFF
LOGGING = 21:24:10.393 MQT: tele/tasmota_004CBD/SENSOR = {"Time":"2023-02-05T21:24:10","SI7021":{"Temperature":20.8,"Humidity":52.4,"DewPoint":10.7},"TempUnit":"C"}
RESULT = {"POWER":"OFF"}
▶$SYS (43 topics, 2507 messages)
▼cmnd
▼tasmota_004CBD
POWER = OFF
No charts selected
Select a numeric values from the value preview.
Click on to add a topic / value to this pane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20230205/6f12e9f7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d?e?cran 2023-02-05 a? 21.21.17.png
Type: image/png
Size: 63863 bytes
Desc: not available
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20230205/6f12e9f7/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d?e?cran 2023-02-05 a? 21.21.08.png
Type: image/png
Size: 109890 bytes
Desc: not available
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20230205/6f12e9f7/attachment-0001.png>
More information about the XTensionList
mailing list