Thank you.
Now I understand what is happening.
The dps values send by your Tuya smart plug are changing.
and more specifically the table for Tuya v3.3 DPs, although I do not know, if your device is a v3.3.
You see that DP ID 19 is the Power and DP ID 20 is the Voltage.
So in your message from 13:08:53 only dps: 20 has been sent. This means only the Voltage, which is 230.7 V (the value divided by 10) is available.
But this message triggers the next (Function) node and the missing Power DP 19 is interpreted as NaN and that is send by MQTT (or HTTP, if you wish) to Domoticz. Honestly, I missed it in the table Tuya v3.3. It is stated:
This is just a matter of testing, that DPS ID 19 exist.
Code: Select all
[
{
"id": "2bad7d3ed48f0d62",
"type": "function",
"z": "34725c4ec27d40dd",
"name": "",
"func": "msg.payload = { \"command\": \"udevice\", \"idx\": 2370, \"nvalue\" : 0, \"svalue\": (msg.payload.dps[\"19\"]/10).toString() + \";0\"};\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 640,
"y": 640,
"wires": [
[
"ec99d917d0de1c21"
]
]
},
{
"id": "40a56f7737cf61c6",
"type": "inject",
"z": "34725c4ec27d40dd",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "300",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "Koelkast",
"payload": "{\"dps\":{\"1\":true,\"9\":0,\"18\":484,\"19\":921,\"20\":2307,\"21\":1,\"22\":558,\"23\":28166,\"24\":15267,\"25\":1364}}",
"payloadType": "json",
"x": 310,
"y": 640,
"wires": [
[
"251d272b34e2c618"
]
]
},
{
"id": "ef81bdf4c52e2c55",
"type": "debug",
"z": "34725c4ec27d40dd",
"name": "debug 9",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 640,
"y": 580,
"wires": []
},
{
"id": "ec99d917d0de1c21",
"type": "mqtt out",
"z": "34725c4ec27d40dd",
"name": "To Domoticz",
"topic": "domoticz/in",
"qos": "0",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "175c3dc01f359e9d",
"x": 830,
"y": 640,
"wires": []
},
{
"id": "4259c8d387b3011b",
"type": "debug",
"z": "34725c4ec27d40dd",
"name": "debug 10",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 820,
"y": 580,
"wires": []
},
{
"id": "251d272b34e2c618",
"type": "switch",
"z": "34725c4ec27d40dd",
"name": "",
"property": "payload.dps",
"propertyType": "msg",
"rules": [
{
"t": "hask",
"v": "19",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 470,
"y": 640,
"wires": [
[
"2bad7d3ed48f0d62"
]
]
},
{
"id": "7dd5c38a2a3bfd57",
"type": "debug",
"z": "34725c4ec27d40dd",
"name": "debug 13",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 460,
"y": 580,
"wires": []
},
{
"id": "175c3dc01f359e9d",
"type": "mqtt-broker",
"name": "Raspberry Pi 1B",
"broker": "192.168.10.51",
"port": 1883,
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": 4,
"keepalive": 60,
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]
Replace the Inject node with the Tuya node and use your own MQTT settings.
Let me know.