Hi,
you want to extract a single temp value ?
// if you want a single value. example at position 2
msg.payload = msg.payload.channel[2].temp;
return msg;
Flow example with other cases of extracting values
jsonata expression comes in handy if you want to filter out all the temp values
[
{
"id": "a8f6b829.ca2e1",
"type": "inject",
"z": "d0285368.3cfd98",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"system\":{\"time\":\"1597405052\",\"unit\":\"C\",\"rssi\":-69,\"online\":2},\"channel\":[{\"number\":1,\"name\":\"Kanal 1\",\"typ\":0,\"temp\":999,\"min\":10,\"max\":35,\"alarm\":1,\"color\":\"#00FF00\",\"fixed\":false,\"connected\":false},{\"number\":2,\"name\":\"Kanal 2\",\"typ\":0,\"temp\":999,\"min\":10,\"max\":35,\"alarm\":0,\"color\":\"#22B14C\",\"fixed\":false,\"connected\":false},{\"number\":3,\"name\":\"Kanal 3\",\"typ\":3,\"temp\":25.8,\"min\":10,\"max\":35,\"alarm\":2,\"color\":\"#EF562D\",\"fixed\":false,\"connected\":false},{\"number\":4,\"name\":\"Kanal 4\",\"typ\":0,\"temp\":999,\"min\":10,\"max\":35,\"alarm\":0,\"color\":\"#FFC100\",\"fixed\":false,\"connected\":false},{\"number\":5,\"name\":\"Kanal 5\",\"typ\":0,\"temp\":999,\"min\":10,\"max\":35,\"alarm\":0,\"color\":\"#A349A4\",\"fixed\":false,\"connected\":false},{\"number\":6,\"name\":\"Kanal 6\",\"typ\":0,\"temp\":999,\"min\":10,\"max\":35,\"alarm\":0,\"color\":\"#804000\",\"fixed\":false,\"connected\":false},{\"number\":7,\"name\":\"Kanal 7\",\"typ\":0,\"temp\":999,\"min\":10,\"max\":35,\"alarm\":0,\"color\":\"#5587A2\",\"fixed\":false,\"connected\":false},{\"number\":8,\"name\":\"Kanal 8\",\"typ\":0,\"temp\":999,\"min\":10,\"max\":35,\"alarm\":0,\"color\":\"#5C7148\",\"fixed\":false,\"connected\":false},{\"number\":9,\"name\":\"Kanal 9\",\"typ\":17,\"temp\":999,\"min\":10,\"max\":35,\"alarm\":0,\"color\":\"#5C7148\",\"fixed\":true,\"connected\":false},{\"number\":10,\"name\":\"Kanal 10\",\"typ\":17,\"temp\":999,\"min\":10,\"max\":35,\"alarm\":0,\"color\":\"#5C7148\",\"fixed\":true,\"connected\":false}],\"pitmaster\":{\"type\":[\"off\",\"manual\",\"auto\"],\"pm\":[{\"id\":0,\"channel\":1,\"pid\":1,\"value\":0,\"set\":135,\"typ\":\"off\",\"set_color\":\"#ff0000\",\"value_color\":\"#000000\"},{\"id\":1,\"channel\":2,\"pid\":1,\"value\":0,\"set\":50,\"typ\":\"off\",\"set_color\":\"#FE2EF7\",\"value_color\":\"#848484\"}]}}",
"payloadType": "json",
"x": 310,
"y": 280,
"wires": [
[
"1339e6b1.e88f01",
"7de71d5e.e98e0c",
"250092f2.c13b5e"
]
]
},
{
"id": "1339e6b1.e88f01",
"type": "function",
"z": "d0285368.3cfd98",
"name": "",
"func": "// if you want a single value. example at position 2\nmsg.payload = msg.payload.channel[2].temp;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 580,
"y": 280,
"wires": [
[
"4614741.9c0ba0c"
]
]
},
{
"id": "7de71d5e.e98e0c",
"type": "debug",
"z": "d0285368.3cfd98",
"name": "original payload",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 510,
"y": 220,
"wires": []
},
{
"id": "4614741.9c0ba0c",
"type": "debug",
"z": "d0285368.3cfd98",
"name": "single value",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 860,
"y": 280,
"wires": []
},
{
"id": "250092f2.c13b5e",
"type": "change",
"z": "d0285368.3cfd98",
"name": "use of jsonata",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.channel.temp",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 590,
"y": 380,
"wires": [
[
"a40cc6c7.a224f8"
]
]
},
{
"id": "a40cc6c7.a224f8",
"type": "debug",
"z": "d0285368.3cfd98",
"name": "all Temp in array",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 890,
"y": 380,
"wires": []
}
]