Hello,
I ve reated a 2 step countdown (with the help of this forum). Means: 1 countdown runs down and at the end it triggers another countdown, which triggers at the end the first one again.
I am using this to control my pump. The pump runs for x-time (first countdown) and stops for x-time (second countdown). Maybe someone can use it.
To start and stop it i am using a switch-dashboard
I am still struggling a bit to complete it.
- I can start the whole countdown-process but cant find an elegant way to stop it. Has someone an idea?
[
{
"id": "3daf5c5af8d6b1d3",
"type": "debug",
"z": "a9ed4fd40ab38e2f",
"name": "Continue with flow",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 4110,
"y": 3520,
"wires": []
},
{
"id": "de9b3c406b1a913d",
"type": "switch",
"z": "a9ed4fd40ab38e2f",
"name": "reached 0?",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "num"
},
{
"t": "else"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 3870,
"y": 3560,
"wires": [
[
"3daf5c5af8d6b1d3",
"81ac4a849519c638"
],
[
"ca5bb44b69c0a099"
]
]
},
{
"id": "ca5bb44b69c0a099",
"type": "debug",
"z": "a9ed4fd40ab38e2f",
"name": "Show count down value",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 4110,
"y": 3600,
"wires": []
},
{
"id": "8317c04cd3ea0f21",
"type": "trigger",
"z": "a9ed4fd40ab38e2f",
"name": "heartbeat",
"op1": "",
"op2": "",
"op1type": "nul",
"op2type": "payl",
"duration": "1",
"extend": false,
"overrideDelay": false,
"units": "s",
"reset": "0",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 3480,
"y": 3560,
"wires": [
[
"827e17c2de5cc00e",
"4ed20e284176d0af"
]
],
"outputLabels": [
"send \"fail\" if not feeded"
]
},
{
"id": "4e0a1a5af22af0a5",
"type": "link out",
"z": "a9ed4fd40ab38e2f",
"name": "link out 5",
"mode": "link",
"links": [
"d4aa79b97717c57b"
],
"x": 3725,
"y": 3660,
"wires": []
},
{
"id": "d4aa79b97717c57b",
"type": "link in",
"z": "a9ed4fd40ab38e2f",
"name": "link in 5",
"links": [
"4e0a1a5af22af0a5"
],
"x": 3465,
"y": 3660,
"wires": [
[
"8317c04cd3ea0f21"
]
]
},
{
"id": "827e17c2de5cc00e",
"type": "change",
"z": "a9ed4fd40ab38e2f",
"name": "payload -1",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload - 1",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 3670,
"y": 3560,
"wires": [
[
"4e0a1a5af22af0a5",
"de9b3c406b1a913d"
]
]
},
{
"id": "81ac4a849519c638",
"type": "function",
"z": "a9ed4fd40ab38e2f",
"name": "set waitTime",
"func": "msg.payload = global.get(\"waitTime\")\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 3270,
"y": 3800,
"wires": [
[
"5a69deb10113265e"
]
]
},
{
"id": "1a797e1430bf8152",
"type": "debug",
"z": "a9ed4fd40ab38e2f",
"name": "Continue with flow",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 4130,
"y": 3780,
"wires": []
},
{
"id": "ab99d24c3cce1555",
"type": "switch",
"z": "a9ed4fd40ab38e2f",
"name": "reached 0?",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "num"
},
{
"t": "else"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 3890,
"y": 3800,
"wires": [
[
"1a797e1430bf8152",
"7d5ceb1b60d0bc62"
],
[
"d853516304c72b7c"
]
]
},
{
"id": "d853516304c72b7c",
"type": "debug",
"z": "a9ed4fd40ab38e2f",
"name": "Show count down value",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 4130,
"y": 3840,
"wires": []
},
{
"id": "5a69deb10113265e",
"type": "trigger",
"z": "a9ed4fd40ab38e2f",
"name": "heartbeat",
"op1": "",
"op2": "",
"op1type": "nul",
"op2type": "payl",
"duration": "1",
"extend": false,
"overrideDelay": false,
"units": "s",
"reset": "0",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 3480,
"y": 3800,
"wires": [
[
"4bb4554c7c972a86"
]
],
"outputLabels": [
"send \"fail\" if not feeded"
]
},
{
"id": "de38aba1c1945392",
"type": "link out",
"z": "a9ed4fd40ab38e2f",
"name": "link out 6",
"mode": "link",
"links": [
"b9bab22747a42069"
],
"x": 3715,
"y": 3920,
"wires": []
},
{
"id": "b9bab22747a42069",
"type": "link in",
"z": "a9ed4fd40ab38e2f",
"name": "link in 6",
"links": [
"de38aba1c1945392"
],
"x": 3425,
"y": 3920,
"wires": [
[
"5a69deb10113265e"
]
]
},
{
"id": "4bb4554c7c972a86",
"type": "change",
"z": "a9ed4fd40ab38e2f",
"name": "payload-1",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload - 1",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 3660,
"y": 3800,
"wires": [
[
"de38aba1c1945392",
"ab99d24c3cce1555"
]
]
},
{
"id": "7d5ceb1b60d0bc62",
"type": "function",
"z": "a9ed4fd40ab38e2f",
"name": "set dosingTime",
"func": "msg.payload = global.get(\"dosingTime\")\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 3260,
"y": 3560,
"wires": [
[
"8317c04cd3ea0f21"
]
]
},
{
"id": "346fe55eb17a8653",
"type": "rbe",
"z": "a9ed4fd40ab38e2f",
"name": "",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"septopics": true,
"property": "payload",
"topi": "topic",
"x": 3170,
"y": 3720,
"wires": [
[
"7d5ceb1b60d0bc62"
]
]
},
{
"id": "4ed20e284176d0af",
"type": "debug",
"z": "a9ed4fd40ab38e2f",
"name": "debug 13",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 3660,
"y": 3500,
"wires": []
},
{
"id": "b253130c6f8cee01",
"type": "group",
"z": "a9ed4fd40ab38e2f",
"name": "Autotimer",
"style": {
"label": true
},
"nodes": [
"b66fbbcb8c41d637",
"b818f41a48b921f4",
"248fb7ef4d723514",
"bcf8d2cc1a27696d",
"534c19b940d37914",
"36d8dcdc7be1bc5c",
"5fade2ffa8740411",
"6f49e1d19bedc2d0",
"24a028056455694e",
"4e37b7047fd44050",
"2e94315d15790424",
"17b6ddf9ce4c964f",
"011c39a44fc33165",
"3493b06c7231ed5d",
"cbdcde0f16615730",
"16cc1b6087639514",
"963d3820ded9ed33",
"df24b9d8d5a91c14",
"a3cdf07ae19762d8"
],
"x": 2134,
"y": 3459,
"w": 972,
"h": 442
},
{
"id": "b66fbbcb8c41d637",
"type": "ui_text",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"group": "4368da8fe6ddbe0c",
"order": 43,
"width": 3,
"height": 1,
"name": "Run for",
"label": "",
"format": "Run for",
"layout": "row-spread",
"className": "",
"style": false,
"font": "",
"fontSize": 16,
"color": "#000000",
"x": 2480,
"y": 3540,
"wires": []
},
{
"id": "b818f41a48b921f4",
"type": "ui_text_input",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "dose",
"label": "",
"tooltip": "",
"group": "4368da8fe6ddbe0c",
"order": 44,
"width": 3,
"height": 1,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "topic",
"sendOnBlur": true,
"className": "",
"topicType": "msg",
"x": 2630,
"y": 3540,
"wires": [
[
"17b6ddf9ce4c964f"
]
]
},
{
"id": "248fb7ef4d723514",
"type": "ui_text",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"group": "4368da8fe6ddbe0c",
"order": 45,
"width": 1,
"height": 1,
"name": "sec_dose",
"label": "",
"format": "sec.",
"layout": "row-left",
"className": "",
"style": false,
"font": "",
"fontSize": 16,
"color": "#000000",
"x": 2780,
"y": 3540,
"wires": []
},
{
"id": "bcf8d2cc1a27696d",
"type": "ui_text",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"group": "4368da8fe6ddbe0c",
"order": 51,
"width": 3,
"height": 1,
"name": "Stop for",
"label": "",
"format": "Stop for",
"layout": "row-left",
"className": "",
"style": false,
"font": "",
"fontSize": 16,
"color": "#000000",
"x": 2480,
"y": 3660,
"wires": []
},
{
"id": "534c19b940d37914",
"type": "ui_text_input",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "wait",
"label": "",
"tooltip": "",
"group": "4368da8fe6ddbe0c",
"order": 52,
"width": 3,
"height": 1,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "topic",
"sendOnBlur": true,
"className": "",
"topicType": "msg",
"x": 2630,
"y": 3660,
"wires": [
[
"cbdcde0f16615730"
]
]
},
{
"id": "36d8dcdc7be1bc5c",
"type": "ui_text",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"group": "4368da8fe6ddbe0c",
"order": 53,
"width": 1,
"height": 1,
"name": "sec_wait",
"label": "",
"format": "sec.",
"layout": "row-left",
"className": "",
"style": false,
"font": "",
"fontSize": 16,
"color": "#000000",
"x": 2780,
"y": 3660,
"wires": []
},
{
"id": "5fade2ffa8740411",
"type": "ui_switch",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"label": "",
"tooltip": "",
"group": "4368da8fe6ddbe0c",
"order": 59,
"width": 1,
"height": 1,
"passthru": true,
"decouple": "false",
"topic": "topic",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 2510,
"y": 3820,
"wires": [
[
"6f49e1d19bedc2d0"
]
]
},
{
"id": "6f49e1d19bedc2d0",
"type": "switch",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "true"
},
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 2670,
"y": 3820,
"wires": [
[
"df24b9d8d5a91c14",
"346fe55eb17a8653"
],
[
"24a028056455694e"
]
]
},
{
"id": "24a028056455694e",
"type": "change",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"rules": [
{
"t": "set",
"p": "timerOnOff",
"pt": "global",
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Deactivated",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 2850,
"y": 3860,
"wires": [
[
"4e37b7047fd44050"
]
]
},
{
"id": "4e37b7047fd44050",
"type": "ui_text",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"group": "4368da8fe6ddbe0c",
"order": 60,
"width": 3,
"height": 1,
"name": "",
"label": "",
"format": "{{msg.payload}}",
"layout": "col-center",
"className": "",
"style": false,
"font": "",
"fontSize": 16,
"color": "#000000",
"x": 3030,
"y": 3820,
"wires": []
},
{
"id": "2e94315d15790424",
"type": "ui_ui_control",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"events": "all",
"x": 2340,
"y": 3820,
"wires": [
[
"a3cdf07ae19762d8"
]
]
},
{
"id": "17b6ddf9ce4c964f",
"type": "change",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"rules": [
{
"t": "set",
"p": "dosingTime",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 2830,
"y": 3500,
"wires": [
[]
]
},
{
"id": "011c39a44fc33165",
"type": "ui_ui_control",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"events": "all",
"x": 2240,
"y": 3540,
"wires": [
[
"3493b06c7231ed5d"
]
]
},
{
"id": "3493b06c7231ed5d",
"type": "change",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "dosingTime",
"tot": "global"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 2470,
"y": 3500,
"wires": [
[
"b818f41a48b921f4"
]
]
},
{
"id": "cbdcde0f16615730",
"type": "change",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"rules": [
{
"t": "set",
"p": "waitTime",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 2800,
"y": 3620,
"wires": [
[]
]
},
{
"id": "16cc1b6087639514",
"type": "ui_ui_control",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"events": "all",
"x": 2220,
"y": 3660,
"wires": [
[
"963d3820ded9ed33"
]
]
},
{
"id": "963d3820ded9ed33",
"type": "change",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "waitTime",
"tot": "global"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 2490,
"y": 3620,
"wires": [
[
"534c19b940d37914"
]
]
},
{
"id": "df24b9d8d5a91c14",
"type": "change",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"rules": [
{
"t": "set",
"p": "timerOnOff",
"pt": "global",
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Activated",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 2850,
"y": 3780,
"wires": [
[
"4e37b7047fd44050"
]
]
},
{
"id": "a3cdf07ae19762d8",
"type": "change",
"z": "a9ed4fd40ab38e2f",
"g": "b253130c6f8cee01",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "timerOnOff",
"tot": "global"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 2350,
"y": 3760,
"wires": [
[
"5fade2ffa8740411"
]
]
},
{
"id": "4368da8fe6ddbe0c",
"type": "ui_group",
"name": "CONTROLPANEL",
"tab": "4ad3c40739cbf998",
"order": 2,
"disp": true,
"width": 15,
"collapse": false,
"className": ""
},
{
"id": "4ad3c40739cbf998",
"type": "ui_tab",
"name": "Pump 1 | Petrosid | TOP",
"icon": "fa-tasks",
"order": 2,
"disabled": false,
"hidden": false
}
]
thank you