Hi, i am new here and i can´t find my fault in a Function node. I want to read out the Temperature and Huminity from a Tasmota DHT11 Client. So i use the Function node to extract the Temperature and Huminity, but it will not work !
I Used also the msg.payload = msg.payload.Temperature; but it returns The Payload is undefined.
I Used a Testflow. The Injectnode sends a Teststring like the MQTT Client.
Is anythin wrong with my Function nodes. Thank you for Support a Newbee.
[
{
"id": "9968598e.b88798",
"type": "tab",
"label": "Flow 3",
"disabled": false,
"info": ""
},
{
"id": "9b8a73f.056939",
"type": "inject",
"z": "9968598e.b88798",
"name": "Simulation DHT11",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"Time\":\"2021-04-06T18:20:04\",\"DHT11\":{\"Temperature\":38.0,\"Humidity\":25.0,\"DewPoint\":14.5},\"TempUnit\":\"C\"}",
"payloadType": "str",
"x": 270,
"y": 80,
"wires": [
[
"bb0529ee.da3168",
"9c81b8e8.db70d8",
"8f7ea74e.328278"
]
]
},
{
"id": "bb0529ee.da3168",
"type": "function",
"z": "9968598e.b88798",
"name": "Temperature Data",
"func": "msg.payload = msg.Temperature;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 830,
"y": 80,
"wires": [
[
"aa4b43c9.b105a"
]
]
},
{
"id": "8f7ea74e.328278",
"type": "function",
"z": "9968598e.b88798",
"name": "Huminity Data",
"func": "msg.payload = msg.Huminity;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 820,
"y": 160,
"wires": [
[
"42f17627.df3c88"
]
]
},
{
"id": "fc6989c3.1f0b78",
"type": "mqtt in",
"z": "9968598e.b88798",
"name": "Temp/Humin DHT11",
"topic": "Gewaechshaus/DHT11_01/SENSOR",
"qos": "0",
"datatype": "auto",
"broker": "798105ff.8a59ac",
"x": 270,
"y": 160,
"wires": [
[
"8f7ea74e.328278",
"9c81b8e8.db70d8",
"bb0529ee.da3168"
]
]
},
{
"id": "aa4b43c9.b105a",
"type": "debug",
"z": "9968598e.b88798",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1090,
"y": 80,
"wires": []
},
{
"id": "42f17627.df3c88",
"type": "debug",
"z": "9968598e.b88798",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1090,
"y": 160,
"wires": []
},
{
"id": "9c81b8e8.db70d8",
"type": "debug",
"z": "9968598e.b88798",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 270,
"y": 120,
"wires": []
},
{
"id": "798105ff.8a59ac",
"type": "mqtt-broker",
"name": "MQTT Broker",
"broker": "192.168.120.220",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
}
]