The distance function will calculate the great circle distance between two GPS data points, so you can feed it two device tracker entities and it will return a value consistent with your set units.
If you only feed one it assumes the distance between that and home.
So “{{ distance(states.device_tracker.life360_muttley) }}”
Phil, this is not urgent or even what I would consider a bug, just an observation on apparent disparity in behaviour.
I am building a second installation on a Pi 4 but did the build and integrations from scratch, just copied over the yaml files (all of them).
On the Pi 3 this is what I get from a device tracker away from home : -
Whilst on the Pi 4, this is what I get (images taken 2 mins apart) : -
Any idea what the difference is ?
As I say, I’m not invested in either presentation, just curious.
Thanks in advance
Edit/Note : The images (which occur for both trackers on the Pi 4) are the ones set under WhatsApp as the user avatars. (Therfore maybe ??? picked up by life360 ?).
The life360 integration passes the member’s avatar (actually an URL, which it gets from the Life360 server) to the device tracker component-level code whenever the device_tracker entity that corresponds to the member is updated with new data from the server. However, the device tracker component-level code only uses that “picture” when it sees that device for the first time, which it writes into known_devices.yaml. After that, if the avatar URL is ever updated, even though the life360 integration will pass the new information up, it won’t be used. (The component level code doesn’t update known_devices.yaml with new data.)
So you should look at what is in known_devices.yaml for both systems. Whichever system has the picture you like, just copy that entry from known_devices.yaml to the other system (and then restart HA on that system.) It should then use that picture.
I said it wasn’t urgent so you have no need to apologise.
Trying to think of an urgent instance for an HA question but can’t.
The closest I can come is “my central heating is on manual and I’m wasting a bit of fuel”, but I’d hardly call that urgent. (my central heating is fine).
Your explanation makes sense and has nothing to do with ‘your integration’ so extra thanks for your wisdom and the extra milage.
It also shows how long I’ve been prattling about with HA that my trackers predate my use of WhatsApp (which is why we set our avatars) I’m sure WhatsApp has been running a while now so we must be late adopters
Edit: Just mulling this over … rather than having to create a new HA instance every time we want to update our pictures, just so’s I can copy the https addresss over from known devices.
Can I delete the device from known devices to force an update or do I have to delete the integration then re-add it ? (I know this is not your balliwick but you may just have a ready answer) TIA
I think below is not related to HA but life360 itself. I have a zone setup for my kid’s school with radius 500. From time to time, life360 shows kid left school and the position is about one mile from school, then it just jump back shortly, but in fact the kid was in school the whole time.
Does anyone have similar? Is this due to phone GPS(iphone 11)? Besides increase radius, any other alternatives?
I see this often with my wife’s phone (Galaxy S10+) and it usually happens when she is inside and the signal is really bad (all metal building). The only way I have been able to compensate for it is to increase the radius of the zone in both HA and in Life360.
You can delete the entry in known_devices.yaml, then restart HA. The device tracker component level code will recreate the entry, but this time using the latest “picture” provided by the life360 integration.
Or, you can just go over to www.life360.com, log in, find the person, right-click on their image and select “copy image address”, then use that in known_devices.yaml.
Is there work to get this moved way from known_devices.yaml? I am just curious as I think it’s getting deprecated in .107 maybe? I know in .105 they had to revert the removal of hide_if_away
I use life360 and ping, both still using the older known_devices.yaml
I’ve wanted to do that but just haven’t gotten around to it. I’ve started a few times and each time the task seemed a bit daunting so I gave up. I still hope to do this at some point, hopefully before it’s too late. Unfortunately right now I’ve got a couple other things on my plate that I need to get squared away first.
I’m rusty, I spend all my time in meetings and doing mgmt and arguing with product, but I use to be a developer at a point in my life, let me see if I can help, never did python, but will will at it and see
I’m using the Proximity setup Doug posted earlier with adjustments.
What I’m seeing is that it works but is not updated often enough. I’ve tweaked it to fire an automation when I get within 10,000 ft of my house but as it is I get the “I’m home” at the same time as “I’m close to home” notifications. I presume this is more of a Life360 thing regarding the app on my phone probably saving battery and not updating every nanosecond.
Has anyone else run into this and found any workarounds or adjustments so it works a little better maybe?
One thing I’m testing out (since we live out in a rural area), I’ve created two new locations/zones in Life360 and HA at the intersections West and East of our house. Life360 seems to be pretty good at popping off alerts when you enter one of their locations so I’m working off that AND the direction (towards) condition. Initial testing has been good - I haven’t gotten alerts when I’m leaving my house and driving through those locations. So far, I have had one time that I’ve been coming home and did get an alert for one location. I’ll be testing the other location on the way home tonight to see how it fires.
I’m just trying to setup a scenario when any of us get close to home that it has the ability to turn on the outside lights for us. It is somewhat pointless to wait until we’ve already pulled into the driveway is why I’m going the proximity route.
Just want to share my experience to help others and see if anyone else has any pointers.
I’m in same boat, wanted the outside lights to turn 100% brightness (other time lights are 20%) when family coming home. Life360 has been in delay even I set larger radius.
It maybe more accurate to put a contact sensor on the garage door to trigger the lights, most of time we are driving back to home and need to open garage anyway.
Yes, how often the Life360 app on your phone updates the Life360 server is a function of Life360, not Home Assistant. If you’re not getting updates often enough then you should consult their FAQs. There are definitely settings, etc. that can affect that.
Of course, HA can only update as often as the Life360 server does (with some delay due to the polling mechanism it uses.)
I guess I didn’t fully follow what you were describing, but I wonder, why not just use a larger HA zone around your smaller Home zone? As far as I understand, as you approach from outside the larger zone, your device_tracker entity’s state should change to the name of the larger zone when you enter it, and then change to home when you enter the Home zone. Maybe that would help (without requiring you to increase the size of the Home zone.) Just a thought. Haven’t tried it. I have my Home zone radius set to 300m and that works perfectly for us. HA always thinks we’re home before we pull up into the driveway.
That should happen automatically. I don’t use the person entity, I used the life360 device_tracker entities directly, and I see them on the map. Not 100% sure how the person entity works, especially in conjunction with the map.