Recently i having problems with life360. it doesn’t know were im or what the battery level. i have to go inside the 360 app and push the “check in” in order for it to refrash in HA. any others have this problem also.
what i need to do to solve it?
in the HA log there nothing about 360.
Thanks
Refael
Please make sure logger is set to debug
for custom_components.life360
and restart HA. Then look for lines that contain:
[custom_components.life360.device_tracker]
in home-assistant.log. If those log messages don’t give you a clue, feel free to post them here, as well as your life360 configuration, and I can try to determine what your issue is. Don’t forget to redact any sensitive information from the logs and config before posting.
I believe I am having a similar issue lately because my status is always Away, which is not good since this is part of the security setup for my residence. Never had an issue for quite some time and now in the log I get this.
2019-05-14 11:17:00 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed
[SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id) VALUES (?, ?, ?, ?, ?, ?, ?)]
[parameters: (‘state_changed’, ‘{“entity_id”: “device_tracker.life360_willy_wonka”, “old_state”: {“entity_id”: “device_tracker.life360_willy_wonka”, “state”: “home”, “attributes”: {“sou … (1337 characters truncated) … :00”, “last_updated”: “2019-05-14T15:17:00.181799+00:00”, “context”: {“id”: “123cdadf3ae04e78asdf16e440aaf4dd”, “parent_id”: null, “user_id”: null}}}’, ‘LOCAL’, ‘2019-05-14 15:17:00.181881’, ‘2019-05-14 15:17:00.196459’, ‘123cdadf3ae04e78asdf16e440aaf4dd’, None)]
(Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation)
2019-05-14 11:17:00 ERROR (Recorder) [homeassistant.components.recorder] Error saving event: <Event state_changed[L]: entity_id=device_tracker.life360_willy_wonka, old_state=<state device_tracker.life360_willy_wonka=home; source_type=gps, latitude=23.7413666, longitude=-56.1645602, gps_accuracy=15, battery=74, address=None, at_loc_since=2019-05-13T22:45:19-04:00, battery_charging=True, driving=False, last_seen=2019-05-14T11:11:09-04:00, moving=False, raw_speed=0, speed=0, wifi_on=True, friendly_name=life360 tom myers, entity_picture=https://www.life360.com/img/user_images/4d436471-2b48-417f-bddb-687be4ec4250/751d6b24-338e-493b-b895-807a4a4b2b12.png?fd=2 @ 2019-05-14T11:08:09.875642-04:00>, new_state=<state device_tracker.life360_willy_wonka=home; source_type=gps, latitude=23.7413699, longitude=-56.1645576, gps_accuracy=15, battery=75, address=None, at_loc_since=2019-05-13T22:45:19-04:00, battery_charging=False, driving=False, last_seen=2019-05-14T11:16:54-04:00, moving=False, raw_speed=0.51, speed=1, wifi_on=True, friendly_name=life360 willy wonka, entity_picture=https://www.life360.com/img/user_images/4d436471-2b48-417f-bddb-687be4ec4250/751d6b24-338e-493b-b895-807a4a4b2b12.png?fd=2 @ 2019-05-14T11:08:09.875642-04:00>>
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1244, in _execute_context
cursor, statement, parameters, context
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 552, in do_execute
cursor.execute(statement, parameters)
sqlite3.DatabaseError: database disk image is malformed
Which to means means that something is wrong with the database possibly but I have no idea how to correct the issue.
Yeah, I have to agree, looks like your database got corrupted somehow. Looks like you’re using sqlite, so maybe just stop HA, then delete the database file. I believe it should be in the HA config directory and be named home-assistant_v2.db. Then restart HA. You’ll of course loose the recent history, but if the database is corrupt… Maybe there’s a way to fix a corrupt sqlite database, but if there is, I don’t know how.
Thanks. I wasn’t sure if I could do that. Will try it out.
When HA starts, if it can’t find the database file, it just creates an empty one. At least it does this for the default sqlite database.
I will have to study it later but removing the database did eliminate the previous issue with the corrupt database. I am still not getting any updates though stating that I am anything other than Away at this point. I restarted the server a couple of times just to see if that would help. I do appreciate the insight though. Thanks
Set logger to debug and you should see messages from life360 in home-assistant.log that should help you understand what it’s doing. What does the Life360 app or website show for you? Are you using Life360 on an Android or iOS phone?
The debugger was error free at startup since erasing the old database. The app and website are still, and have been, working just fine. That’s what was puzzling to me. I wasn’t sure if one of the most recent updates changed it a little or not.
I’m not talking about errors. I’m suggesting you configure the system to output additional debug messages to home-assistant.log so that you can get more insight into what life360 in HA is doing. See logger. Either set the default to debug, or at least you need to set debug for custom_components.life360
.
That’s what I figured you meant and my logger is already set with that parameter in it. I’ll just have to go through it tomorrow when I get home. I’m at work now. Thanks for the insight though.
Just wanted to let you know that everything is back to normal. The main issue was the database and that took care of everything. Thanks again so much for your help and hopefully this will help others.
I have this error on a device
2020-02-22 12:32:53 WARNING (SyncWorker_8) [homeassistant.components.life360.device_tracker] life360_namedevice: Ignoring update because timestamp is older than last timestamp
How resolve it?
That’s not an error, it’s a warning. What version of Home Assistant are you using?
i use latest version
So you mean 0.105.5?
Home Assistant 0.105.5
Ok, thanks.
Well, each query response from the Life360 contains a timestamp indicating when the location information last changed. Since the server is polled on a periodic basis, most of the time the timestamp stays the same from query to query (because the location information has not changed.) The timestamp will only change when there really is a new location available.
So on consecutive responses from the server the timestamp should either be the same (no new location data), or newer (there is new location data.)
That warning is issued if the timestamp is older than the previous timestamp. That should never happen, but apparently does sometimes.
It’s just a warning, and as long as the device tracker seems to update when it should, you can just ignore it.
Do you only see this warning once in a while, or often? Is there any kind of pattern?
FWIW, I never see it.
Could it be that the device does not update the position at life 360 and the query to the life360 service responds with the last position it knows?