# Need to lock off this node from being clicked until a command is sent to it

**URL:** <https://discourse.nodered.org/t/need-to-lock-off-this-node-from-being-clicked-until-a-command-is-sent-to-it/95123>\
**Category:** General\
**Created:** [5 February 2025 03:53 UTC](https://discourse.nodered.org/t/need-to-lock-off-this-node-from-being-clicked-until-a-command-is-sent-to-it/95123 "2025-02-05T03:53:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Technogeek](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@Technogeek](https://discourse.nodered.org/u/Technogeek)\
**Post date:** [5 February 2025 03:53 UTC](https://discourse.nodered.org/t/need-to-lock-off-this-node-from-being-clicked-until-a-command-is-sent-to-it/95123/1 "2025-02-05T03:53:01Z")

</div>

I'm using this really cool node, node-red-contrib-ui-button\_state by \* [haydendonald](https://flows.nodered.org/user/haydendonald) and I would like to be able to send a command to it to stop any clicks from being recognized until an unlock command is received. Here's what I'm using in my flow which is one of his examples.

```auto
[{"id":"0637174b7a71a782","type":"tab","label":"Flow 4","disabled":false,"info":"","env":[]},{"id":"ab2c6cda6ec42650","type":"group","z":"0637174b7a71a782","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["f075e4b1e82ffdee","0a2fe11a3bc5737c","7cd1becac0065c12","a9fce646456cb6b5","3e6c0840af9141f6"],"x":314,"y":179,"w":372,"h":302},{"id":"f075e4b1e82ffdee","type":"function","z":"0637174b7a71a782","g":"ab2c6cda6ec42650","name":"Pass","func":"return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":280,"wires":[["a9fce646456cb6b5"]]},{"id":"0a2fe11a3bc5737c","type":"debug","z":"0637174b7a71a782","g":"ab2c6cda6ec42650","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":590,"y":360,"wires":[]},{"id":"7cd1becac0065c12","type":"function","z":"0637174b7a71a782","g":"ab2c6cda6ec42650","name":"Default","func":"return {\n \"payload\": \"option_3\"\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":400,"y":440,"wires":[["a9fce646456cb6b5"]]},{"id":"a9fce646456cb6b5","type":"ui_button_state","z":"0637174b7a71a782","g":"ab2c6cda6ec42650","group":"fb4ca7c3.864058","name":"","order":1,"onClass":"onColor","offClass":"offColor","width":"6","height":"2","options":[{"label":"Option 0","value":"option_0","onColor":"#99ff99","offColor":"#ff3333"},{"label":"Option 1","value":"option_1","onColor":"#99ff99","offColor":"#ff3333"},{"label":"Option 2","value":"option_2","onColor":"#99ff99","offColor":"#ff3333"},{"label":"Option 3","value":"option_3","onColor":"#99ff99","offColor":"#ff3333"}],"x":410,"y":360,"wires":[["f075e4b1e82ffdee","0a2fe11a3bc5737c"],["7cd1becac0065c12"]]},{"id":"3e6c0840af9141f6","type":"ui_template","z":"0637174b7a71a782","g":"ab2c6cda6ec42650","group":"148b74783879b574","name":"Add Styling","order":2,"width":0,"height":0,"format":"<div>\n <style>\n .offColor {\n color: white !important;\n background-color: black !important;\n }\n .onColor {\n color: black !important;\n background-color: orange !important;\n }\n </style>\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"global","className":"","x":410,"y":220,"wires":[[]],"icon":"node-red-dashboard/ui_colour_picker.png","info":"# Modern Dark Theme for node-red-dashboard\n\nInspired by Victor Lucachi with his [Node Red Dashboard Concept](https://dribbble.com/shots/10356530-Node-Red-Dashboard-Concept) on Dribbble. Thank you for your work.\n\n## Customize\n\n1. Go on dashboard customisation tab (At the right of Debug Console).\n2. Select the style `Dark`.\n3. Pick the color you want. Example `#66B5F8`\n\n## Buttons\n\nUse `2x2` size for buttons with icon and text on the screenshot"},{"id":"fb4ca7c3.864058","type":"ui_group","name":"Default","tab":"64be35cd.7831bc","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"148b74783879b574","type":"ui_group","name":"Default","tab":"d70e5370d33a9c7f","order":5,"disp":true,"width":"6","collapse":true},{"id":"64be35cd.7831bc","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

Thanks, any help is much appreciated.

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [5 February 2025 06:18 UTC](https://discourse.nodered.org/t/need-to-lock-off-this-node-from-being-clicked-until-a-command-is-sent-to-it/95123/2 "2025-02-05T06:18:57Z")

</div>

Did you try sending `msg.enabled` set to boolean `false` ?

---

<div class="post-metadata">

**Author:** ![Technogeek](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@Technogeek](https://discourse.nodered.org/u/Technogeek)\
**Post date:** [5 February 2025 21:39 UTC](https://discourse.nodered.org/t/need-to-lock-off-this-node-from-being-clicked-until-a-command-is-sent-to-it/95123/3 "2025-02-05T21:39:01Z")

</div>

Thank you fort that info, it does work. This is the kind of info that really helps a newbie like myself. Node Red is really grabbed my attention but man do I have a lot to learn about it.

I thank you for your help once again.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 May 2025 21:39 UTC](https://discourse.nodered.org/t/need-to-lock-off-this-node-from-being-clicked-until-a-command-is-sent-to-it/95123/4 "2025-05-06T21:39:46Z")

</div>

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