Zero error handling on my part, but this is what I have so far as a work-in-progress with your plugin update.
Pre-Create a 2-part action that 1. deletes a temp geofence, then 2. creates a temp geofence. duplicate this for each member of the house.
The "Delete" part will ensure that if the temp fence was already created, you will be deleting it and building a new fence with the device's current lat/long. If there wasn't a temp geofence already there, the script will throw an error, but it will move on to part 2: create a temp geofence.
For deleting:
- Code: Select all
indigo.device.delete("Life360 temp geofence - Bill")
For a trigger to get a notification, these can also be set up in advance using the device (phone) as the trigger (i.e. if the closest address changes) For the condition, a script that checks to see if the device is still in the fence
- Code: Select all
target = "Bill"
tempGeofence = indigo.devices["Life360 temp geofence - Bill"]
members = tempGeofence.states["members_in_geofence"]
if target in members:
return False
else:
return True
Untested, but looks correct to me. I'm not sure if the trigger will fire or not (is it False if the script errors out becuause the geofence doesn't exist yet)?
From this, I should be able to have one button that sets or re-sets a temp geofence per person with pre-built notifications using triggers!!!
I'd say success. I can't think of a way to make it more dynamic either. I don't think drop down lists are an indigo touch option.... and one button per device should be fine for anyone.... except maybe the Duggar family (the ones with 20 something kids)
Last thought... would it be possible to have a moving fence device? Simiar to a temp fence, but everytime the plugin polls life360 for an update, it would update the location of that fence based on the location of the device used to create the fence. (basically re-creating a temp fence with every run concurrent. Benefit: if you create a moving fence from the L360 device "Bill", no matter where I am, I would be able to see what family devices are near me (in my fence) or conversely, what devices are no longer near me. Then theoretically there could be a trigger that watches the number of member in that moving fence for a change, if a change occurs, provide a notification (i.e. pushover notice) with the list of members in the fence (Hopefully I'll recognize what or who is missing from the list)
Tile works with Life360, correct? I can also see this being helpful if you use tile on your bike, in your luggage, etc. (I personally don't use tile, I fell in the airtag hole instead) Set a temp geofence with triggers on a bike, car, luggage, etc with notification triggers or a moving geofence around yourself to let you know if you luggage, bike, etc gets away from you.