I propose adding a push button in the Device features.
For example, one of the first devices we want to control is the electric roller shutter(s).
One possibility is to use the features proposed here: Gestion des volets roulants - #13 par syper
Another possibility is to use only a push button (always the same message) that allows you to raise, stop or lower the shutter. Of course, behind it, you need to manage the command with a program.
Here is an example under node-red (not tested in real life and surely to be simplified and improved):
[
{
"id": "f7c7dff4.84a878",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "d9c64d70.401e88",
"type": "toggle",
"z": "f7c7dff4.84a878",
"name": "",
"onOffTopic": "",
"onValue": "Raise",
"onType": "str",
"offValue": "Lower",
"offType": "str",
"toggleTopic": "",
"toggleValue": "",
"toggleType": "any",
"passOnOff": "ifChanged",
"x": 710,
"y": 620,
"wires": [
[
"78be339b.b82cd4"
]
]
},
{
"id": "7e57fa0e.b124ac",
"type": "gate",
"z": "f7c7dff4.84a878",
"name": "Gate1",
"controlTopic": "control",
"defaultState": "open",
"openCmd": "open",
"closeCmd": "close",
"toggleCmd": "toggle",
"defaultCmd": "default",
"statusCmd": "status",
"persist": false,
"x": 410,
"y": 620,
"wires": [
[
"d9c64d70.401e88",
"59dd700a.af8a48"
]
]
},
{
"id": "9e19b878.d70778",
"type": "inject",
"z": "f7c7dff4.84a878",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "1",
"payloadType": "num",
"x": 120,
"y": 620,
"wires": [
[
"7e57fa0e.b124ac",
"d88405a7.90e3d",
"150843d.3e3c5bc"
]
]
},
{
"id": "59dd700a.af8a48",
"type": "change",
"z": "f7c7dff4.84a878",
"name": "Close Gate1",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "close",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 410,
"y": 700,
"wires": [
[
"7e57fa0e.b124ac"
]
]
},
{
"id": "eb39983c.de23b",
"type": "delay",
"z": "f7c7dff4.84a878",
"name": "Delay-Raise",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 380,
"y": 340,
"wires": [
[
"28a95477.a4e2e4",
"4c732a2e.09a63c",
"6279ad34.e5249c"
]
]
},
{
"id": "28a95477.a4e2e4",
"type": "change",
"z": "f7c7dff4.84a878",
"name": "Open Gate1",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "open",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 810,
"y": 380,
"wires": [
[
"7e57fa0e.b124ac"
]
]
},
{
"id": "78be339b.b82cd4",
"type": "switch",
"z": "f7c7dff4.84a878",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Raise",
"vt": "str"
},
{
"t": "eq",
"v": "Lower",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 830,
"y": 620,
"wires": [
[
"eb39983c.de23b",
"56c08aac.df5f54"
],
[
"9d214b72.543dd8",
"d7d4fc60.b18198"
]
]
},
{
"id": "9d214b72.543dd8",
"type": "delay",
"z": "f7c7dff4.84a878",
"name": "Delay-Lower",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 390,
"y": 500,
"wires": [
[
"28a95477.a4e2e4",
"4c732a2e.09a63c",
"6279ad34.e5249c"
]
]
},
{
"id": "3da4444c.f68c74",
"type": "pi-gpiod out",
"z": "f7c7dff4.84a878",
"name": "Cmd-Lower",
"host": "localhost",
"port": 8888,
"pin": "17",
"set": true,
"level": "0",
"out": "out",
"sermin": "1000",
"sermax": "2000",
"freq": "800",
"x": 1320,
"y": 720,
"wires": []
},
{
"id": "96fd20cc.c28ee8",
"type": "pi-gpiod out",
"z": "f7c7dff4.84a878",
"name": "Cmd-Raise",
"host": "localhost",
"port": 8888,
"pin": "18",
"set": true,
"level": "0",
"out": "out",
"sermin": "1000",
"sermax": "2000",
"freq": "800",
"x": 1270,
"y": 500,
"wires": []
},
{
"id": "4c732a2e.09a63c",
"type": "change",
"z": "f7c7dff4.84a878",
"name": "Reset cmd Raise and Lower",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 320,
"wires": [
[
"96fd20cc.c28ee8",
"3da4444c.f68c74",
"7d3de0e.ac55ea",
"957cfc2a.95f948"
]
]
},
{
"id": "d7d4fc60.b18198",
"type": "change",
"z": "f7c7dff4.84a878",
"name": "Cmd Lower",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "1",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1000,
"y": 680,
"wires": [
[
"3da4444c.f68c74",
"957cfc2a.95f948"
]
]
},
{
"id": "56c08aac.df5f54",
"type": "change",
"z": "f7c7dff4.84a878",
"name": "Cmd Raise",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "1",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 990,
"y": 560,
"wires": [
[
"96fd20cc.c28ee8",
"7d3de0e.ac55ea"
]
]
},
{
"id": "150843d.3e3c5bc",
"type": "gate",
"z": "f7c7dff4.84a878",
"name": "Gate2",
"controlTopic": "control",
"defaultState": "closed",
"openCmd": "open",
"closeCmd": "close",
"toggleCmd": "toggle",
"defaultCmd": "default",
"statusCmd": "status",
"persist": false,
"x": 470,
"y": 840,
"wires": [
[
"4c732a2e.09a63c",
"28a95477.a4e2e4",
"6279ad34.e5249c",
"dc5b447a.5abbb8"
]
]
},
{
"id": "d88405a7.90e3d",
"type": "change",
"z": "f7c7dff4.84a878",
"name": "Open Gate2",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "open",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 210,
"y": 840,
"wires": [
[
"150843d.3e3c5bc"
]
]
},
{
"id": "6279ad34.e5249c",
"type": "change",
"z": "f7c7dff4.84a878",
"name": "Close Gate2",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "close",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 810,
"y": 460,
"wires": [
[
"150843d.3e3c5bc"
]
]
},
{
"id": "7d3de0e.ac55ea",
"type": "debug",
"z": "f7c7dff4.84a878",
"name": "order raise",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1180,
"y": 360,
"wires": []
},
{
"id": "957cfc2a.95f948",
"type": "debug",
"z": "f7c7dff4.84a878",
"name": "Order lower",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1190,
"y": 800,
"wires": []
},
{
"id": "dc5b447a.5abbb8",
"type": "change",
"z": "f7c7dff4.84a878",
"name": "Reset Delay",
"rules": [
{
"t": "set",
"p": "reset",
"pt": "msg",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 140,
"y": 440,
"wires": [
[
"eb39983c.de23b",
"9d214b72.543dd8"
]
]
}
]
What’s cool about a push button is that you can control whatever you want (a motor, a latching function, a reset, program it in short or long press, double click…).

