Bouton à impulsion

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…).

@Fabic quelle est la différence avec la fonctionnalité “clic bouton” qu’on a actuellement ? :slight_smile:

Bonjour @pierre-gilles,

sauf erreur de ma part, le clic bouton ne permet que de lire un état envoyé à Gladys.
L’idée ici est de commander, comme avec la fonctionnalité “Eclairage ON/OFF” mais avec un bouton à impulsion ou bouton poussoir.

Pour essayer d’illustrer, dans une habitation par exemple tu commandes en général les lumières par un (ou 2 interrupteurs) : c’est l’équivalent de la fonctionnalité “Eclairage ON/OFF”.

Cependant quand les commandes dépassent deux interrupteurs on utilise un télérupteur (même si le montage est réalisable en filaire mais beaucoup plus compliqué) commandé par des interrupteurs poussoirs (qui reviennent toujours à leur position). Le télérupteur changera d’état à chaque impulsion, contact ouvert puis fermé (0 puis 1 puis 0 …) qu’il soit commandé avec le 1er interrupteur poussoir ou le énième.

Dans l’application, en appuyant sur le bouton à impulsion on pourrait envoyer à chaque appui le même message via les API (par exemple 1) pour commander ce que l’on veut!

Effectivement my bad tu as raison !

Il manque ce bouton dans l’autre sens :slight_smile:

Pour la représentation j’aurai bien vu un cercle bleu qui passe au blanc 1/2 seconde pendant l’impulsion

C’est un toggle en fait non ?

Je pense qu’il veut juste un push bouton comme on avait fait à l’époque de la v3 avec @piznel et @MathieuA

https://community.gladysassistant.com/t/devicetype-de-type-push-button/2886?u=spenceur

Le bouton revient automatiquement à l’état 0 après un apuis

1 Like

Ah ok je vois ( j’avais pas compris :sweat_smile:)

1 Like

Exactement, soit un toggle qui revient automatiquement à 0 soit un bouton qui revient à sa position.

Aujourd’hui gladys fait ça : https://www.se.com/fr/fr/product/XB4BD21/harmony-xb4-bouton-tournant-manette-ø22-2-pos-fix-noir-1f-vis-étrier/?parent-subcategory-id=89188

Ma proposition : https://www.se.com/fr/fr/product/XB4BA21/harmony-xb4-bouton-poussoir-à-impulsion-ø22-noir-1f-vis-étrier/?parent-subcategory-id=89188

Ouai comme un klaxon :grin:

Tout à fait! Le toggle Gladys actuel c’est le warning

Je ne peux plus voter… mais je plussoies cette demande de fonctionnalité ! :wink: