Nub need help with flow that only activate if we are not home

Hello

i have almost exclusively used manual trigger to run events in node-red, alternatively only 1 device as trigger.

which trigger should I use if I have several units as trigger but only if they are all in a certain mode? i.e. I use unifi integration for wifi devices and owntracks to determine if someone is home. but if I now want a flow to only trigger if both me and the wife are gone. i.e. that mine and the wife’s phone are not connected to wifi and that we are not at home according to owntracks then it should trigger, if one of the devices is home it should not trigger.

And it should not activate as long as there is movement at a motion sensor. as example. My wife and I are leaving home, but my daughter is in the hall packing her bag, then the hall light should not be turned off and the door will remain unlocked until there is no movement there anymore.

//Regards, excuse my bad grammar

I would start with the trigger:state node. I use this node to check if we are not home.

There is a better way to check by using the entity zone.home. This will indicate how many people are home.

All the above is dependent on the proper setup and configuration of the device_trackers and associated person

Hi and thanks for the reply, I’ll test this right away.

Do you have any tips on how to set up a routine that only triggers when we get home, i.e. if we’re home already, it shouldn’t trigger. the idea is that when we get home, it should unlock and turn on the light in the hall, but I don’t want it to trigger if we haven’t been away.

//Regards

I guess I don’t really understand how it works? should it say 0 on the line with >? is it then our phones that are going into the entity (its the phones we are tracking) thanks for the help and happy new year

The entity home.zone represents the number of people who are home. So, if home = 0, nobody is home. If home changes to > 0, someone is home. You would like to do something when someone arrives home (current state of home > 0) but only if someone is not already home (previous state of home is 0).

I use the Unifi Integration Presence detection to determine if our mobile phones are home (connected to the local network). The Unifi Integration creates device_tracker entities for devices connected to the Unifi network. These device trackers can be associated with a specific person in Home Assistant Settings->People.

Home assistant will update home.zone based on the status of the device trackers associated with each person.

1 Like

thank you, will try this tomorrow.