Open the Life360 app on your phone, it sounds like it is just taking time for it to register
Ok. I’ll try. Another thing, it doesnt show up in HA.
edit: It worked Now I get “charge 1”. But I cant see it in HA.
You probably need to add a mqtt sensor
# Example configuration.yml entry
sensor:
- platform: mqtt
state_topic: "owntracks/ohman92/your_phone" // <- This needs your mqtt path
name: "Charging"
value_template: '{{ value_json.charge}}'
That one is new to me, sorry. You could probably find someone else in the community that has run into this though because I’m sure you aren’t the first to run into special characters in your name.
@editter
I got it to work But, I dont want to open the app in my phone to make it register. Can I make this better somehow?
Unfortunately you will probably need to just wait for Life360 to register it. I know there have been a few times that I am listening to music on my phone while I was coming home which prevented Life from updating and in turn delayed HA from registering that I was home but shortly after that it picked it up fine.
I am not really sure. I know Android has a few different things but ultimately it is up to the OS to notify apps and then the app needs to send information when it changes so I feel like you will run into similar issues with other apps. You might be able to set the priority of the Life360 app somewhere to have it update more frequently however I don’t have an iPhone so that’s just a guess.
I am curious what you are trying to do off of the charging status, care to share?
Ok. I looked after something to change to make the app work in the background but didnt find anything.
I want to turn off all my lamps when I charge my phone and if it’s later than 22:00.
(when going to sleep).
BruhAutomation did a YouTube video where he demoed something like that and I am pretty sure he was using an app called Tasker but I don’t think there is an equivalent app for iPhone but google would know better than I would
1.) Thanks for putting this add-on together!
2.) Can you help me understand how to pull is_charging into automations when using HTTP? I can’t figure out how to access that particular value as an attribute…
3.) Is it possible to pull in some of the other valuable info returned by their API? e.g. address1, inTransit, wifiState, speed, and isDriving, in particular? Forgive my ignorance on exactly how everything works, but if is_charging is getting pushed into the attributes argument of HA’s known_devices API, wouldn’t it be pretty straightforward to include other key/value pairs as part of that dict?
4.) The webhook functionality doesn’t appear to be working for me. I have host_url set to “https://xxxxxxx.duckdns.org”, and I can access the webhook URL without issue, but all updates pulled in for our devices appear to be based on the polling routine. Any tips?
- No problem
- I released a fix in version 0.0.9 so you should be able to access it like normal attributes when using HTTP. EX.
- id: test_automation
alias: Simple Test Automation
trigger:
- platform: time
at: '3:00:00'
action:
- service: notify.pushbullet_notification
data_template:
title: '{{ states.device_tracker.eric_phone.attributes.is_charging }}'
- I added the fields you requested and they are reflected in the readme on github
- Now that you mention it I haven’t seen this fire recently, however, I haven’t been paying as much attention so I will take a look tomorrow. One thing I noticed with the webhooks was that life 360 areas had to align with HA areas perfectly and they seemed to be in different measurements so it wasn’t a copy and paste of values…long story short I don’t use the webhooks much anymore and instead, I have increased the zone around my house in HA. In anycase I will take a look
Increasing the HA zone size is a good workaround. Cheers for the quick update!
Nice! I just added to my Hassio. but I need to check some ERR…
“cert_file”: “fullchain.pem”,
“key_file”: “privkey.pem”,
are they mandatory??
But nice job! thanks!
Yes, as of right now they are mandatory because of the webhook. I have been meaning to remove that requirement however I haven’t gotten to it
I removed the requirement and you should see that reflected in version 0.0.10
It should be done building in about 10 minutes
Hi,
I am getting this error:
nfo: No previous state found, setting to defaults.
3/8 9:54:47 pm - error: Error getting initial token request. Ending process
3/8 9:54:47 pm - error: Error: Request failed with status code 403
What’s that problem? I think i hav filled in eveything correctly
My first thought is that it’s a username/password problem. Can you post your configs (remember to remove all sensitive info as well)
@editter Thanks for this Hassio Add-On…
I think I’ve got everything set up correctly, but I’m still new to MQTT and understanding how HA receives the message. I see in the add-on that messages are being written, but I’m not sure how HA gets updated with home or away. Any help would be appreciated.
The States tool shows the entity for my phone as “not_home” - but I’m here… thanks in advance for any clarification.