Hi,
Great work on this. much better than Owntracks. just a question, how do i pull the battery % out to display on the frontend. sorry for the stupid question, but still new.
Hi,
Great work on this. much better than Owntracks. just a question, how do i pull the battery % out to display on the frontend. sorry for the stupid question, but still new.
Use a Template Sensor.
sensor:
- platform: template
sensors:
dev_battery:
friendly_name: My Device Battery
value_template: "{{ state_attr('device_tracker.ME', 'battery') }}"
unit_of_measurement: '%'
device_class: battery
Hi, thanks for the brilliant platform! when installing iām getting this error
SyntaxError: invalid syntax Fatal error while loading config: invalid syntax (life360.py, line 7) Failed config General Errors: - invalid syntax (life360.py, line 7) Successful config (partial)
Thank you
My guess is you didnāt copy the file correctly from the github page. If you havenāt done this before, make sure you click the āRawā button to get the raw text of the file. Iām guessing you copied the HTML page source instead.
Hi
Thank you so much. Work 100%.
Thank you that was the issue. I had initially right clicked the files and saved them to the directory but saving as raw worked!
Released 2.2.0
Low level communications module (i.e., custom_components/life360.py) moved to the official Python Package Index (PyPI.)
If youāve already been using this custom component, after upgrading, you can remove custom_components/life360.py. If you havenāt used this custom component before, then installation is a bit simpler than before (since there is now only one file to install ā specifically, custom_components/device_tracker/life360.py.)
@DrZzs, I had been planning to move the one file to PyPI for a while. If I had known you were creating that excellent video, I would have expedited the move. (I hadnāt ever published to PyPI before, so I had to get through those details.)
If anyone runs into any trouble using this new version (and indirectly the module from PyPI), by all means, let me know ASAP!
Hi @pnbruckner thanks for the great work. I knew about your component in @DrZzs 's video.
Just a question, I followed his video before I found this thread, so I put life360.py also outside device_tracker folder. It seems everything is working, but should I remove that file and keep just the ādevice_trackerā one? Many thanks!
HI @pnbruckner - thanks for the work and dedication with this project!
Iāve just tried the new install - installed the life360 communications component from PyPI with a
sudo -H pip install "life360"
Then added the device_tracker section to my configuration.yaml file, but when I check the config in the web ui, I get " Configuration invalid Platform not found: device_tracker.life360" - my device tracker section looks like this:
device_tracker
- platform: life360
username: valid username
password: valid password
prefix: life360
show_as_state: driving, moving, places
driving_speed: 20
max_gps_accuracy: 200
max_update_wait:
minutes: 30
Any ideas on what I might try?
There used to be two different files named life360.py, one that went in custom_components, and the other went in custom_components/device_tracker. Now thereās only the one that goes in custom_components/device_tracker. You no longer need the one that went directly in custom_components, so you can delete it (although leaving it there wonāt hurt anything.)
You do not need to manually install the package from PyPI. Home Assistant will take care of that automatically. And, FWIW, as I understand it, you should never install with pip using sudo. You may want to run the same command (stop HomeAssistant first), the same way (i.e., with sudo), but change install to uninstall.
Next you need to install my life360.py custom platform (from my github repo) into your HA config folder (in additional folders inside the config folder that you will probably have to manually create, namely custom_components/device_tracker) per the instructions on my github page. Then when you start Home Assistant it should work. Although, I generally recommend using the Custom Updater custom component rather than manually installing my custom component. Once you get Custom Updater installed and working, you can use it to install my custom component. Again, see my github repo for instructions.
Iām getting this error:
āget_circles: ReadTimeout: HTTPSConnectionPool(host=āapi.life360.comā, port=443): Read timed out. (read timeout=11.0)ā
Any tip?
Comm errors are not uncommon. If you get a zillion of them, and the device_trackers arenāt updating, then you might have a problem. Even when there are a lot of comm errors, usually itās working just fine between the errors. If there are too many errors in a row, then youāll see this: Suppressing further errors until OK: ...
. If youāre not seeing that, then it is working between the other errors.
Hi, im using your component and its working very well but i have 2 thing I wonder. The post is so long that i donāt know if it was anwered already.
First, when i look at my tracker info, i see that the āaddressā is null even if it shows correctly on life360 app.
Second the data for āat loc sinceā and ālast seenā on the tracker are not following my timezone, can we change that ? It shows as ā> 2018-11-23T15:45:35+00:100:
Thank you in advance.
Hi, i donāt know if this is mentioned already but other people in my circle donāt show up if there away from home ? there only showing up when there home otherwise the dissapear.
******* problem Dissapeared??? ******
This is part Home Assistantās generic device tracker behavior. Mainly itās for device tracker implementations that can only show āhomeā and ānot homeā like various wifi device trackers. Youāll need to edit your known_devices.yaml file to change that.
Thanks Phil, Iāve uninstalled the life360 comms component per your instruction - I already had (but neglected to mention that in my previous post) the life360.ph within the custom_components/device_tracker directory in place.
I am still getting the āConfiguration invalid, Platform not found: device_tracker.life360ā message when I check the config in the HA UI.
Trying to install this and following the instructions in the post #333 above by @stratplayer.
Iāve installed the custom_updater.py in the custom_components directory, added the config for custom_updater per philās github repo, restarted HA and the custom_updater.install service is then available in the drop down.
Then I run that service with service data = {āelementā:ālife360ā} then run the same with {āelementā:ādevice_tracker.life360ā}
I get the following errors in the log:
2018-11-25 15:41:58 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall custom_updater.install (c:f51af2dc5e404ce6b2a1a481a5c03d1e): element=life360>
Traceback (most recent call last):
File "/usr/src/app/homeassistant/core.py", line 1185, in _event_to_service_call
await self._hass.async_add_executor_job(execute_service)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/app/homeassistant/core.py", line 1182, in execute_service
service_handler.func(service_call)
File "/config/custom_components/custom_updater.py", line 104, in install_service
card_controller.install(element)
NameError: free variable 'card_controller' referenced before assignment in enclosing scope
2018-11-25 15:42:23 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall custom_updater.install (c:32a496bdb58f4b588c12bf82fe6e25dc): element=device_tracker.life360>
Traceback (most recent call last):
File "/usr/src/app/homeassistant/core.py", line 1185, in _event_to_service_call
await self._hass.async_add_executor_job(execute_service)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/app/homeassistant/core.py", line 1182, in execute_service
service_handler.func(service_call)
File "/config/custom_components/custom_updater.py", line 104, in install_service
card_controller.install(element)
NameError: free variable 'card_controller' referenced before assignment in enclosing scope
What am I missing?
First, those instructions are old (believe it or not! ) The first āelementā (life360) does not need to be installed manually/directly. You just need to install element device_tracker.life360. The other part should be installed automatically from the PyPI by HA when you restart (or I think the custom updater will do install it prior to restarting HA. Either way you shouldnāt have to.)
Next, that error is an issue with the custom updater. You should go to its issues page for help with that.
Unfortunately it can only show what the Life360 server provides. If address is null itās because the server isnāt providing an address.
Like most components in HA, datetimes are shown in UTC. But, as long as they are timezone āawareā datetimes, it really shouldnāt matter which timezone they are shown in. I suppose I could add an optional feature to show datetimes in the local timezone. See issue #69.