Another contribution for people who like to have a "confrim" button

(Foreign node: node-red-contrib-ui-led) only for indication of successful action.)

I've played with Double press buttons to stop me accidnetally pressing a button.
(And there are other people who have also done the same.)

This is ANOTHER try at the problem of getting button press happy and maybe doing something you didn't want to.

This method requires you to TYPE something also - in a given time.

Edit the switch node to change what has to be typed, and you can edit the trigger node to change how long you have to type it.

[{"id":"55791e66945254eb","type":"ui_button","z":"65c9b63cb09879a0","name":"","group":"c3301b0b86e1c81c","order":1,"width":"2","height":"1","passthru":false,"label":"EN","tooltip":"","color":"","bgcolor":"{{msg.colour}}","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":180,"y":4250,"wires":[["4cfee88751e1b2aa"]]},{"id":"43c327bde938f96d","type":"change","z":"65c9b63cb09879a0","name":"","rules":[{"t":"set","p":"colour","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":385,"y":4180,"wires":[["55791e66945254eb"]],"l":false},{"id":"2405eaede476f00a","type":"change","z":"65c9b63cb09879a0","name":"","rules":[{"t":"set","p":"colour","pt":"msg","to":"brown","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":385,"y":4310,"wires":[["55791e66945254eb"]],"l":false},{"id":"4cfee88751e1b2aa","type":"trigger","z":"65c9b63cb09879a0","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":265,"y":4250,"wires":[["05cf4f71772938c4"]],"l":false},{"id":"05cf4f71772938c4","type":"switch","z":"65c9b63cb09879a0","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":315,"y":4250,"wires":[["43c327bde938f96d","1fbd59e21d45ec4a"],["b0779c7579bd8d5a","2405eaede476f00a"]],"l":false},{"id":"1eefcb2790ed8d88","type":"inject","z":"65c9b63cb09879a0","name":"Disabled","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.5","topic":"","payloadType":"date","x":220,"y":4310,"wires":[["2405eaede476f00a","b0779c7579bd8d5a"]]},{"id":"1fbd59e21d45ec4a","type":"change","z":"65c9b63cb09879a0","name":"","rules":[{"t":"set","p":"enabled","pt":"msg","to":"true","tot":"bool"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":385,"y":4220,"wires":[["ee01dcb12640b036"]],"l":false},{"id":"b0779c7579bd8d5a","type":"change","z":"65c9b63cb09879a0","name":"","rules":[{"t":"set","p":"enabled","pt":"msg","to":"false","tot":"bool"},{"t":"set","p":"payload","pt":"msg","to":"\"\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":385,"y":4270,"wires":[["ee01dcb12640b036"]],"l":false},{"id":"ee01dcb12640b036","type":"ui_text_input","z":"65c9b63cb09879a0","name":"","label":"Input","tooltip":"","group":"c3301b0b86e1c81c","order":2,"width":"3","height":"1","passthru":false,"mode":"text","delay":300,"topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":500,"y":4250,"wires":[["83a5b93a15bc24a2"]]},{"id":"83a5b93a15bc24a2","type":"switch","z":"65c9b63cb09879a0","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"confirm","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":585,"y":4250,"wires":[["98ec71ce91bad253","0b7cf84bc8f345c4"]],"l":false},{"id":"98ec71ce91bad253","type":"trigger","z":"65c9b63cb09879a0","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"2","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":645,"y":4250,"wires":[["3bb5479c39ce48bd"]],"l":false},{"id":"0b7cf84bc8f345c4","type":"change","z":"65c9b63cb09879a0","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":4290,"wires":[["c38db6b5f8271c16"]]},{"id":"3bb5479c39ce48bd","type":"ui_led","z":"65c9b63cb09879a0","order":2,"group":"c3301b0b86e1c81c","width":"1","height":"1","label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#ff0000","value":"0","valueType":"str"},{"color":"#008000","value":"1","valueType":"str"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":750,"y":4250,"wires":[]},{"id":"c38db6b5f8271c16","type":"debug","z":"65c9b63cb09879a0","name":"GET THINGS DONE","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":910,"y":4290,"wires":[]},{"id":"11d256f855f9e490","type":"comment","z":"65c9b63cb09879a0","name":"How long you have","info":"","x":240,"y":4210,"wires":[]},{"id":"aba50f6e64feb2c8","type":"comment","z":"65c9b63cb09879a0","name":"What you have to type","info":"","x":620,"y":4210,"wires":[]},{"id":"c3301b0b86e1c81c","type":"ui_group","name":"Group 6","tab":"bb73106a674aef89","order":6,"disp":true,"width":6},{"id":"bb73106a674aef89","type":"ui_tab","name":"Button press examples","icon":"dashboard","order":41,"disabled":false,"hidden":false}]

Hope it is useful to someone.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.