Life360 Device Tracker Platform

Sorry, but I’m not following you. The device_tracker entity, like any entity, already has a last_changed field. And it’s already displayed in the frontend, as you show. Also, Life360 device_tracker entities have a last_seen attribute (which is also displayed in the frontend if you click on the entity to see the “more info” dialog), which gives the time that Life360 last updated the member’s details. So I’m not understanding what functionality you would like me to add that isn’t already there.

Regarding the error messages, I’ll play around with the idea. I’ve never really been happy with the general situation of entities flooding the log with the same error over and over, but like I said, that seems to be the norm. Still, I think it would be good if for a given member, if the exact same error message is happening one after another to just show it the first time, and then maybe log an INFO message when the error stops.

hmmm, it’s there, because I’ve set it in the customize part for this device_tracker. As for all device_trackers I like to display the last_changed field. It’s not there by default is it? Device tracker - Home Assistant

as said, no big deal, it is available through customization. I simply thought it might have been nice to have it set in this component. Haven’t played around with the last seen yet, guess we can template that out into a dedicated sensor. But to have it show under the entity in the front-end needs the customization. Or what am I not seeing here… sorry.

thats exactly what i was hoping for!
And yes, you’re right, would be even better if that were to be default behavior in HomeAssistant for all entities flooding the logs…

last_changed is actually a field of all State Objects. It’s not unique to device_trackers. As to your customizations, I don’t know what that might be. E.g., I have no customizations for my device_trackers, or my frontend, and it shows last_changed as a relative time if you click on the entity and open its “more info” dialog. (I guess it’s not exactly what you showed, then.) So maybe what you’re talking about is customization of the device_tracker view in the frontend. I really don’t know about that. But it looks like you’ve already done it. Or are you wanting some custom frontend component/view/widget/whatever? If so, that’s outside the scope here, and I would think that would apply to any device_tracker, not just Life360. Bottom line, I really can’t help you there.

Regarding error filtering, I created an issue in my repo: #12: Filter repeated error messages. You, or anyone, feel free to comment. I started a test to filter out “get_circles” errors, which tends to happen when my local Internet access goes out, or the Life360 server is unavailable. Depending on how that goes I’ll try to add something similar for individual member errors.

you can use the members parameter to include all the members

been trying to do so, but I receive errors regarding the name I enter not being a member.
Seems to have to do with the fact I dont use a username, or login name, but an emailaddress and phone number which was al I got when loggin in.

I do have a device_tracker name with life360_name. Should I use that to include the members I select? And if yes, do I need the whole device_tracker.life360_name, or only the life360_name bit.
thx,
Marius

The only error you could see related to the members: config option is “Invalid member name: XXX”, where XXX is one of the values you provided for this parameter. And per the doc page, the only requirements of these values are that they are a string which contains one, and only one, comma. Per the example provided:

    members:
      - mike, smith
      - Joe,
      - , Jones

These names come from Life360. That is, they are the First Name and/or Last Name provided in the members’ account information.

If you already have device_trackers from before you added the members: parameter, then the object_id’s will include those names. Again, per the doc, for a member with both a First Name and Last Name, the device_tracker object_id will be prefix_firstname_lastname. In this case the members: entry should be FirstName, LastName. For a member with only one name, it will be prefix_name. In this case the members: entry should be either FirstName, or , LastName, depending on whether it was a first or last name.

Basically, you need to know what the First Name and Last Name are in the corresponding member’s Life360 account. If the member only has one name in their Life360 account, and you don’t know whether it’s the first or last name, then try both – first try Name, and if that doesn’t work, then try ,Name. In fact, you could just enter it both ways. These names don’t have to be members. But members retrieved from the server have to match one of these entries to be tracked. So putting:

    members:
      - xxx,
      - ,xxx

will track a member with a single name of “xxx”, whether it’s a first name or a last name.

Hmm, maybe I should add a new feature whereby if a member only has one name entered in Life360, you can just enter that single name (with no comma), and they will be tracked if it matches either the first or last name… :thinking:

Component has been updated (to 1.2.0) to filter excessive error messages (like when your Internet goes out, or the server becomes unresponsive.)

If there are two consecutive errors for the same operation, the second one will include the message “Squelching further errors until OK”. Then, when that operation succeeds, another error message will be logged that says "OK again’. (It’s purposely categorized as an ERROR so that it shows up on the Info page.)

I think it was the comma I forgot, didn’t think that to be correct yaml somehow…
will try, along with your new update.

btw, can’t thank you enough for the CC, even my other half was happy as can be, arriving home from work today laughing because she hadn’t needed to power her iPhone today…
cool.

1 Like

Component has been updated (to 1.3.0) to allow names in members: list to leave out the comma if the corresponding member only has one name entered in their Life360 account. A name entered this way (i.e., without a comma) will only match a member with a First Name, or a Last Name, but not both.

1 Like

cool! much better… duh, starting to feel rather jealous of all these programming capabilities and ease you’re displaying here…

Phil, just a follow-up to the use of the custom_component tracker_card. It’s working great, but one thing that you might not be aware of is when an update is shown as available, it also provides a link to the release notes if you click on the version (1.3.0)

Currently, this github page just shows “There aren’t any releases here”.

It would be nice if the release notes were populated here in some fashion.

Thanks!

Sounds great.
Now I need to figure out how to display adress name and show it in UI.

How can i display last_changed in frontend like this.

I don’t use the tracker card, but I knew it provided some sort of link for new versions. I guess it makes sense it would use that link from the JSON. I’ll have to do it a little differently since all my custom components are in one repo, but I’ll work on it: Issue #17. Thanks for the feedback!

1 Like

If you click on one of the device trackers in the frontend, it will open a “more info” display. In there will be shown all the attributes, including the address, as well as the relative time since the last state change. You can always uses template sensors to pick out and display attributes from other entities. Or, I suppose you can customize the UI, but I haven’t done any of that myself so I couldn’t help you with that.

thats no issue at all, simply customize as follows:

homeassitant:
  customize:
    device_tracker.life360_marijn:
      show_last_changed: true

Does that only work in lovelace, or with a custom device_tracker card? Because I just tried that and it made no difference.

No I don’t use Lovelace. But do use the custom-ui by @andrey . See: home-assistant-custom-ui/docs/features.md at master · andrey-git/home-assistant-custom-ui · GitHub

do all sorts of nice stuff:

binary_sensor.family_home:
  show_last_changed: true
  templates:
    icon: >
      if (entities['sensor.family_home'].state === '0') return 'mdi:account-off';
      if (entities['sensor.family_home'].state === '1') return 'mdi:account';
      if (entities['sensor.family_home'].state === '2') return 'mdi:account-multiple';
      if (entities['sensor.family_home'].state === '3') return 'mdi:account-multiple-check';
      return 'mdi:account-group';
    icon_color: >
      if (state === 'on') return 'rgb(251, 210, 41)';
      return 'rgb(128, 128, 128)';
    _stateDisplay: >
      if (state === 'on') return 'Occupied';
      return 'Home alone';

Ok, I added what I hope are valid links to useful release information for my custom components. It doesn’t follow the usual pattern because all my custom components are in one github repo, whereas it looks like the norm is to put each in its own repo. Anyway, would you mind running the custom_updater.check_all service and then see if the links work? Of course, if there are no updates to the actual components (which there aren’t), … Well, at least keep an eye on it and let me know if I need to change/fix anything. Thanks!

Sure Phil, I will keep an eye on it.

I did manually test this link: https://github.com/pnbruckner/homeassistant-config/blob/master/docs/life360.md#release-notes which is an appeciated addition to the doc. Thanks!

I will confirm if the tracker_card link for device_tracker/life360.py will point here in the next update.

1 Like

not trying tho hijack, but do you have a list or example of cards and components this custom_updater can track? Up to now I only have this repo and the hue.py component, but am short of several important custom cards, like the custom-ui and custom_weather-card…

any pointers would be appreciated!