The latest of May. 2022.5.5
Actually, I forgot youāre using this as a custom integration. (Iāve been working on the PR to submit this formally, so I thought āhomeassistant.components.life360
ā by default. lol) So, the debug config should be different:
logger:
default: info
logs:
life360: debug
custom_components.life360: debug
Try again with that. There should be more details in the log this time.
But even with just the details available so far, I can draw a few conclusionsā¦
First, the āExecutor shutdown has been calledā error might be just from when you were trying to stop Home Assistant. Unless that happens often, Iām going to ignore that error for now.
The other error tells me a few thingsā¦
- It is able to communicate with the Life360 server.
- It is able to successfully log into the server.
- It is able to successfully retrieve the list of Circles.
- The error happens when it tries to retrieve the Members and their data from one of the Circles (or the only Circle).
Iāve had reports of this problem from time to time for years. But so far Iāve never been able to conclude what causes it. There is some speculation that it has to do with Members not having location sharing enabled, but Iāve tested that scenario and have not been able to duplicate the problem. For more details, see:
and
Are you sure this only happens when you try to use this custom integration version? Or have you seen this problem using the standard, built-in integration as well?
No, iām not sure of this, but never saw those errors before (when using the legacy one).
One question about circlesā¦ in the app am i forced to have the same circles as the configured zones in HA?
Hmm. Thatās been the problem with these ā400ā errors ā they come and go with no rhyme or reason.
Sorry, I donāt understand the question. Do you mean the same Places as configured zones in HA?
Life360 has Places, and HA has zones. They are separate things. They do not need to agree, although it can help your sanity if they do. See Home Assistant Zones & Life360 Places.
But again, no, they do not need to agree. The state of the device trackers in HA will be solely based on HA zones (and possibly the driving
attribute, if you so configure it.) If the device is in a Life360 Place, then that will be shown in the place
attribute only.
Yes i was meaning that. Btw your explanation toggle off my doubtsā¦
I will let you know other logs if they appear.
Thanks for all for now.
The PR to convert to the new entity based implementation:
has been approved and merged, and could, therefore, make it into the 2022.7 (or maybe 2022.8) release.
Note that some features have been removed or slightly modified. See the āBreaking changeā section at the top of the PR for a āheads up.ā
The new life360 implementation is in 2022.7.0b0+.
Has anyone using life360 updated to this release, and if so, how is it going?
HA Release 2022.7.0 introduces a BREAKING CHANGE to the Life360 integration
Overview
The Life360 integration has been converted from the old ālegacyā implementation (i.e., that uses the known_devices.yaml
file in the config directory) to the newer entity-based design, similar to what was done for many other device tracker integrations when the new design was first introduced in release 0.94.0 over three years ago! (Interesting fact: the Life360 integration was first introduced in release 0.95.0, so was implemented while the device tracker component was in the process of being reorganized. So, this change is long overdue!)
When you upgrade to 2022.7 or newer for the first time, all your existing Life360 device_tracker
entities will become non-functional. Unfortunately, given the implementation of the device tracker component level code there was no way to avoid this.
But there will also be new entities that are functional.
Take a look on the STATES tab of the Developer Tools page, or the Entities page under Settings, and you should see both the old and new entities. The old entities will have the same entity IDs as before, and so anything that used those entities (person
entities, automations, etc.) will no longer be getting updates.
Steps to replace old entities with the new ones
- Edit the
known_devices.yaml
file in your configuration directory to remove any Life360 related entries. Or, if there are only Life360 entries in this file, simply delete the file entirely. - Restart Home Assistant. All the old, non-functional Life360 entities should now be gone.
- Go to the Entities page (under Settings ā Devices & Services ā Entities) and change the entity IDs for the new Life360 entities as desired.
Removed/changed functionality
Configuring Life360 via YAML files is no longer supported. Any settings that were in YAML will be automatically migrated to the config entries. Once you upgrade you should remove the Life360 related entries from your YAML files. You can see or change the migrated settings by going to Settings ā Devices & Services ā Integrations and clicking CONFIGURE on a Life360 entry.
Which brings us to the next point ā some settings are no longer supported, specifically:
circles
members
error_threshold
warning_threshold
max_update_wait
(and the corresponding eventslife360_update_overdue
&life360_update_restored
)show_as_state: moving
The following attributes have changed:
- Renamed:
battery
ābattery_level
- Removed:
moving
,raw_speed
Thank you very much, Phil, for your efforts.
My question is for these options which I used to keep in yaml:
life360:
max_update_wait:
minutes: 15
interval_seconds: 12
show_as_state:
- driving
- moving
accounts:
- username: !secret life360_ildar_login
password: !secret life360_ildar_password
What should I do?
- Should I simply remove the
accounts
lines since this info is inputted via UI now? - What should I do with
interval_seconds
&max_update_wait
values since there is no UI input for them?
Here these interval_seconds
& max_update_wait
attributes are not specified as supported.
OK, assume that interval_seconds
is supported by the device_tracker
platform.
But what about max_update_wait
?
And what about events ālife360_update_overdueā, ālife360_update_restoredā? Are they deprecated?
These events are not mentioned here (as they were before).
But these events are displayed in HA (dev tools):
You should remove the entire life360 section from yaml after youāve upgraded to 2022.7.x and the (supported) settings are automatically migrated into the corresponding config entry/entries (in config/.storage/core.config_entries).
I was not allowed to keep support for interval_seconds
. It now updates every 10 seconds. If you want it to update at a different rate, then you have to do like youād have to do with any other integration that supports config entries: i.e., click the CONFIGURE button on the integration, then System Options, then disable polling, then create an automation that triggers at the rate you want and have it call the homeassistant.update_entity service with appropriate options.
For max_update_wait
and its corresponding events I donāt really have an answer. The implementation changed significantly enough that keeping that functionality was not going to be easy, and honestly, I didnāt think it would have been used much, and even it it were, it wasnāt that important. Since I got no feedback relative to this feature in my ātesters neededā topic, or during the beta period, I concluded my assumption was reasonably valid. BUT, if this is a huge problem for you, or others, by all means, open an issue and if there is enough interest I can look into trying to add back the functionality.
The reason those events are shown on the dev tools page is because you have things listening for them, even if thereās nothing in the system that can currently generate them.
Here it is specified as ā12ā.
Is it an error?
Listening to these events is the ONLY way to set update alert for me.
Earlier these events were generated if there is no any updates from some client within XXXX time.
See, the platform could monitor these updates and set some ERROR flag after that XXXX timeout (like a similar āTraccarā platform) - then HA could just monitor this ERROR flag and set/withdraw an alert.
Alternatively, the platform may send events - like the Life360 platform used to doā¦
For me - both variants will be OK.
But currently we do not have any info āare these data valid or outdatedā.
I will create an issue for restoring (or replacing) the āalertā functionality.
DONE - Life360: restore a functionality to send "overdue/restored" events (or propose a corresponding status) Ā· Issue #74554 Ā· home-assistant/core Ā· GitHub
BTW - removing these events is a BREAKING CHANGE, not mentioned in Release notes.
That does not apply to this integration. That only applies to device tracker integrations that are configured via yaml as a platform under device_tracker:
.
BTW - removing these events is a BREAKING CHANGE, not mentioned in Release notes.
The breaking change mentions that max_update_wait
is no longer supported. Those events were only generated by using that option. So, no, it does not explicitly say those events can no longer be generated, but I think itās pretty obvious if max_update_wait
is no longer supported then you canāt expect those events to be generated any more.
But currently we do not have any info āare these data valid or outdatedā.
For ALL device trackers, they are ALWAYS outdated, except for the instant in time they update (and even then the HA update is probably delayed from when the data was actually generated.) The only question is HOW out of date the data is.
One way, I suppose, to get the same or similar functionality is to use the last_seen
attribute. It tells you exactly when the Life360 client on your device last told the Life360 server where it was. If you subtract that from now()
you can see how out of date the data is. And you can use that to trigger an automation, and you can even have the action of that automation send the same events and data that the integration used to do. E.g.,:
- trigger:
- platform: template
value_template: >
{{ (now() - state_attr('device_tracker.xxx', 'last_seen'))
.total_seconds() > 30*60 }}
action:
- event: life360_update_overdue
event_data:
...
to use the
last_seen
attribute
Agree, this is a possible solution.
I am doing the same for a Companion App integration: if a ābattery_levelā sensor (the least rough choiceā¦) is updated more than XXX minutes ago - then the corresponding alert ādata from companion app - not validā is set to ON.
Probably I will have to implement a similar functionality for Life360 too.
I upgraded to HA 2022.07 on my dev setup, which is where I had made the changes to try your new integration prior to being released. After the upgrade I added the LIfe360 integration then commented out the config.yaml setup and removed the known devices file and restarted. My device_tracker entities appear to be correct as prior however they are showing as ānot_homeā.
Is there something I missed in the setup? They should be showing as āhomeā.
**edit - I should also mention no attributes are being shown
Did you back out the test implementation and revert the config before upgrading as I warned you should?
If not, then you should definitely make sure youāve removed the test implementation in your custom_components folder, restart HA, and probably completely delete your Life360 entries on the Integrations page and re-add them because the config entries in the .storage folder are probably bad as I had explained (i.e., wrong version number.)
Let me know if that solves the problem.
So I missed removing the the Life360 folder from the custom_components folder. I have now removed this and restarted HA. If I remove the entities from the integration page how do I go about re-adding them?
You need to delete the integration(s), not the entities. I.e., do this on the Integrations tab, not the Entities tab.
To re-add, click the plus sign in the bottom-right corner of the page, then select Life360 from the list, etc. Youāll need your Life360 account info ā username & password.
Ah, that makes more sense, I thought you wanted me to just delete the entities. Iāll try this.
Sorry, I said āentriesā, not āentities.ā That was a bit confusing I guess. lol!