I admit I'm not 100% aware of node red concepts, and I've been struggling in the last few days to have some basic flows working.
At the moment I have a sonoff PIR connected to zigbee2MQTT --> MQTT --> NodeRed --> InfluxDB/textfile. Whenever the PIR sensor is activated, there is a function node that send the battery level to an influxdb database and an enriched payload to a text file (for logging).
Now I'm trying to have some intermediate node (not sure what type, likely to be a function node) that based on the status of a dashboard switch routes the flow accordingly.
In other words: I'm trying to have a dashboard switch that I can access in NodeRed's dashboard GUI that enables/disables the flow to a third output.
If disabled, the flows go to the textfile (payload) and influxDB (as now).
If enabled, besides the previous two flows, there should be a third flow to some other node (I'm thinking maybe a telegram node that could send me a message).
My difficulty is implementing this "switching logic" based on a dashboard node. This should be a kind of global variable enabled/disabled by a switch in nodered's GUI.
Any suggestion how to do this in NodeRed?
Just for reference, in case it may be relevant, I'm using IOTstack with zigbee2mqtt, Mosquitto and NodeRed on a RPI4. As a zigbee controller, I'm using Slaesh C2652 USB stick (couldn't post the link due to 2 link limitation for new users).