Increased, decreased by so many times and increased by %?
Hello. I wanna know. Is it possible to make such an operation less cumbersome and does the calculation of a simple mathematical operation not overload the system with such a large number of nodes on the canvas? This is what is intended here: it is necessary to calculate how many times the number has increased (in my case, this is the power received via MQTT) and by how many Watts have increased as a percentage. And also not a decrease. In my example, I make a line and voice it and then send with a delay the number by which the process has increased. Are there nodes that can perform these operations more easily?
[
{
"id": "f6c5664bf804f225",
"type": "inject",
"z": "6c9b4007f41ca018",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "10",
"payloadType": "num",
"x": 150,
"y": 100,
"wires": [
[
"8bf0b6c0d6528259"
]
]
},
{
"id": "c9162684d47bca48",
"type": "inject",
"z": "6c9b4007f41ca018",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "15",
"payloadType": "num",
"x": 150,
"y": 140,
"wires": [
[
"8bf0b6c0d6528259"
]
]
},
{
"id": "825895f6ef919cd6",
"type": "inject",
"z": "6c9b4007f41ca018",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "25",
"payloadType": "num",
"x": 150,
"y": 180,
"wires": [
[
"8bf0b6c0d6528259"
]
]
},
{
"id": "8bf0b6c0d6528259",
"type": "rbe",
"z": "6c9b4007f41ca018",
"name": "Changed by 5%",
"func": "deadbandEq",
"gap": "5",
"start": "",
"inout": "out",
"septopics": false,
"property": "payload",
"topi": "topic",
"x": 360,
"y": 120,
"wires": [
[
"aa2b5c097b8fd7ab",
"7c19125ad551eeb0"
]
]
},
{
"id": "aa2b5c097b8fd7ab",
"type": "join",
"z": "6c9b4007f41ca018",
"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": 570,
"y": 120,
"wires": [
[
"a2aec63b453545fb",
"d31190aca7bcc7f2",
"626f918641e3b57e"
]
]
},
{
"id": "7c19125ad551eeb0",
"type": "debug",
"z": "6c9b4007f41ca018",
"name": "4",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 370,
"y": 180,
"wires": []
},
{
"id": "a2aec63b453545fb",
"type": "debug",
"z": "6c9b4007f41ca018",
"name": "9",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 180,
"wires": []
},
{
"id": "d31190aca7bcc7f2",
"type": "change",
"z": "6c9b4007f41ca018",
"name": "denominator ",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload[\"1\"]",
"tot": "msg"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "denominator",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 450,
"y": 320,
"wires": [
[
"00f50541a0866eae",
"427a6148b413d8f1"
]
]
},
{
"id": "28c4846914fd04fe",
"type": "debug",
"z": "6c9b4007f41ca018",
"name": "9",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 470,
"y": 240,
"wires": []
},
{
"id": "00f50541a0866eae",
"type": "debug",
"z": "6c9b4007f41ca018",
"name": "10",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 470,
"y": 360,
"wires": []
},
{
"id": "626f918641e3b57e",
"type": "change",
"z": "6c9b4007f41ca018",
"name": "numerator ",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload[\"0\"]",
"tot": "msg"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "numerator",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 450,
"y": 280,
"wires": [
[
"28c4846914fd04fe",
"427a6148b413d8f1",
"ad74af1a74c82a98"
]
]
},
{
"id": "ad36eb810efe21dd",
"type": "debug",
"z": "6c9b4007f41ca018",
"name": "9,0",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 690,
"y": 260,
"wires": []
},
{
"id": "427a6148b413d8f1",
"type": "join",
"z": "6c9b4007f41ca018",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "2",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 670,
"y": 300,
"wires": [
[
"ad36eb810efe21dd",
"c36de9c230a9e4b5",
"15fd40a946206d74"
]
]
},
{
"id": "b39ce9cb61ba0489",
"type": "inject",
"z": "6c9b4007f41ca018",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "300",
"payloadType": "num",
"x": 150,
"y": 220,
"wires": [
[
"8bf0b6c0d6528259"
]
]
},
{
"id": "2d2f334c54acb2a1",
"type": "ui_audio",
"z": "6c9b4007f41ca018",
"name": "",
"group": "16a1f12d.07c69f",
"voice": "Microsoft Pavel - Russian (Russia)",
"always": false,
"x": 1480,
"y": 820,
"wires": []
},
{
"id": "96221b165c72b90b",
"type": "ui_audio",
"z": "6c9b4007f41ca018",
"name": "",
"group": "16a1f12d.07c69f",
"voice": "Microsoft Pavel - Russian (Russia)",
"always": false,
"x": 1380,
"y": 560,
"wires": []
},
{
"id": "4629f89f67f035e5",
"type": "group",
"z": "6c9b4007f41ca018",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
"fill": "none",
"fill-opacity": "1",
"label": true,
"label-position": "nw",
"color": "#a4a4a4"
},
"nodes": [
"0bb63caf1c29f528",
"c36de9c230a9e4b5",
"86165490c9ea1910",
"41debc897f0bd0d0",
"b5874f06c9286020",
"fa890359c9829af1",
"55b60e30fd80988b",
"636575024e17b48a",
"9368961e122b033e"
],
"x": 294,
"y": 439,
"w": 972,
"h": 162
},
{
"id": "0bb63caf1c29f528",
"type": "change",
"z": "6c9b4007f41ca018",
"g": "4629f89f67f035e5",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "increased so much",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 970,
"y": 560,
"wires": [
[
"41debc897f0bd0d0",
"96221b165c72b90b"
]
]
},
{
"id": "c36de9c230a9e4b5",
"type": "change",
"z": "6c9b4007f41ca018",
"g": "4629f89f67f035e5",
"name": "copy num' and den' to array",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "[payload.denominator, payload.numerator]",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 440,
"y": 560,
"wires": [
[
"86165490c9ea1910",
"9368961e122b033e"
]
]
},
{
"id": "86165490c9ea1910",
"type": "calculator",
"z": "6c9b4007f41ca018",
"g": "4629f89f67f035e5",
"name": "",
"inputMsgField": "payload",
"outputMsgField": "payload",
"operation": "div",
"constant": "",
"round": true,
"decimals": "2",
"x": 630,
"y": 560,
"wires": [
[
"b5874f06c9286020",
"fa890359c9829af1",
"636575024e17b48a",
"a4c0cc5a542d24c9"
]
]
},
{
"id": "41debc897f0bd0d0",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "4629f89f67f035e5",
"name": "1",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1170,
"y": 500,
"wires": []
},
{
"id": "b5874f06c9286020",
"type": "_throttle",
"z": "6c9b4007f41ca018",
"g": "4629f89f67f035e5",
"name": "",
"nbWaitUnits": "1",
"waitUnits": "seconds",
"leading": true,
"trailing": true,
"x": 1000,
"y": 520,
"wires": [
[
"96221b165c72b90b"
]
]
},
{
"id": "fa890359c9829af1",
"type": "switch",
"z": "6c9b4007f41ca018",
"g": "4629f89f67f035e5",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "gt",
"v": "0.01",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 770,
"y": 560,
"wires": [
[
"0bb63caf1c29f528",
"55b60e30fd80988b"
]
]
},
{
"id": "55b60e30fd80988b",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "4629f89f67f035e5",
"name": "1",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 930,
"y": 480,
"wires": []
},
{
"id": "636575024e17b48a",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "4629f89f67f035e5",
"name": "1",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 500,
"wires": []
},
{
"id": "9368961e122b033e",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "4629f89f67f035e5",
"name": "1",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 570,
"y": 520,
"wires": []
},
{
"id": "90667bcdc57ff4bb",
"type": "group",
"z": "6c9b4007f41ca018",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
"fill": "none",
"fill-opacity": "1",
"label": true,
"label-position": "nw",
"color": "#a4a4a4"
},
"nodes": [
"5538190912811994",
"9ef2e17d61795dc7",
"e42a509ae54afa88",
"a21cf63d11cc72bf",
"aa497b7f624930f6",
"c26e5bc7eb8e1295",
"ad74af1a74c82a98",
"a4c0cc5a542d24c9",
"fa2f7f0e25454605",
"f0f22268e0d76376",
"89889aff9e7e7a8a"
],
"x": 234,
"y": 679,
"w": 1152,
"h": 242
},
{
"id": "5538190912811994",
"type": "calculator",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "",
"inputMsgField": "payload",
"outputMsgField": "payload",
"operation": "mult",
"constant": "100",
"round": true,
"decimals": "2",
"x": 580,
"y": 760,
"wires": [
[
"a21cf63d11cc72bf",
"ad74af1a74c82a98"
]
]
},
{
"id": "9ef2e17d61795dc7",
"type": "calculator",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "",
"inputMsgField": "payload",
"outputMsgField": "payload",
"operation": "div",
"constant": "",
"round": true,
"decimals": "2",
"x": 1050,
"y": 820,
"wires": [
[
"c26e5bc7eb8e1295",
"f0f22268e0d76376",
"89889aff9e7e7a8a"
]
]
},
{
"id": "e42a509ae54afa88",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "1",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 930,
"y": 720,
"wires": []
},
{
"id": "a21cf63d11cc72bf",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "1",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 570,
"y": 820,
"wires": []
},
{
"id": "aa497b7f624930f6",
"type": "change",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "copy num' and den' to array",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "[payload.denominator, payload.numerator]",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 840,
"y": 820,
"wires": [
[
"9ef2e17d61795dc7"
]
]
},
{
"id": "c26e5bc7eb8e1295",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1210,
"y": 760,
"wires": []
},
{
"id": "ad74af1a74c82a98",
"type": "join",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "2",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 770,
"y": 760,
"wires": [
[
"e42a509ae54afa88",
"aa497b7f624930f6"
]
]
},
{
"id": "a4c0cc5a542d24c9",
"type": "change",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "",
"rules": [
{
"t": "change",
"p": "topic",
"pt": "msg",
"from": "numerator",
"fromt": "str",
"to": "denominator",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 360,
"y": 760,
"wires": [
[
"5538190912811994",
"fa2f7f0e25454605"
]
]
},
{
"id": "fa2f7f0e25454605",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "1",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 570,
"y": 720,
"wires": []
},
{
"id": "f0f22268e0d76376",
"type": "change",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "increased by",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1250,
"y": 820,
"wires": [
[
"2d2f334c54acb2a1"
]
]
},
{
"id": "89889aff9e7e7a8a",
"type": "_throttle",
"z": "6c9b4007f41ca018",
"g": "90667bcdc57ff4bb",
"name": "",
"nbWaitUnits": "1",
"waitUnits": "seconds",
"leading": true,
"trailing": true,
"x": 1200,
"y": 880,
"wires": [
[
"2d2f334c54acb2a1"
]
]
},
{
"id": "f62cf7b02ab7855d",
"type": "group",
"z": "6c9b4007f41ca018",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
"fill": "none",
"fill-opacity": "1",
"label": true,
"label-position": "nw",
"color": "#a4a4a4"
},
"nodes": [
"15fd40a946206d74",
"9adf3d13ea901e12",
"d3041030b1bbfcf1",
"f07de54e7efb4e49",
"71ec49f1121ae5da",
"1ae7b4ba7502f0de",
"6643ce54b7cf3952",
"a05d0caa96043ff5",
"fc6b96b128e45247",
"a097913c05e1da3f"
],
"x": 1074,
"y": 119,
"w": 972,
"h": 162
},
{
"id": "15fd40a946206d74",
"type": "change",
"z": "6c9b4007f41ca018",
"g": "f62cf7b02ab7855d",
"name": "copy num' and den' to array",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "[payload.numerator, payload.denominator]",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1220,
"y": 160,
"wires": [
[
"9adf3d13ea901e12",
"fc6b96b128e45247"
]
]
},
{
"id": "9adf3d13ea901e12",
"type": "calculator",
"z": "6c9b4007f41ca018",
"g": "f62cf7b02ab7855d",
"name": "",
"inputMsgField": "payload",
"outputMsgField": "payload",
"operation": "div",
"constant": "",
"round": true,
"decimals": "2",
"x": 1410,
"y": 160,
"wires": [
[
"71ec49f1121ae5da",
"1ae7b4ba7502f0de",
"a05d0caa96043ff5"
]
]
},
{
"id": "d3041030b1bbfcf1",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "f62cf7b02ab7855d",
"name": "2",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1950,
"y": 160,
"wires": []
},
{
"id": "f07de54e7efb4e49",
"type": "change",
"z": "6c9b4007f41ca018",
"g": "f62cf7b02ab7855d",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "decreased by so much",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1750,
"y": 160,
"wires": [
[
"d3041030b1bbfcf1",
"a097913c05e1da3f"
]
]
},
{
"id": "71ec49f1121ae5da",
"type": "_throttle",
"z": "6c9b4007f41ca018",
"g": "f62cf7b02ab7855d",
"name": "",
"nbWaitUnits": "1",
"waitUnits": "seconds",
"leading": true,
"trailing": true,
"x": 1780,
"y": 200,
"wires": [
[
"a097913c05e1da3f"
]
]
},
{
"id": "1ae7b4ba7502f0de",
"type": "switch",
"z": "6c9b4007f41ca018",
"g": "f62cf7b02ab7855d",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "gt",
"v": "0.01",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 1550,
"y": 160,
"wires": [
[
"f07de54e7efb4e49",
"6643ce54b7cf3952"
]
]
},
{
"id": "6643ce54b7cf3952",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "f62cf7b02ab7855d",
"name": "2",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1730,
"y": 240,
"wires": []
},
{
"id": "a05d0caa96043ff5",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "f62cf7b02ab7855d",
"name": "2",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1490,
"y": 220,
"wires": []
},
{
"id": "fc6b96b128e45247",
"type": "debug",
"z": "6c9b4007f41ca018",
"g": "f62cf7b02ab7855d",
"name": "2",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1290,
"y": 220,
"wires": []
},
{
"id": "a097913c05e1da3f",
"type": "ui_audio",
"z": "6c9b4007f41ca018",
"g": "f62cf7b02ab7855d",
"name": "",
"group": "16a1f12d.07c69f",
"voice": "Microsoft Pavel - Russian (Russia)",
"always": false,
"x": 1940,
"y": 220,
"wires": []
},
{
"id": "16a1f12d.07c69f",
"type": "ui_group",
"name": "TEST",
"tab": "f136a522.adc2a8",
"order": 1,
"disp": true,
"width": 15,
"collapse": false,
"className": ""
},
{
"id": "f136a522.adc2a8",
"type": "ui_tab",
"name": "Home",
"icon": "home",
"order": 4
}
]