Dynamic Geofencing

I am trying to create a dyanmic geofencing. Here is a hypothetical scenario. My child is going to go to a friends house after school. Later she is going to walk home. I’d like to know she left the house. Now I don’t want to create static zones for every friend she has. What I would like to do is this: I’d like to tell alexa, set up a geofence for X.

From there it will now monitor for when my daughter leaves her current location.

I am running the iphone tracker, companion app and life360 for device tracking and all of my configuration is done in Node-Red.

Where I am fuzzy is on stationary zones and how to hook into when a stationary zone is exited.

Anyone have an easy way to make this happen? I can write my own routine in node-red but if theres something out there that is already doing it I’d like to save myself the time and use that.

Regards,
-M

Maybe manually set the zone parameters with a Python Script and run that based on a HA script that you expose to Alexa?

An option I thought of but never implemented is

  • register the lat/lon of the device
  • if distance between current lat/lon and stored lat/lon is larger then (say) 50, the device is moving, store the new lat/lon
  • if lat/lon has been stable for (say) 5 minutes and changes, then device is anew on the move > send notification
1 Like

This was close to what I came up with utilizing Proximity integration and Node-red

  1. Alexa pushes a helper button on command which then triggers my node-red routine.
  2. The routine then creates a global and stores a true/false and the proximity from home.
  3. Every minute I then check to see if the current proximity is not = to the globally stored proximity for more than 30 seconds. If it is then I know they have left the area.

Works perfectly. Thank you all for the suggestions. Here’s an image of what I did. I’d provide the node-red but I have so many subsystems that I plug into it would go far beyond the scope of what this thread was about.

1 Like

Can you please post the Node-red Export code? I’d like to make use of this for my systema swell. Thanks!!!