[
{
"id": "94220ac1144d4fcb",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "d960b2163cbb35ca",
"type": "inject",
"z": "94220ac1144d4fcb",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "current_value",
"payload": "11",
"payloadType": "num",
"x": 170,
"y": 160,
"wires": [
[
"af617717be62be9e"
]
]
},
{
"id": "3bbc14546fee0417",
"type": "inject",
"z": "94220ac1144d4fcb",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "current_value",
"payload": "7",
"payloadType": "num",
"x": 160,
"y": 110,
"wires": [
[
"af617717be62be9e"
]
]
},
{
"id": "3a370cc26a953786",
"type": "inject",
"z": "94220ac1144d4fcb",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "current_value",
"payload": "4",
"payloadType": "num",
"x": 160,
"y": 220,
"wires": [
[
"af617717be62be9e"
]
]
},
{
"id": "eb423a07871d86f8",
"type": "function",
"z": "94220ac1144d4fcb",
"name": "function 1",
"func": "if(msg.payload.current_value >= 5 && msg.payload.current_value <= 10){\n msg.payload = \"high\"\n} else {\n msg.payload = \"low\"\n}\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 110,
"wires": [
[
"c6465614c70fb548"
]
]
},
{
"id": "c6465614c70fb548",
"type": "debug",
"z": "94220ac1144d4fcb",
"name": "debug 15",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 500,
"y": 170,
"wires": []
},
{
"id": "85879627632084ef",
"type": "function",
"z": "94220ac1144d4fcb",
"name": "function 2",
"func": "var value = msg.payload.current_value;\nif(value >= 5)\n{\nmsg.payload = \"high\";} \nelse if (value <= 10) \n{\nmsg.payload = \"low\";\n}\nelse msg.payload = null;\nmsg.payload = \"test\";\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 370,
"y": 250,
"wires": [
[
"a67704c543b711db"
]
]
},
{
"id": "a67704c543b711db",
"type": "debug",
"z": "94220ac1144d4fcb",
"name": "debug 16",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 500,
"y": 260,
"wires": []
},
{
"id": "3701aa908755686b",
"type": "debug",
"z": "94220ac1144d4fcb",
"name": "debug 17",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 490,
"y": 380,
"wires": []
},
{
"id": "af617717be62be9e",
"type": "function",
"z": "94220ac1144d4fcb",
"name": "function 3",
"func": "if(msg.payload.current_value >= 5 && msg.payload.current_value <= 10){\n msg.payload = 'high'\n} else {\n msg.payload = 'low'\n}\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 380,
"wires": [
[
"3701aa908755686b"
]
]
}
]