Start a flow when certain conditions are true

Trying to do the following:

In the picture you see my doorbell and mailbox flows, they are working so when someone is at the door or the mailbox gets filled the google assistant give a tts announcement. (the second cast part is to reset the volume to lower values so next time we ask google something it doesn't shout out the answer).

I can also read out the state of my mobile phone (is it connected to wifi or not) and want to integrate that in the flow, so when my phone is on the wifi network the doorbel flow will start, if it isn't the doorbell flow will not get triggered.

Any way to do that? the phone state reports true when present and false if not present coming from another node (pimatic get state, same as the 433 mhz deurbel and brievenbus nodes in the picture)

I'm completely new to nodered and trying to understand the structure how to make these kind of flows.

One way is that you can put in place a Change node after your pimatic get state node and set a flow. or global. variable (depending on how else you want to use it and if you set it on this same tab or not) to represent the state of the phone. Then add a Switch node in your doorbell flow to check the state of your phone variable to either keep the flow going or exit the flow.

Let me know if that all makes sense?

1 Like

That does make sense! Maybe the global node is the best way to go since I can use that variable on other flows too then. Now to find out how and with what node to do this haha.

Thanks! Installed Node-red like 3 days ago and already beginning to understand what it does. Have to learn a lot when it comes to diving deeper in the nodes though but fun learning stuff.

The Node-Red Documents are your best friend as you get up and running - Documentation : Node-RED

In particular to the above:

1 Like

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