Je propose d’ajouter un bouton à impulsion dans les fonctionnalités des Appareils.
Par exemple, un des premiers équipement que l’on souhaite contrôler est le ou les volets roulants électriques.
Une des possibilités est d’utiliser les fonctionnalités proposées ici : Gestion des volets roulants - #13 par syper
Une autre possibilité est d’utiliser uniquement un bouton à impulsion (toujours le même message) qui permet de monter, de stopper ou de descendre le volet. Derrière bien sûr il faut gérer la commande par un programme.
Voici un exemple sous node-red (non testé en réel et sûrement à simplifier et améliorer) :
[{"id":"f7c7dff4.84a878","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"d9c64d70.401e88","type":"toggle","z":"f7c7dff4.84a878","name":"","onOffTopic":"","onValue":"Monter","onType":"str","offValue":"Descendre","offType":"str","toggleTopic":"","toggleValue":"","toggleType":"any","passOnOff":"ifChanged","x":710,"y":620,"wires":[["78be339b.b82cd4"]]},{"id":"7e57fa0e.b124ac","type":"gate","z":"f7c7dff4.84a878","name":"Porte1","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":"Fermeture porte1","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":"Delais-Monter","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":"Ouverture porte1 ","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":"Monter","vt":"str"},{"t":"eq","v":"Descendre","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":"Delais-Descendre","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-Descendre","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-Monter","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":"RAZ cmd Monter et Descendre","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 Descendre","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 Monter","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":"Porte2","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":"Ouverture porte2","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":"Fermeture porte2","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":"ordre monter","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":"Ordre descendre","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 Delais","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"]]}]
Ce qui est cool avec un bouton à impulsion c’est qu’on peut commander ce qu’on veut (un moteur, une fonction télérupteur, une RAZ, le programmer en appui court ou long, double clic…).