Das WLANThermo Team wünscht euch allen fröhliche und glückliche Feiertage!
Importier dir das mal in NodeRed:@Steak-Thermo
Vielen Dank erstmal! Mein Problem ist aber, wie ich aus:
{"system":{"time":"1585993384","unit":"C","rssi":-51,"online":2},"channel":[{"number":1,"name":"Grillraum","typ":0,"temp":22.80,"min":80.00,"max":140.00,"alarm":0,"color":"#0C4C88","fixed":false},{"number":2,"name":"Pulled P.","typ":0,"temp":20.60,"min":8.00,"max":95.00,"alarm":0,"color":"#22B14C","fixed":false},{"number":3,"name":"Kanal 3","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#EF562D","fixed":false},{"number":4,"name":"Kanal 4","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#FFC100","fixed":false},{"number":5,"name":"Kanal 5","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#A349A4","fixed":false},{"number":6,"name":"Kanal 6","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#804000","fixed":false},{"number":7,"name":"Kanal 7","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#5587A2","fixed":false},{"number":8,"name":"Kanal 8","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#5C7148","fixed":false},{"number":9,"name":"Kanal 9","typ":15,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#5C7148","fixed":true},{"number":10,"name":"Kanal 10","typ":15,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#5C7148","fixed":true}],"pitmaster":{"type":["off","manual","auto"],"pm":[{"id":0,"channel":1,"pid":1,"value":100,"set":200.00,"typ":"auto","set_color":"#ff0000","value_color":"#000000"},{"id":1,"channel":2,"pid":1,"value":0,"set":50.00,"typ":"off","set_color":"#FE2EF7","value_color":"#848484"}]}}
Z.B. das: [{"number":1,"name":"Grillraum","typ":0,"temp":22.80,"min
zurück in einen einzlnen "neuen" Datenpunkt in Iobroker bekomme, also nur den Wert 22.8
Rein und raus aus von Iobroker in Node-Red bekome ich schon, nur mit der String-Extrahierung fehlts mir noch....
Google mich da mal Abends durch - nun is schönes Wetter in S-H und es geht raus zum Corona Volkslauf;-)
[
{
"id":"39c3dc56.46a1f4",
"type":"tab",
"label":"Nano",
"disabled":false,
"info":""
},
{
"id":"e19e5979.f371f",
"type":"mqtt in",
"z":"39c3dc56.46a1f4",
"name":"",
"topic":"WLanThermo/NANO-XXXX/status/data/#",
"qos":"2",
"datatype":"auto",
"broker":"e805d722.393a18",
"x":185.71429443359375,
"y":158.57143211364746,
"wires":[
[
"7170bb1e.03683c"
]
]
},
{
"id":"aedc4600.60feb8",
"type":"function",
"z":"39c3dc56.46a1f4",
"name":"Temperaturen",
"func":"var msg1 = [];\nfor (var i = 0; i < 8; i++) {\n\tmsg1.push({ payload: msg.payload.channel[i].temp,\n\tui_control:{\"unit\":\"Hallo\",\"min\":msg.payload.channel[i].min,\"max\":msg.payload.channel[i].max} \n\t \n\t});\n}\nreturn msg1;",
"outputs":8,
"noerr":0,
"x":572.8571395874023,
"y":158.5714569091797,
"wires":[
[
"c0acc038.307288"
],
[
"bf8dc414.7937c8"
],
[
"e354da84.779a58"
],
[
"2b135ab0.ff2fae"
],
[
"8803a280.1db24"
],
[
"f4fbfbf2.fcf47"
],
[
"aaa42d08.22cf4"
],
[
"2c4f3d30.ba5392"
]
],
"outputLabels":[
"Kanal 1",
"",
"",
"",
"",
"",
"",
""
]
},
{
"id":"7170bb1e.03683c",
"type":"json",
"z":"39c3dc56.46a1f4",
"name":"",
"property":"payload",
"action":"obj",
"pretty":false,
"x":420.00001525878906,
"y":158.5714340209961,
"wires":[
[
"aedc4600.60feb8"
]
]
},
{
"id":"c0acc038.307288",
"type":"ui_gauge",
"z":"39c3dc56.46a1f4",
"name":"",
"group":"4485437e.211fdc",
"order":1,
"width":"4",
"height":"4",
"gtype":"gage",
"title":"Kanal 1",
"label":"units",
"format":"{{value}}",
"min":0,
"max":10,
"colors":[
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1":"",
"seg2":"",
"x":801.4285583496094,
"y":44.28571319580078,
"wires":[
]
},
{
"id":"bf8dc414.7937c8",
"type":"ui_gauge",
"z":"39c3dc56.46a1f4",
"name":"",
"group":"4485437e.211fdc",
"order":0,
"width":"4",
"height":"4",
"gtype":"gage",
"title":"Kanal 2",
"label":"units",
"format":"{{value}}",
"min":0,
"max":10,
"colors":[
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1":"",
"seg2":"",
"x":801.4285507202148,
"y":76.28571128845215,
"wires":[
]
},
{
"id":"e354da84.779a58",
"type":"ui_gauge",
"z":"39c3dc56.46a1f4",
"name":"",
"group":"4485437e.211fdc",
"order":0,
"width":"4",
"height":"4",
"gtype":"gage",
"title":"Kanal 3",
"label":"units",
"format":"{{value}}",
"min":0,
"max":10,
"colors":[
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1":"",
"seg2":"",
"x":802.0000152587891,
"y":108.8571424484253,
"wires":[
]
},
{
"id":"2b135ab0.ff2fae",
"type":"ui_gauge",
"z":"39c3dc56.46a1f4",
"name":"",
"group":"4485437e.211fdc",
"order":0,
"width":"4",
"height":"4",
"gtype":"gage",
"title":"Kanal 4",
"label":"units",
"format":"{{value}}",
"min":0,
"max":10,
"colors":[
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1":"",
"seg2":"",
"x":802,
"y":141,
"wires":[
]
},
{
"id":"8803a280.1db24",
"type":"ui_gauge",
"z":"39c3dc56.46a1f4",
"name":"",
"group":"4485437e.211fdc",
"order":0,
"width":"4",
"height":"4",
"gtype":"gage",
"title":"Kanal 5",
"label":"units",
"format":"{{value}}",
"min":0,
"max":10,
"colors":[
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1":"",
"seg2":"",
"x":801.8571472167969,
"y":173.99999523162842,
"wires":[
]
},
{
"id":"f4fbfbf2.fcf47",
"type":"ui_gauge",
"z":"39c3dc56.46a1f4",
"name":"",
"group":"4485437e.211fdc",
"order":0,
"width":"4",
"height":"4",
"gtype":"gage",
"title":"Kanal 6",
"label":"units",
"format":"{{value}}",
"min":0,
"max":10,
"colors":[
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1":"",
"seg2":"",
"x":802.1428680419922,
"y":206.5714282989502,
"wires":[
]
},
{
"id":"aaa42d08.22cf4",
"type":"ui_gauge",
"z":"39c3dc56.46a1f4",
"name":"",
"group":"4485437e.211fdc",
"order":0,
"width":"4",
"height":"4",
"gtype":"gage",
"title":"Kanal 7",
"label":"units",
"format":"{{value}}",
"min":0,
"max":10,
"colors":[
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1":"",
"seg2":"",
"x":802.1428527832031,
"y":239.42857360839844,
"wires":[
]
},
{
"id":"2c4f3d30.ba5392",
"type":"ui_gauge",
"z":"39c3dc56.46a1f4",
"name":"",
"group":"4485437e.211fdc",
"order":0,
"width":"4",
"height":"4",
"gtype":"gage",
"title":"Kanal 8",
"label":"units",
"format":"{{value}}",
"min":0,
"max":10,
"colors":[
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1":"",
"seg2":"",
"x":801.5714111328125,
"y":274.8571472167969,
"wires":[
]
},
{
"id":"e805d722.393a18",
"type":"mqtt-broker",
"z":"",
"name":"",
"broker":"localhost",
"port":"1883",
"clientid":"",
"usetls":false,
"compatmode":true,
"keepalive":"60",
"cleansession":true,
"birthTopic":"",
"birthQos":"0",
"birthRetain":"false",
"birthPayload":"",
"closeTopic":"",
"closeQos":"0",
"closeRetain":"false",
"closePayload":"",
"willTopic":"",
"willQos":"0",
"willRetain":"false",
"willPayload":""
},
{
"id":"4485437e.211fdc",
"type":"ui_group",
"z":"",
"name":"Kanal 1",
"tab":"bdf5f613.e3169",
"disp":true,
"width":"20",
"collapse":false
},
{
"id":"bdf5f613.e3169",
"type":"ui_tab",
"z":"",
"name":"Nano",
"icon":"dashboard",
"order":2,
"disabled":false,
"hidden":false
}
]
Wenn du z.B. hinter Payload noch ".channel.number.temp hängst, kannst du dich durchhangeln. Evtl. den Datentyp von String auf JSON umstellen, da bin ich gerade nicht so sicher. Und du musst natürlich noch die Nummer des Kanals mit rein bringen. Da weiß ich gerade nich, ob "1." hinter channel ging. Hab das schonmal hinbekommen.@Steak-Thermo
Vielen Dank erstmal! Mein Problem ist aber, wie ich aus:
{"system":{"time":"1585993384","unit":"C","rssi":-51,"online":2},"channel":[{"number":1,"name":"Grillraum","typ":0,"temp":22.80,"min":80.00,"max":140.00,"alarm":0,"color":"#0C4C88","fixed":false},{"number":2,"name":"Pulled P.","typ":0,"temp":20.60,"min":8.00,"max":95.00,"alarm":0,"color":"#22B14C","fixed":false},{"number":3,"name":"Kanal 3","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#EF562D","fixed":false},{"number":4,"name":"Kanal 4","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#FFC100","fixed":false},{"number":5,"name":"Kanal 5","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#A349A4","fixed":false},{"number":6,"name":"Kanal 6","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#804000","fixed":false},{"number":7,"name":"Kanal 7","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#5587A2","fixed":false},{"number":8,"name":"Kanal 8","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#5C7148","fixed":false},{"number":9,"name":"Kanal 9","typ":15,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#5C7148","fixed":true},{"number":10,"name":"Kanal 10","typ":15,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#5C7148","fixed":true}],"pitmaster":{"type":["off","manual","auto"],"pm":[{"id":0,"channel":1,"pid":1,"value":100,"set":200.00,"typ":"auto","set_color":"#ff0000","value_color":"#000000"},{"id":1,"channel":2,"pid":1,"value":0,"set":50.00,"typ":"off","set_color":"#FE2EF7","value_color":"#848484"}]}}
Z.B. das: [{"number":1,"name":"Grillraum","typ":0,"temp":22.80,"min
zurück in einen einzlnen "neuen" Datenpunkt in Iobroker bekomme, also nur den Wert 22.8
Rein und raus aus von Iobroker in Node-Red bekome ich schon, nur mit der String-Extrahierung fehlts mir noch....
Google mich da mal Abends durch - nun is schönes Wetter in S-H und es geht raus zum Corona Volkslauf;-)
Importier dir das mal in NodeRed:
][/CODE]
Geht das theoretisch auch anders rum - also schreibend, z.B. PID 1 und 2 Settings?