# Disable a node from another node

**URL:** https://discourse.nodered.org/t/disable-a-node-from-another-node/88240
**Category:** General
**Created:** [24 May 2024 16:14 UTC](https://discourse.nodered.org/t/disable-a-node-from-another-node/88240 "2024-05-24T16:14:50Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Veuchez](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/veuchez/32/91025_2.png) [@Veuchez](https://discourse.nodered.org/u/Veuchez)
#### Post date: [24 May 2024 16:14 UTC](https://discourse.nodered.org/t/disable-a-node-from-another-node/88240/1 "2024-05-24T16:14:50Z")

</div>

Hi everyone,  
Is it possible to temporarily disable a node from another node?  
Thank you!

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [24 May 2024 16:18 UTC](https://discourse.nodered.org/t/disable-a-node-from-another-node/88240/2 "2024-05-24T16:18:28Z")

</div>

Can you explain why you want to do that?

---

<div class="post-metadata">

### Author: ![Veuchez](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/veuchez/32/91025_2.png) [@Veuchez](https://discourse.nodered.org/u/Veuchez)
#### Post date: [24 May 2024 16:24 UTC](https://discourse.nodered.org/t/disable-a-node-from-another-node/88240/3 "2024-05-24T16:24:29Z")

</div>

Because I read the status of a device and based on the status I modify a home assistant switch. if the state is different from the switch, the switch changes.  
However, I also set a flow that when the home assistant switch changes state, an API call starts. these two things overlap in some cases and an API call is made for nothing.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [24 May 2024 16:36 UTC](https://discourse.nodered.org/t/disable-a-node-from-another-node/88240/4 "2024-05-24T16:36:28Z")

</div>

OK I can't envisage that because I don't use Home Assistant so don't know what a HA switch is.

I don't know a way to disable a node without a deploy but there are various ways to block the messages emitted by a node - with a contrib gate node such as node-red-contrib-queue-gate, node-red-contrib-simple-gate, node-red-contrib-semaphore, or even with a switch node and global or flow context variable.

---

<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: [25 May 2024 01:43 UTC](https://discourse.nodered.org/t/disable-a-node-from-another-node/88240/5 "2024-05-25T01:43:42Z")

</div>

```auto
[{"id":"dd9c6b9c3aabe1d1","type":"gate","z":"ad26319aa43f2957","name":"","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"memoryOnly","x":610,"y":1040,"wires":[["0c34cd39e1219953"]]},{"id":"60d33cbf9f1df9f1","type":"change","z":"ad26319aa43f2957","name":"Open","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":390,"y":1140,"wires":[["d158e3563a83aec5"]]},{"id":"9eb65fc437387500","type":"inject","z":"ad26319aa43f2957","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":1140,"wires":[["60d33cbf9f1df9f1"]]},{"id":"a22b9862c1aa6918","type":"inject","z":"ad26319aa43f2957","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"something","payload":"","payloadType":"date","x":260,"y":1040,"wires":[["dd9c6b9c3aabe1d1"]]},{"id":"0c34cd39e1219953","type":"debug","z":"ad26319aa43f2957","name":"debug 2538","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":1040,"wires":[]},{"id":"0d015e76c7f4b750","type":"change","z":"ad26319aa43f2957","name":"Close","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":390,"y":1200,"wires":[["d158e3563a83aec5"]]},{"id":"b9618cfed7239e34","type":"inject","z":"ad26319aa43f2957","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":1200,"wires":[["0d015e76c7f4b750"]]},{"id":"c820f3e9ad2a4f8f","type":"change","z":"ad26319aa43f2957","name":"Toggle","rules":[{"t":"set","p":"payload","pt":"msg","to":"toggle","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":1260,"wires":[["d158e3563a83aec5"]]},{"id":"610c7da6682765c2","type":"inject","z":"ad26319aa43f2957","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":1260,"wires":[["c820f3e9ad2a4f8f"]]},{"id":"d158e3563a83aec5","type":"link out","z":"ad26319aa43f2957","name":"link out 244","mode":"link","links":["3823912309d93cde"],"x":515,"y":1200,"wires":[]},{"id":"3823912309d93cde","type":"link in","z":"ad26319aa43f2957","name":"link in 263","links":["d158e3563a83aec5"],"x":515,"y":1000,"wires":[["dd9c6b9c3aabe1d1"]]}]

```

as @jbudd suggests, a simple gate should stop the message flow to a particular node.

```auto
node-red-contrib-simple-gate

```

---

<div class="post-metadata">

### Author: ![Veuchez](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/veuchez/32/91025_2.png) [@Veuchez](https://discourse.nodered.org/u/Veuchez)
#### Post date: [27 May 2024 06:20 UTC](https://discourse.nodered.org/t/disable-a-node-from-another-node/88240/6 "2024-05-27T06:20:26Z")

</div>

A thousand thanks @jbudd e @smanjunath211 !  
Simple-gate was what I needed!

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [28 May 2024 10:29 UTC](https://discourse.nodered.org/t/disable-a-node-from-another-node/88240/8 "2024-05-28T10:29:26Z")

</div>

That refers to nodes in Kubernetes clusters. We are talking about nodes in a node red flow here. Not the same thing at all.

---

<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: [26 August 2024 10:29 UTC](https://discourse.nodered.org/t/disable-a-node-from-another-node/88240/9 "2024-08-26T10:29:44Z")

</div>

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