Hello.
Im trying to compare a value which is entered into the text field to the one that was put in before, failing hard to make it work. Instead of getting the result of Delta i get a ever longer getting string of nonsense, please help
Node-RED version: v2.2.2
Node.js version: v18.0.0
Windows_NT 10.0.19044 x64 LE
Dashboard version 3.1.6
[
{
"id": "3a2688a1cd092798",
"type": "ui_text_input",
"z": "602cc2206a13741f",
"name": "",
"label": "",
"tooltip": "",
"group": "5f36819feb573bce",
"order": 0,
"width": 0,
"height": 0,
"passthru": true,
"mode": "number",
"delay": "0",
"topic": "topic",
"sendOnBlur": false,
"className": "",
"topicType": "msg",
"x": 250,
"y": 260,
"wires": [
[
"bf7937ddf575b2ef",
"a9e4e0f1090131c6",
"9f547a1462a5dafa"
]
]
},
{
"id": "bf7937ddf575b2ef",
"type": "change",
"z": "602cc2206a13741f",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 270,
"y": 300,
"wires": [
[
"3a2688a1cd092798"
]
]
},
{
"id": "8095094f3d91dfa2",
"type": "inject",
"z": "602cc2206a13741f",
"name": "",
"props": [
{
"p": "payload.bf",
"v": "0",
"vt": "num"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"x": 230,
"y": 220,
"wires": [
[
"a62f8009e55a879d"
]
]
},
{
"id": "a62f8009e55a879d",
"type": "function",
"z": "602cc2206a13741f",
"name": "",
"func": "msg.payload = {bf: msg.payload}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 480,
"y": 220,
"wires": [
[
"cdbdc68a34ca4c3f"
]
]
},
{
"id": "a9e4e0f1090131c6",
"type": "function",
"z": "602cc2206a13741f",
"name": "",
"func": "msg.payload = {rn: msg.payload}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 480,
"y": 260,
"wires": [
[
"cdbdc68a34ca4c3f",
"6e05202087d8cfda"
]
]
},
{
"id": "da17e047c6aac9dc",
"type": "function",
"z": "602cc2206a13741f",
"name": "",
"func": "var bf = { payload: msg.payload.bf };\nvar rn = { payload: msg.payload.rn };\nvar delta = rn - bf;\ndelta = { payload: msg.payload.delta};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 920,
"y": 220,
"wires": [
[
"f7ed5c24f10c3da2",
"817cca998a743ce0",
"079a235c91fe0252"
]
]
},
{
"id": "cdbdc68a34ca4c3f",
"type": "join",
"z": "602cc2206a13741f",
"name": "",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "2",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 690,
"y": 220,
"wires": [
[
"da17e047c6aac9dc",
"ebb69e2f63316bf3"
]
]
},
{
"id": "f7ed5c24f10c3da2",
"type": "function",
"z": "602cc2206a13741f",
"name": "",
"func": "msg.payload.bf = msg.payload.rn;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1200,
"y": 200,
"wires": [
[
"a62f8009e55a879d"
]
]
},
{
"id": "817cca998a743ce0",
"type": "ui_text",
"z": "602cc2206a13741f",
"group": "5f36819feb573bce",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "Δ",
"format": "{{msg.payload.delta}}",
"layout": "row-spread",
"className": "",
"x": 1190,
"y": 240,
"wires": []
},
{
"id": "6e05202087d8cfda",
"type": "debug",
"z": "602cc2206a13741f",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 710,
"y": 260,
"wires": []
},
{
"id": "ebb69e2f63316bf3",
"type": "debug",
"z": "602cc2206a13741f",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 930,
"y": 260,
"wires": []
},
{
"id": "9f547a1462a5dafa",
"type": "debug",
"z": "602cc2206a13741f",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 490,
"y": 300,
"wires": []
},
{
"id": "079a235c91fe0252",
"type": "file",
"z": "602cc2206a13741f",
"name": "Temp.txt",
"filename": "C:\\Users\\m.bosshart\\Documents\\Temp.txt",
"appendNewline": true,
"createDir": false,
"overwriteFile": "false",
"encoding": "none",
"x": 1200,
"y": 280,
"wires": [
[]
]
},
{
"id": "5f36819feb573bce",
"type": "ui_group",
"name": "Delta",
"tab": "dbf999e51b777958",
"order": 8,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "dbf999e51b777958",
"type": "ui_tab",
"name": "Demo",
"icon": "dashboard",
"order": 1,
"disabled": false,
"hidden": false
}
]