Home Assistant + NodeRED logic when several devices have different values

I ask for help in implementing the following logic:

device - status
my phone is home
wife's phone - not home
child's phone - not home

if devices have exactly these states, then there should be an output from the node that will allow me to further execute the logic I need

use switch nodes in series

---> switch ---> switch ---> switch ---> result

1 Like

I don’t quite understand how to implement this through a node switch

Unless you provide a debug output of the nodes, nor can anyone else.

BTW, what you are asing is very very base knowledge. I'll post some info and links below to help you to help yourself

1 this will bring you on leaps and bounds

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

2 getting data and property paths

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

3 Posting code in the forum

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

See this post for more details - How to share code or flow json

That is three switch nodes in series, one for each of the tests you need to do.

Maybe start with a join node to get all the values into one message.

Does HomeAssistant know the status of the three phones?
If so, how do you access that status in Node-red?

Or do you need to use Node-red to identify if each phone is connected to your wifi?