NEWS
[ gelöst ] JSON aufteilen in DP
-
Moin
Ja, das Thema war schon öfter hier.
Habe mir auch den einen oder anderen Beitrag angesehen bsw. nach gebaut.
Nun leider ohne Erfolgt.Könnt Ihr mir auf die Sprünge helfen?
Was ich habe :
den JSON DP
und das Blockly
-
@iobrokermike Nimm einfach meinen NodeRed Flow - ansonsten wenn Du selbst nur einzelne Datenpunkte brauchst, dann musst halt beschreiben welchen genau oder Alias erstellen.
Ausserdem wenn Du über den Wert triggerst, dann brauchst Du ihn unten nicht mehr abfragen, sondern kannst direkt Wert nehmen:
Ausserdem ist der Pfad falsch:
{ "sn": { "Time": "2024-11-27T19:17:23", "DS18B20-1": { "Id": "01131B71E34F", "Temperature": 13.69 },
Wenn Du hieraus die Temperatur willst, dass sind doch alles Eigenschaften von sn. Also lautet das Attribut:
sn.DS18B20-1.Temperature
-
-
@iobrokermike sagte: JSON DP
Versuche es mal so:
-
Vielen Dank euch drei.
Habe es so umgesetzt, nur leider ohne Erfolg.
Es kommt werde in dem DP noch beim Debug was an.
In den Protokollen bekomme ich die Daten.
2024-11-29 18:50:39.120 debug stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"18:50:38.443 MQT: umluft_350pic/tele/SENSOR = {\"Time\":\"2024-11-29T18:50:38\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":10.81},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":9.31},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":5.06},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":14.13},\"TempUnit\":\"C\"}","ack":true,"ts":1732902639113,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902639113} mqtt.0 2024-11-29 18:50:39.117 debug stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"18:50:38.434 MQT: umluft_350pic/tele/STATE = {\"Time\":\"2024-11-29T18:50:38\",\"Uptime\":\"0T01:32:30\",\"UptimeSec\":5550,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":3,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":76,\"Signal\":-62,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732902639113,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732902639113} mqtt.0 2024-11-29 18:50:38.125 debug stateChange mqtt.0.umluft_350pic.tele.SENSOR: {"val":"{\"Time\":\"2024-11-29T18:50:38\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":10.81},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":9.31},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":5.06},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":14.13},\"TempUnit\":\"C\"}","ack":true,"ts":1732902638120,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902638120} mqtt.0 2024-11-29 18:50:38.123 debug stateChange mqtt.0.umluft_350pic.tele.STATE: {"val":"{\"Time\":\"2024-11-29T18:50:38\",\"Uptime\":\"0T01:32:30\",\"UptimeSec\":5550,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":3,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":76,\"Signal\":-62,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732902638119,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732902638119} mqtt.0 2024-11-29 18:50:29.241 debug stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"18:50:28.462 MQT: umluft_350pic/tele/SENSOR = {\"Time\":\"2024-11-29T18:50:28\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":10.81},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":9.31},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":5.13},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":14.13},\"TempUnit\":\"C\"}","ack":true,"ts":1732902629236,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902629236} mqtt.0 2024-11-29 18:50:29.239 debug stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"18:50:28.453 MQT: umluft_350pic/tele/STATE = {\"Time\":\"2024-11-29T18:50:28\",\"Uptime\":\"0T01:32:20\",\"UptimeSec\":5540,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":3,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":76,\"Signal\":-62,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732902629236,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902629236} mqtt.0 2024-11-29 18:50:28.185 debug stateChange mqtt.0.umluft_350pic.tele.SENSOR: {"val":"{\"Time\":\"2024-11-29T18:50:28\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":10.81},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":9.31},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":5.13},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":14.13},\"TempUnit\":\"C\"}","ack":true,"ts":1732902628181,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902628181} mqtt.0 2024-11-29 18:50:28.184 debug stateChange mqtt.0.umluft_350pic.tele.STATE: {"val":"{\"Time\":\"2024-11-29T18:50:28\",\"Uptime\":\"0T01:32:20\",\"UptimeSec\":5540,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":3,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":76,\"Signal\":-62,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732902628180,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902628180} mqtt.0 2024-11-29 18:50:27.116 debug Client [Umluft] pingreq mqtt.0 2024-11-29 18:50:19.101 debug stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"18:50:18.429 MQT: umluft_350pic/tele/SENSOR = {\"Time\":\"2024-11-29T18:50:18\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":10.81},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":9.31},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":5.06},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":14.13},\"TempUnit\":\"C\"}","ack":true,"ts":1732902619098,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902619098} mqtt.0 2024-11-29 18:50:19.100 debug stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"18:50:18.420 MQT: umluft_350pic/tele/STATE = {\"Time\":\"2024-11-29T18:50:18\",\"Uptime\":\"0T01:32:10\",\"UptimeSec\":5530,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":3,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":76,\"Signal\":-62,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732902619098,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902619098} mqtt.0 2024-11-29 18:50:18.111 debug stateChange mqtt.0.umluft_350pic.tele.SENSOR: {"val":"{\"Time\":\"2024-11-29T18:50:18\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":10.81},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":9.31},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":5.06},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":14.13},\"TempUnit\":\"C\"}","ack":true,"ts":1732902618106,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902618106} mqtt.0 2024-11-29 18:50:18.109 debug stateChange mqtt.0.umluft_350pic.tele.STATE: {"val":"{\"Time\":\"2024-11-29T18:50:18\",\"Uptime\":\"0T01:32:10\",\"UptimeSec\":5530,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":3,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":76,\"Signal\":-62,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732902618105,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902618105} mqtt.0 2024-11-29 18:50:09.109 debug stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"18:50:08.434 MQT: umluft_350pic/tele/SENSOR = {\"Time\":\"2024-11-29T18:50:08\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":10.81},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":9.31},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":5.13},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":14.13},\"TempUnit\":\"C\"}","ack":true,"ts":1732902609105,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902609105}
PS. Ebend kam im DP ein (null) an.
-
@iobrokermike sagte in JSON aufteilen in DP:
Es kommt werde in dem DP noch beim Debug was an.
In den Protokollen bekomme ich die Daten.das ist doch ein anderer Datenpunkt, oder?
-
@iobrokermike sagte:
2024-11-29 18:50:18.111 debug stateChange mqtt.0.umluft_350pic.tele.SENSOR: {"val":"{\"Time\":\"2024-11-29T18:50:18\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":10.81},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":9.31},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":5.06},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":14.13},\"TempUnit\":\"C\"}","ack":true,"ts":1732902618106,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.XXXXX","lc":1732902618106}
Hier fehlt "sn".
-
@iobrokermike
Da sehe ich aber kein "sn".Zeig bitte nochmal, was genau in dem DP
mqtt.0.umluft_350pic.tele.SENSOR
steht. -
@codierknecht sagte in JSON aufteilen in DP:
Da sehe ich aber kein "sn".
ich auch nicht.
und aus dem log klappts wegen der Escapes nicht -
Unter diesen JSON ist kein "sn".
Nur dieser wird aktualisiert.
SORRY{ "Time": "2024-11-29T19:26:38", "DS18B20-1": { "Id": "01131B71E34F", "Temperature": 10.56 }, "DS18B20-2": { "Id": "01131B8507D6", "Temperature": 9.06 }, "DS18B20-3": { "Id": "01131BE31350", "Temperature": 4.94 }, "DS18B20-4": { "Id": "021313CCB0AA", "Temperature": 14.06 }, "TempUnit": "C" }
-
die zweite Zeile ist für dich interessant, eigentlich nur das Attribut korrigieren
EDIT:
Das hast du ja schon.
Dann muss das so klappen. -
@homoran sagte in JSON aufteilen in DP:
Das hast du ja schon.
Dann muss das so klappen.Leider nein.
Habe es auch mal deinem nachgebaut, auch das nicht.
Glaube bin zu du.. dazu. -
@iobrokermike was steht denn im großen log (Protokolle)?
-
@iobrokermike Du musst den Text noch in ein Objekt wandeln.
Also vor den grünen Text. -
@mickym sagte in JSON aufteilen in DP:
Du musst den Text noch in ein Objekt wandeln.
warum muss ich das nicht
-
@homoran sagte in JSON aufteilen in DP:
as steht denn im großen log (Protokolle)?
2024-11-29 20:18:41.186 - debug: mqtt.0 (392491) Redis Objects: Use Redis connection: 127.0.0.1:9001 2024-11-29 20:18:41.203 - debug: mqtt.0 (392491) Objects client ready ... initialize now 2024-11-29 20:18:41.203 - debug: mqtt.0 (392491) Objects create System PubSub Client 2024-11-29 20:18:41.204 - debug: mqtt.0 (392491) Objects create User PubSub Client 2024-11-29 20:18:41.226 - debug: mqtt.0 (392491) Objects client initialize lua scripts 2024-11-29 20:18:41.229 - debug: mqtt.0 (392491) Objects connected to redis: 127.0.0.1:9001 2024-11-29 20:18:41.245 - debug: mqtt.0 (392491) Redis States: Use Redis connection: 127.0.0.1:9000 2024-11-29 20:18:41.252 - debug: mqtt.0 (392491) States create System PubSub Client 2024-11-29 20:18:41.252 - debug: mqtt.0 (392491) States create User PubSub Client 2024-11-29 20:18:41.312 - debug: mqtt.0 (392491) States connected to redis: 127.0.0.1:9000 2024-11-29 20:18:41.349 - debug: mqtt.0 (392491) Plugin sentry Initialize Plugin (enabled=true) 2024-11-29 20:18:41.497 - info: mqtt.0 (392491) starting. Version 6.1.2 in /opt/iobroker/node_modules/iobroker.mqtt, node: v20.18.1, js-controller: 7.0.3 2024-11-29 20:18:41.556 - info: mqtt.0 (392491) Starting MQTT authenticated server on 0.0.0.0:1882 2024-11-29 20:18:41.637 - debug: mqtt.0 (392491) stateChange mqtt.0.info.clients.Umluft: {"val":false,"ack":true,"ts":1732907921635,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907921635} 2024-11-29 20:18:41.690 - debug: mqtt.0 (392491) stateChange mqtt.0.info.connection: {"val":"","ack":true,"ts":1732907921686,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907921686} 2024-11-29 20:18:49.153 - info: mqtt.0 (392491) Client [Umluft] connected with secret 1732907929142_5833 2024-11-29 20:18:49.180 - debug: mqtt.0 (392491) Client [Umluft] with keepalive 30 set timeout to 45 seconds 2024-11-29 20:18:49.188 - debug: mqtt.0 (392491) Client [Umluft] with last will {"retain":true,"qos":1,"topic":"umluft_350pic/tele/LWT","payload":{"type":"Buffer","data":[79,102,102,108,105,110,101]}} 2024-11-29 20:18:49.199 - debug: mqtt.0 (392491) Client [Umluft] Handle subscribe: {"topic":"umluft_350pic/cmnd/#","qos":0} 2024-11-29 20:18:49.200 - info: mqtt.0 (392491) Client [Umluft] subscribes on "umluft_350pic/cmnd/#" with regex /^umluft_350pic\.cmnd\..*/ 2024-11-29 20:18:49.200 - info: mqtt.0 (392491) Client [Umluft] subscribes on "umluft_350pic/cmnd/#" with regex /^mqtt\.0\.umluft_350pic\.cmnd\..*/ 2024-11-29 20:18:49.205 - debug: mqtt.0 (392491) Client [Umluft] Handle subscribe: {"topic":"tasmotas/cmnd/#","qos":0} 2024-11-29 20:18:49.206 - info: mqtt.0 (392491) Client [Umluft] subscribes on "tasmotas/cmnd/#" with regex /^tasmotas\.cmnd\..*/ 2024-11-29 20:18:49.206 - info: mqtt.0 (392491) Client [Umluft] subscribes on "tasmotas/cmnd/#" with regex /^mqtt\.0\.tasmotas\.cmnd\..*/ 2024-11-29 20:18:49.206 - debug: mqtt.0 (392491) Client [Umluft] Handle subscribe: {"topic":"cmnd/Umluft_fb/#","qos":0} 2024-11-29 20:18:49.207 - info: mqtt.0 (392491) Client [Umluft] subscribes on "cmnd/Umluft_fb/#" with regex /^cmnd\.Umluft_fb\..*/ 2024-11-29 20:18:49.207 - info: mqtt.0 (392491) Client [Umluft] subscribes on "cmnd/Umluft_fb/#" with regex /^mqtt\.0\.cmnd\.Umluft_fb\..*/ 2024-11-29 20:18:49.209 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.tele.LWT: {"val":"Online","ack":true,"ts":1732907929197,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732897154587} 2024-11-29 20:18:49.250 - info: mqtt.0 (392491) Client [Umluft] unsubscribes on unknown topic "homeassistant/status" 2024-11-29 20:18:49.255 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.cmnd.POWER: {"val":null,"ack":true,"ts":1732907929252,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907929252} 2024-11-29 20:18:49.259 - debug: mqtt.0 (392491) stateChange mqtt.0.info.clients.Umluft: {"val":true,"ack":true,"ts":1732907929256,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907929256} 2024-11-29 20:18:49.337 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:48.406 RSL: STATE = {\"Time\":\"2024-11-29T20:18:48\",\"Uptime\":\"0T03:00:40\",\"UptimeSec\":10840,\"Heap\":28,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":4,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":76,\"Signal\":-62,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732907929335,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907929335} 2024-11-29 20:18:49.387 - debug: mqtt.0 (392491) stateChange mqtt.0.info.connection: {"val":"Umluft","ack":true,"ts":1732907929380,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907929380} 2024-11-29 20:18:49.403 - info: mqtt.0 (392491) Client [Umluft] publishOnSubscribe send all known states 2024-11-29 20:18:49.407 - info: mqtt.0 (392491) Client [Umluft] publishOnSubscribe send all known states 2024-11-29 20:18:49.408 - info: mqtt.0 (392491) Client [Umluft] publishOnSubscribe send all known states 2024-11-29 20:18:49.428 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:48.412 RSL: SENSOR = {\"Time\":\"2024-11-29T20:18:48\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":12.13},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":11.75},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":11.75},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":12.31},\"TempUnit\":\"C\"}","ack":true,"ts":1732907929426,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907929426} 2024-11-29 20:18:49.429 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:49.252 MQT: Verbindungsversuch...","ack":true,"ts":1732907929427,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907929427} 2024-11-29 20:18:49.430 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:49.308 MQT: verbunden","ack":true,"ts":1732907929427,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907929427} 2024-11-29 20:18:49.430 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:49.311 MQT: umluft_350pic/tele/LWT = Online (beibehalten)","ack":true,"ts":1732907929427,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907929427} 2024-11-29 20:18:49.430 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:49.315 MQT: umluft_350pic/cmnd/POWER = ","ack":true,"ts":1732907929427,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907929427} 2024-11-29 20:18:49.445 - debug: mqtt.0 (392491) stateChange mqtt.0.tasmota.discovery.98CDAC23FB50.config: {"val":"{\"ip\":\"192.168.178.15\",\"dn\":\"Umluft\",\"fn\":[\"EI-OT Modul\",null,null,null,null,null,null,null],\"hn\":\"umluft--topic--6992\",\"mac\":\"98CDAC23FB50\",\"md\":\"EI-OT 2CH 1Wire\",\"ty\":0,\"if\":0,\"ofln\":\"Offline\",\"onln\":\"Online\",\"state\":[\"OFF\",\"ON\",\"TOGGLE\",\"HOLD\"],\"sw\":\"110.00.1\",\"t\":\"umluft_350pic\",\"ft\":\"%topic%/%prefix%/\",\"tp\":[\"cmnd\",\"stat\",\"tele\"],\"rl\":[0,0,0,0,0,0,0,0],\"swc\":[-1,-1,-1,-1,-1,-1,-1,-1],\"swn\":[null,null,null,null,null,null,null,null],\"btn\":[0,0,0,0,0,0,0,0],\"so\":{\"4\":0,\"11\":0,\"13\":0,\"17\":0,\"20\":0,\"30\":0,\"68\":0,\"73\":0,\"82\":0,\"114\":0,\"117\":0},\"lk\":0,\"lt_st\":0,\"sho\":[0,0,0,0],\"ver\":1}","ack":true,"ts":1732907929427,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732897155037} 2024-11-29 20:18:49.445 - debug: mqtt.0 (392491) stateChange mqtt.0.tasmota.discovery.98CDAC23FB50.sensors: {"val":"{\"sn\":{\"Time\":\"2024-11-29T20:18:49\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":12.13},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":11.75},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":11.75},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":12.31},\"TempUnit\":\"C\"},\"ver\":1}","ack":true,"ts":1732907929427,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907929427} 2024-11-29 20:18:49.512 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.RESULT: {"val":"{\"Command\":\"Error\"}","ack":true,"ts":1732907929509,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732897154861} 2024-11-29 20:18:49.516 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.RESULT: {"val":"{\"Command\":\"Error\"}","ack":true,"ts":1732907929513,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732897154861} 2024-11-29 20:18:49.605 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.RESULT: {"val":"{\"Command\":\"Error\"}","ack":true,"ts":1732907929602,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732897154861} 2024-11-29 20:18:50.312 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:49.574 MQT: umluft_350pic/stat/RESULT = {\"Command\":\"Error\"}","ack":true,"ts":1732907930310,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907930310} 2024-11-29 20:18:50.313 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:49.623 MQT: umluft_350pic/stat/RESULT = {\"Command\":\"Error\"}","ack":true,"ts":1732907930310,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907930310} 2024-11-29 20:18:50.313 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:49.675 MQT: umluft_350pic/stat/RESULT = {\"Command\":\"Error\"}","ack":true,"ts":1732907930311,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907930311} 2024-11-29 20:18:51.267 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.RESULT: {"val":"{\"Command\":\"Error\"}","ack":true,"ts":1732907931264,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732897154861} 2024-11-29 20:18:51.315 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:51.376 MQT: umluft_350pic/stat/RESULT = {\"Command\":\"Error\"}","ack":true,"ts":1732907931313,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907931313} 2024-11-29 20:18:58.343 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.tele.STATE: {"val":"{\"Time\":\"2024-11-29T20:18:58\",\"Uptime\":\"0T03:00:50\",\"UptimeSec\":10850,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":5,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":76,\"Signal\":-62,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732907938340,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907938340} 2024-11-29 20:18:58.346 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.tele.SENSOR: {"val":"{\"Time\":\"2024-11-29T20:18:58\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":12.13},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":11.75},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":11.75},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":12.31},\"TempUnit\":\"C\"}","ack":true,"ts":1732907938340,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907938340} 2024-11-29 20:18:59.333 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:58.445 MQT: umluft_350pic/tele/STATE = {\"Time\":\"2024-11-29T20:18:58\",\"Uptime\":\"0T03:00:50\",\"UptimeSec\":10850,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":5,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":76,\"Signal\":-62,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732907939330,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907939330} 2024-11-29 20:18:59.335 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:18:58.456 MQT: umluft_350pic/tele/SENSOR = {\"Time\":\"2024-11-29T20:18:58\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":12.13},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":11.75},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":11.75},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":12.31},\"TempUnit\":\"C\"}","ack":true,"ts":1732907939331,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907939331} 2024-11-29 20:19:08.329 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.tele.STATE: {"val":"{\"Time\":\"2024-11-29T20:19:08\",\"Uptime\":\"0T03:01:00\",\"UptimeSec\":10860,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":5,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":74,\"Signal\":-63,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732907948326,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907948326} 2024-11-29 20:19:08.331 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.tele.SENSOR: {"val":"{\"Time\":\"2024-11-29T20:19:08\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":12.13},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":11.75},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":11.75},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":12.31},\"TempUnit\":\"C\"}","ack":true,"ts":1732907948326,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907948326} 2024-11-29 20:19:09.328 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:19:08.431 MQT: umluft_350pic/tele/STATE = {\"Time\":\"2024-11-29T20:19:08\",\"Uptime\":\"0T03:01:00\",\"UptimeSec\":10860,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":5,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":74,\"Signal\":-63,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732907949325,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907949325} 2024-11-29 20:19:09.330 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:19:08.441 MQT: umluft_350pic/tele/SENSOR = {\"Time\":\"2024-11-29T20:19:08\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":12.13},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":11.75},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":11.75},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":12.31},\"TempUnit\":\"C\"}","ack":true,"ts":1732907949325,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907949325} 2024-11-29 20:19:18.303 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.tele.STATE: {"val":"{\"Time\":\"2024-11-29T20:19:18\",\"Uptime\":\"0T03:01:10\",\"UptimeSec\":10870,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":5,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":70,\"Signal\":-65,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732907958300,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907958300} 2024-11-29 20:19:18.305 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.tele.SENSOR: {"val":"{\"Time\":\"2024-11-29T20:19:18\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":12.13},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":11.75},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":11.81},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":12.31},\"TempUnit\":\"C\"}","ack":true,"ts":1732907958301,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907958301} 2024-11-29 20:19:19.363 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:19:18.406 MQT: umluft_350pic/tele/STATE = {\"Time\":\"2024-11-29T20:19:18\",\"Uptime\":\"0T03:01:10\",\"UptimeSec\":10870,\"Heap\":27,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":5,\"Wifi\":{\"AP\":1,\"SSId\":\"oneBox\",\"BSSId\":\"74:42:7F:66:13:D7\",\"Channel\":9,\"Mode\":\"11n\",\"RSSI\":70,\"Signal\":-65,\"LinkCount\":1,\"Downtime\":\"0T00:00:03\"}}","ack":true,"ts":1732907959360,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907959360} 2024-11-29 20:19:19.365 - debug: mqtt.0 (392491) stateChange mqtt.0.umluft_350pic.stat.LOGGING: {"val":"20:19:18.416 MQT: umluft_350pic/tele/SENSOR = {\"Time\":\"2024-11-29T20:19:18\",\"DS18B20-1\":{\"Id\":\"01131B71E34F\",\"Temperature\":12.13},\"DS18B20-2\":{\"Id\":\"01131B8507D6\",\"Temperature\":11.75},\"DS18B20-3\":{\"Id\":\"01131BE31350\",\"Temperature\":11.81},\"DS18B20-4\":{\"Id\":\"021313CCB0AA\",\"Temperature\":12.31},\"TempUnit\":\"C\"}","ack":true,"ts":1732907959360,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1732907959360}
-
@iobrokermike ich seh nichts von Javascript!
läuft das Skript?
und die Instanz? -
@homoran sagte in JSON aufteilen in DP:
@mickym sagte in JSON aufteilen in DP:
Du musst den Text noch in ein Objekt wandeln.
warum muss ich das nicht
Wenn Du Wert nimmst und das Ganze aus einem Trigger stammt und Wert keine selbst erstellte Variable ist, dann ist das ein Objekt. Wenn Du aber nur einen JSON als Text nimmst, musst Du den erst in ein Objekt wandeln.
Deshalb ist es auch nicht gut, wenn man eine selbst erstellte Variable Wert nennt - dann verwechselt man das.
-
@mickym sagte in JSON aufteilen in DP:
Deshalb ist es auch nicht gut, wenn man eine selbst erstellte Variable Wert nennt
Da stimme ich dir zu! Mir fiel nur auf die Schnelle kein kurzer Begriff für "extrahierter Wert" ein.
hier jedoch nicht
@mickym sagte in JSON aufteilen in DP:
Wenn Du aber nur einen JSON als Text nimmst, musst Du den erst in ein Objekt wandeln.
hier
https://forum.iobroker.net/assets/uploads/files/1732905391106-screenshot_20241129-193612_firefox.jpg
klappt es ohne Objekt -
@homoran Ja Du hast Recht - ist für mich auch neu - früher ging das glaub nicht. Aber jetzt geht das anscheinend.
geht sogar direkt aus dem Text
Aber irgendwie habe ich es in Erinnerung, dass das früher nicht ging.