Python Plugin: Life 360 Presence Detection

Python and python framework
User avatar
capman
Posts: 195
Joined: Friday 12 July 2013 20:48
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Belgium
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by capman » Sunday 15 April 2018 20:04

I get this error in my log :(
Is this a domoticz , python or life360 problem.
Running domoticz beta v 3.9208 on a synology.
life360.JPG
life360.JPG (111.15 KiB) Viewed 748 times

febalci
Posts: 317
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by febalci » Sunday 15 April 2018 22:13

Could be an authentication problem with life360: (Because of the HTTPError detail)
1. Enable Debug
2. Leave Google api key empty (to make sure the problem is in life30, not google)
3. don't forget to write your email address as life360 username, not only the username itself but includes @somethingemail.com. you can check your credentails from life360 web page login.

Maybe debug option can give more details.

User avatar
heggink
Posts: 482
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi
Domoticz version: V3.9530
Location: NL
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by heggink » Monday 16 April 2018 10:03

I noticed the same and it's gone now. I suspect it was an issue with L360 itself.
Pi3, latest beta
RFXCOM, z-wave (AEOTEC, switches, temhum, pir, contacts),
Plugwise2py, P1 'smart'meter & solar panel
Alexa, Wifi Cams motion detection
ESP: relays, PIR & Temp/TempHum
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest

User avatar
capman
Posts: 195
Joined: Friday 12 July 2013 20:48
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Belgium
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by capman » Tuesday 17 April 2018 20:09

Yes , it's gone. Like you suspect , it was a issue with Life360.
Thanks ;)

l00pz
Posts: 54
Joined: Wednesday 01 April 2015 11:52
Target OS: Linux
Domoticz version: Beta
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by l00pz » Tuesday 05 June 2018 20:32

I'm really happy with this Plug-in as its way more stable then the Geofencing from the Domoticz App or Domofence :D But is it possible to increase the poll period to something lower then 60 seconds? I don't want to make the Life360 Circle to big, but when I make the Circle like 500M the time from opening the door and the time that Domoticz Updates the Life360 plug-in sometimes gives me false alarms. Making the Circle bigger is one solution of course, but if it's possible the lower the poll period to like 30 seconds that would be great.

g00fy
Posts: 10
Joined: Friday 08 September 2017 8:27
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Dordrecht, The Netherlands
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by g00fy » Tuesday 17 July 2018 17:11

Does anyone know what the usage of the Google api means concerning the new pricing policy Google anounced? I see in my case there were more than 44.000 cals on the geocoding api in the last 30 days (I was running an older version, so the cals on the distance api were not counted yet). This means that there will be about 88.000 cals a month when using these features, resulting in a bill of around $240 (not including the free $200 we get from Google).

As I look in the code it seems the api's are contacted every time life360 is contacted. Isn't it possible to limit this to only the times the location from life360 is updated? I supose this will result in a much lower count of api cals?

febalci
Posts: 317
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by febalci » Wednesday 01 August 2018 20:42

Unfortunately Google's new pricing policy on Maps API is causing errors on the plugin due to exceeding daily free query quota. I have to change the usage of Google's maps api to something else due to the continuation of free usage for this plugin. The current alternatives are Yandex and waze. If i can extract any information from life360, that will also be a solution. Thanks for your patience...
PS: The free version of Yandex is 25.000 calls per day.
PS2: Yandex doesnot have a traffic API
PS3: Google Directions API is still working without a key, but there's only duration info there (when there is no traffic), not duration_in_traffic...
PS4: Waze maps are still not sufficient for many countries.
PS5: I should give up adding PSs.

g00fy
Posts: 10
Joined: Friday 08 September 2017 8:27
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Dordrecht, The Netherlands
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by g00fy » Thursday 02 August 2018 18:02

I did write a little change to your code that makes it possible to use Open Streetmaps as source, using Nominatum for the API.
At the moment Iam on holidays using it and it seems to work reasonably well for getting your location.

One thing to look into is the usage policies of Nominatim. It wants you to 'provide a valid HTTP Referer or User-Agent identifying the application'. For testing I used Domoticz-geofence for now, but I don't know if that will be right.

It looks like I can't upload the code via Tapatalk, so I will try to sent it to you in a message. Hopefully it will getting you forward in a solution replacing Google Maps.

PS I am not a software developer, so please feel free to change the code when you think it can be done better...

Verstuurd vanaf mijn TA-1012 met Tapatalk


febalci
Posts: 317
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by febalci » Thursday 02 August 2018 22:27

g00fy wrote:
Thursday 02 August 2018 18:02
I did write a little change to your code that makes it possible to use Open Streetmaps as source, using Nominatum for the API.
At the moment Iam on holidays using it and it seems to work reasonably well for getting your location.

One thing to look into is the usage policies of Nominatim. It wants you to 'provide a valid HTTP Referer or User-Agent identifying the application'. For testing I used Domoticz-geofence for now, but I don't know if that will be right.

It looks like I can't upload the code via Tapatalk, so I will try to sent it to you in a message. Hopefully it will getting you forward in a solution replacing Google Maps.

PS I am not a software developer, so please feel free to change the code when you think it can be done better...

Verstuurd vanaf mijn TA-1012 met Tapatalk
Actually getting the address from coordinates is easy, since google maps API doesnt need a key for that. I will change the code according to that next week. The problem is with the traffic data; i may completely take it out.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests