I’m a novice to Node-Red, but I have already discovered that the typical behaviour is that, after Deploy of “Modified flows”, it only restarts the nodes in the flows that have changed. However, this is not the case for the three-state switch. It always sends a message with the topic: ‘Switch/state’ after Deploy Modified flows.
Switch/state : msg : Object
object
payload: 0
topic: "Switch/state"
source_path: "/SwitchableOutput/output_1/State"
However, this can cause issues when you control a node connected to a physical relay by auto mode. While doing some logic in auto mode, you may decide to set the relay to ON. After deploying the Modified flows, the relay state may briefly switch to the opposite state (due to Switch/state message arrive into same node). This is unwanted and it’s difficult to create a workaround. For example, I was thinking to use Inject node (set to ‘Inject once after…’) to set some flow variable and block such message using a switch node. But this is not possible, because such an Inject node is not executed after Deploy Modified flows. The solution might be to use Full deploy, but this completely restarts other flows that you don’t want to affect while you’re experimenting with a new flow.
Is there any other workaround or possibility to modify the node so that it doesn’t behave like that?
