How to correctly disable a button after it has been clicked?

I have been trying a couple of different ways to disable a button once it has been clicked. I need the original payload to continue. But can't seem to crack this nut... because if I set msg.enabled to false, and send that back to the given button, I get an additional payload I don't want. I am sure someone has cool example of avoiding generating another payload in trying to disable a button after clicked? I want the button to disable its-self in effect.

Please post the flow of what you have tried.
Are you sure that this tickbox is not ticked?

button

@Paul-Reed, you guessed right, I had emulate input set. That was tripping me up. Below is the flow I got working, I am sure there is a better way, but at least I have something working now, without creating some weird endless looping.

[{"id":"5facf45f.05cf5c","type":"tab","label":"Diode 2.0","disabled":false,"info":""},{"id":"a02da425.d46d5","type":"inject","z":"5facf45f.05cf5c","name":"Suspend","props":[{"p":"enabled","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":100,"y":300,"wires":[["3cad32a8.067e76"]]},{"id":"7a23eae9.cd1384","type":"inject","z":"5facf45f.05cf5c","name":"Resume","props":[{"p":"enabled","v":"false","vt":"bool"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":100,"y":340,"wires":[["cc00de15.89d4d8"]]},{"id":"3cad32a8.067e76","type":"ui_button","z":"5facf45f.05cf5c","name":"Pause","group":"3e999925.bf7cb6","order":0,"width":0,"height":0,"passthru":false,"label":"Pause","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Pause","payloadType":"str","topic":"Control","x":370,"y":280,"wires":[["4b6e5e93.4914e8","cd5a583e.c8ec88","56e72bad.24ea6c"]]},{"id":"cc00de15.89d4d8","type":"ui_button","z":"5facf45f.05cf5c","name":"Resume","group":"3e999925.bf7cb6","order":0,"width":0,"height":0,"passthru":false,"label":"Resume","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Resume","payloadType":"str","topic":"Control","x":380,"y":340,"wires":[["cd5a583e.c8ec88","bec9ea3b.bf282","2daf4ddb.117182"]]},{"id":"cd5a583e.c8ec88","type":"gate","z":"5facf45f.05cf5c","name":"Pause Or Resume","controlTopic":"control","defaultState":"open","openCmd":"Resume","closeCmd":"Pause","toggleCmd":"","defaultCmd":"","persist":false,"x":560,"y":140,"wires":[["c0bd2bb.0cde158"]]},{"id":"c0bd2bb.0cde158","type":"debug","z":"5facf45f.05cf5c","name":"Message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":760,"y":140,"wires":[]},{"id":"45bfabc3.537124","type":"inject","z":"5facf45f.05cf5c","name":"On (Blue)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"5,8","payloadType":"str","x":100,"y":120,"wires":[["cd5a583e.c8ec88"]]},{"id":"9f20e8c3.16bf68","type":"inject","z":"5facf45f.05cf5c","name":"Off (Blue)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"9,6","payloadType":"str","x":100,"y":160,"wires":[["cd5a583e.c8ec88"]]},{"id":"4b6e5e93.4914e8","type":"change","z":"5facf45f.05cf5c","name":"Disable","rules":[{"t":"set","p":"enabled","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":200,"wires":[["3cad32a8.067e76"]]},{"id":"2daf4ddb.117182","type":"change","z":"5facf45f.05cf5c","name":"Enable","rules":[{"t":"set","p":"enabled","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":360,"wires":[["3cad32a8.067e76"]]},{"id":"bec9ea3b.bf282","type":"change","z":"5facf45f.05cf5c","name":"Disable","rules":[{"t":"set","p":"enabled","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":440,"wires":[["cc00de15.89d4d8"]]},{"id":"56e72bad.24ea6c","type":"change","z":"5facf45f.05cf5c","name":"Enable","rules":[{"t":"set","p":"enabled","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":280,"wires":[["cc00de15.89d4d8"]]},{"id":"3e999925.bf7cb6","type":"ui_group","z":"","name":"Diodes","tab":"4435d05.16bbb3","order":1,"disp":true,"width":"3","collapse":true},{"id":"4435d05.16bbb3","type":"ui_tab","z":"","name":"Beta","icon":"dashboard","disabled":false,"hidden":false}]
1 Like

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