gps_accuracy is indeed an attribute of the device_tracker entity, and is saved in the database along with the rest of the entity’s state when it changes. So all the data is there.
However getting at that data is another story. The easiest way to see the history of gps_accuracy is to create a template sensor based on it. Then it’s easy. Of course, that won’t help with old data.
If you’re comfortable with doing database queries, you should be able to get at it that way.
If not, and if perchance you have debug set for at least homeassistant.core, then there are state_changed messages in the log for all state changes. And I happen to have a Python script that can extract state changes from home-assistant.log for an entity, including whichever attribute you’re interested in. The output looks something like this:
$ python3 state_updates.py home-assistant.log device_tracker.me gps_accuracy
log time | last_changed | state | gps_accuracy
--------------------|----------------------------------|-------------|-------------
2019-06-12 08:11:01 | 2019-06-12T08:11:01.677325-05:00 | home | 15
2019-06-12 08:11:01 | ===== Home Assistant Start ===== | =========== | ============
2019-06-12 08:12:06 | 2019-06-12T08:11:01.677325-05:00 | home | 15
2019-06-12 08:12:26 | ===== Home Assistant Stop ====== | =========== | ============
2019-06-12 08:12:28 | ===== Home Assistant Close ===== | =========== | ============
Of course, if you’re restarted HA and the log has been overwritten…
Yes, even if it can’t save or reload the authorization to/from the cache file, it will always get an authorization token from the server if necessary, so it will work. It’s just odd that you’re seeing this.
FWIW, the standard component will save/reload via HA’s normal storage methods (i.e., to/from <config_dir>/.storage/core.config_entries) so hopefully this type of thing won’t happen in the future.
And, yes, it’s currently in the dev branch and should make the 0.95 beta release. And as long as we’re on the topic, it did morph a bit on its way to becoming a standard integration. See the doc page for details.
This is a great addon, and I’m glad to hear it’s slated to be a native part of HA. How do we use the information reported by Life360? For example…I want to create an automation based on battery level. Device tracking is working fine, and the battery level is reporting correctly on the entities card, but how do I actually use that information? I’ve read through all of the 1050 posts here, and I’m having a hard time believing this isn’t possible. Maybe I missed it?
I guess I’m missing something, but I don’t see where this references the life360 platform at all. My device tracker for life360 is device_tracker.life360_username . Did you rename your life360 device? Thanks for the help.
Just substitute the device tracker used in the code with yours. The idea is that the device tracker has many attributes and the example provided by @atomicpapa is basically creating a sensor specifically for the attribute you’re interested in.
I’m trying to create an automation that notifies using notify ( service: notify.all )
I use the person component ( person.* ) for each person
I’d like it notify when anyone ( person.* )
enters/leaves any zone ( zone.* )
it would then notify.all
With a message similar to
person X has entered zone Y
ie: Bob has left school
Steve has arrived at Burger King
I’ve seen a few different way to do this, but is there a preferred way?
The automation examples at below link don’t cover automations related to entering/leaving zones.
Yes. The way that works for you and you like best. But seriously, I don’t think there is a “preferred”, or even a “best” way. But, FWIW, here is “a” way that you might find useful:
So I have no idea how the state of the device_tracker could be “towards” or “stationary”, unless you have zones with those names, which I doubt.
How about let’s take a step back. Can you describe exactly what you’re trying to achieve? Or if you have an automation written, even if it’s not completely working the way you want, can you post it?