Hi,
My Node-red has a very strange behavior, and I would like to know if it's the case only for me or if someone else encounter this.
I use a slider to simulate a drift on a given value. For the purpose of the exemple, I fixed the value to 80 and reduced the problem to a very simple code.
If the slider is moved to a value inferior of 80, the function increase the entrant value of 5%, then reinject it to the slider. It goes trough it and the process loops until it reach 80.
However, when I move this value at 45 for instance, the correction does not apply. But with 50, it works.
I don't understand why...
Here is the code :
[
{
"id": "45e21b720a5859ad",
"type": "tab",
"label": "Flow 3",
"disabled": false,
"info": "",
"env": []
},
{
"id": "0005d4001c69b0ed",
"type": "function",
"z": "45e21b720a5859ad",
"name": "drift compensation",
"func": "var newDrift = { payload: msg.payload };\n\nif (msg.payload < 80){\n newDrift.payload *= 1.05;\n}\n\nreturn newDrift;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1350,
"y": 1100,
"wires": [
[
"cc8a7360ddef5c2f"
]
]
},
{
"id": "cc8a7360ddef5c2f",
"type": "ui_slider",
"z": "45e21b720a5859ad",
"name": "",
"label": "driftSimulation",
"tooltip": "",
"group": "7f6d97ae5791cb88",
"order": 4,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "topic",
"topicType": "msg",
"min": "0",
"max": "100",
"step": "5",
"className": "",
"x": 1020,
"y": 1100,
"wires": [
[
"0005d4001c69b0ed"
]
]
},
{
"id": "7f6d97ae5791cb88",
"type": "ui_group",
"name": "test",
"tab": "cc75e59fad33e7d0",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "cc75e59fad33e7d0",
"type": "ui_tab",
"name": "Test",
"icon": "dashboard",
"order": 5,
"disabled": false,
"hidden": false
}
]
Thank you in advance