Disable a node from another node

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

1 Like

Can you explain why you want to do that?

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.

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.

[{"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.

node-red-contrib-simple-gate

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

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

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