I’m using a Ubiquiti integration to get presence detection for wifi devices. I’m creating a “person” for each friend / family member visiting frequently and I want to get a mobile notification when each of these persons arrives or leaves home.
I know how to do it per person, but… is it possible to do this with one (or two for arriving/leaving) automations?
The gist will be: for each person not in a specific group (usual home residents) notify to mobile app when changing state to home, and add the name of the person to the notification.
Yes and no.
No because it will break each time someone change phone.
In family it’s no big deal but for friends and outer family, I wouldn’t bother. Too much work for nothing.
At least the way it is for us.
i don’t think that’s a significant issue, updating the config every few years. i am more interested how to create this in a simple config, without defining a trigger for each person - which i am doing now.
i have created a persons group containing all persons that i use for automation conditions, but it does not work well as a trigger as the persons group is constantly ‘home’ if any of the persons is at home. it could be used to notify for the first person arriving home and last person leaving home, but not for individuals. also i am trying to figure out how to get the name of the person triggering the change in the persons group (e.g. who was the first to arrive / last one to leave).
Well, if you have 10 people you track chances are that at least one per year needs to be updated. Unless everyone you know has 10+ year old phones.
But the way I would do it is in Node red with a trigger on device tracker * and feed that to a function node.
In the function node I would have an associative array/dictionary/key valued pairs with all the IP and the name of the person I want to match against and it should be easy to get the name.
Set a msg value to the name and the next node is a switch node that checks if the msg value is not empty, then pass it to a message.
I use a templated trigger to count the number of devices seen as home by my device tracker subtracting the tracked devices from my own family to determine whether or not guests are present.