Python Plugin: Life 360 Presence Detection (deprecated)

Python and python framework

Moderator: leecollings

User avatar
Minglarn
Posts: 214
Joined: Friday 21 August 2015 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Stockholm / Sweden
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by Minglarn »

febalci wrote: Wednesday 13 February 2019 16:58
Minglarn wrote: Wednesday 13 February 2019 16:05 Hi!

Love the plugin... However... my phyton knowlege is kinda zero..

How do I trunc the text to just contain the first sentence before the first "," ...

I just want the "Sicklatunneln" ... the rest is just to much info :)
Looks easy. Open the plugin.py in a text editor go to:
Line 212:
Under

Code: Select all

currentstat2, currentloc = a.getaddress(self.tomtomapikey,self.circleLatitude,self.circleLongitude)
add:

Code: Select all

currentloc = currentloc.split(',',1)[0]


and the same on line 217. This assumes all your addresses are in the format like xxxx, xxxx, xxxx, xxxx and so theis command gets the first text before the first comma. Also these added lines should start on the same column with their previus lines and you should go there by pressing space bar, not tab... Like:

Code: Select all

                            if self.tomtomapikey != 'Empty':
                                currentstat, currentmin = a.getdistance(self.tomtomapikey,self.circleLatitude,self.circleLongitude,self.myHomelat,self.myHomelon)
                                currentstat2, currentloc = a.getaddress(self.tomtomapikey,self.circleLatitude,self.circleLongitude)
                                currentloc = currentloc.split(',',1)[0]
Nice...
but it seems that there is no consistency with the location adresse...
Is it possible to truncate the line to ... lets say...20chars and end it with "..." ?
When you eliminate the impossible, whatever remains, however improbable, must be the truth.” -Spock in Star Trek VI
febalci
Posts: 331
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 »

Minglarn wrote: Tuesday 26 February 2019 16:05
Nice...
but it seems that there is no consistency with the location adresse...
Is it possible to truncate the line to ... lets say...20chars and end it with "..." ?
So, instead of:

Code: Select all

currentloc=currentloc.split(‘,’,1)[0]
Use:

Code: Select all

currentloc=currentloc[0:20]+’...’
User avatar
Minglarn
Posts: 214
Joined: Friday 21 August 2015 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Stockholm / Sweden
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by Minglarn »

Great support...

Again... Thanks for the plugin.. Great job!
When you eliminate the impossible, whatever remains, however improbable, must be the truth.” -Spock in Star Trek VI
User avatar
Minglarn
Posts: 214
Joined: Friday 21 August 2015 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Stockholm / Sweden
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by Minglarn »

Did not work...
Well it works if I dont use TomTom maps... :)

When using TomTom is still shows me the whole line...
When you eliminate the impossible, whatever remains, however improbable, must be the truth.” -Spock in Star Trek VI
febalci
Posts: 331
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 »

pls send me your current plugin.py, i will fix it for you.
User avatar
Minglarn
Posts: 214
Joined: Friday 21 August 2015 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Stockholm / Sweden
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by Minglarn »

PM sent.
When you eliminate the impossible, whatever remains, however improbable, must be the truth.” -Spock in Star Trek VI
febalci
Posts: 331
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 »

Minglarn wrote: Wednesday 27 February 2019 9:29PM sent.
PM broken, can not send...

Try this plugin.py:
https://drive.google.com/file/d/1s1QSZr ... sp=sharing
User avatar
Minglarn
Posts: 214
Joined: Friday 21 August 2015 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Stockholm / Sweden
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by Minglarn »

And as usual... Perfect!

Thanks!
464.JPG
464.JPG (17 KiB) Viewed 3347 times
When you eliminate the impossible, whatever remains, however improbable, must be the truth.” -Spock in Star Trek VI
WarLion
Posts: 15
Joined: Thursday 08 December 2016 6:38
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by WarLion »

hi guys , i got a problem here, everytime someone from my circle or me leave the Home get this error message

Code: Select all

 2019-02-27 16:04:41.395 (life360) Checking Life360 Circle...
2019-02-27 16:04:47.544 Error: (life360) 'onHeartbeat' failed 'IndexError':'list index out of range'.
2019-02-27 16:04:47.545 Error: (life360) ----> Line 294 in '/home/warlion/domoticz/plugins/DomoticzLife360/plugin.py', function onHeartbeat
2019-02-27 16:04:47.545 Error: (life360) ----> Line 216 in '/home/warlion/domoticz/plugins/DomoticzLife360/plugin.py', function onHeartbeat 
any idea whats wrong on my installation

thanks
febalci
Posts: 331
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 »

WarLion wrote: Wednesday 27 February 2019 23:06 hi guys , i got a problem here, everytime someone from my circle or me leave the Home get this error message
any idea whats wrong on my installation

thanks
Hi warlion,
If you are using version 2.3.1, Your error refers to something wrong with your locations.txt file. I suppose you use OSM, not Tomtom... Do you have any locations listed in locations.txt?

EDIT: I managed to recreate this error by adding an extra empty line in locations.txt file. So, please check this file and delete empty lines...
WarLion
Posts: 15
Joined: Thursday 08 December 2016 6:38
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by WarLion »

febalci wrote: Thursday 28 February 2019 8:11 Hi warlion,
If you are using version 2.3.1, Your error refers to something wrong with your locations.txt file. I suppose you use OSM, not Tomtom... Do you have any locations listed in locations.txt?

EDIT: I managed to recreate this error by adding an extra empty line in locations.txt file. So, please check this file and delete empty lines...

thanks febalci i notice a new line on my locations.txt i removeit will give it a try with a fake gps , and i post any result , thanks mate
superustas
Posts: 15
Joined: Monday 29 January 2018 13:53
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by superustas »

A few days ago, for some reason, the plugin stopped working normally. Apparently, after the update.

In the error logs (constantly repeated):
Spoiler: show
2019-04-22 21:21:34.527 Error: (Life360) 'onHeartbeat' failed 'ValueError':''Alexey' is not in list'.
2019-04-22 21:21:34.527 Error: (Life360) ----> Line 294 in /home/ustas/domoticz/plugins/Life360/plugin.py, function onHeartbeat
2019-04-22 21:21:34.527 Error: (Life360) ----> Line 182 in /home/ustas/domoticz/plugins/Life360/plugin.py, function onHeartbeat
immediately after launch:
Spoiler: show
2019-04-23 13:24:55.853 Error: (Life360) 'onStart' failed 'FileNotFoundError'.
2019-04-23 13:24:55.853 Error: (Life360) ----> Line 266 in /home/ustas/domoticz/plugins/Life360/plugin.py, function onStart
2019-04-23 13:24:55.853 Error: (Life360) ----> Line 105 in /home/ustas/domoticz/plugins/Life360/plugin.py, function onStart
Sometimes updated information about the battery level.
2019-04-22_21-22-54.png
2019-04-22_21-22-54.png (167.14 KiB) Viewed 3101 times

Domoticz - 4.9701
Python - 3.5.2
Life 360 Presence Detection - v2.3.1
superustas
Posts: 15
Joined: Monday 29 January 2018 13:53
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by superustas »

Full re-install plugin and all work fine!
tomigonzo
Posts: 4
Joined: Tuesday 05 February 2019 11:13
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by tomigonzo »

HI,

it could work in Synology/Domoticz V4.10717/Python3.5.1 -0108 ?
The files had been copied to the domoticz/plugins foldar, but i can't find the plugin in the hardware list.
febalci
Posts: 331
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 »

tomigonzo wrote: Wednesday 19 June 2019 17:02 HI,

it could work in Synology/Domoticz V4.10717/Python3.5.1 -0108 ?
The files had been copied to the domoticz/plugins foldar, but i can't find the plugin in the hardware list.
Did you restarted Domoticz service?
tomigonzo
Posts: 4
Joined: Tuesday 05 February 2019 11:13
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by tomigonzo »

sure
febalci
Posts: 331
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 »

tomigonzo wrote: Wednesday 19 June 2019 22:52sure
There could be a number of issues but i highly doubt it is on the plugin part; but instead on domoticz Synology side:
1. Is the domoticz version on your Synology a Python plugin supported version?
2. Is there any other Python plugin working on your installation?
3. As far as i remember there were 2 folders on Synology; one was in "/volume1/@appstore/domoticz/plugins" and the other was in "/usr/somethingsomething...". Only one of these folders were working as plugin installaton folder.
4. The life360 plugin files might be corrupted on download, check it with a text editor...
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by poudenes »

Hi All,

I get this error after I add a new user in the Circle:

Code: Select all

2019-06-20 12:29:41.229  (Life360) Checking Life360 Circle...
2019-06-20 12:29:43.412  Error: (Life360) 'onHeartbeat' failed 'ValueError':''Peter NS' is not in list'.
2019-06-20 12:29:43.412  Error: (Life360) ----> Line 294 in '/home/pi/domoticz/plugins/Life360/plugin.py'
2019-06-20 12:29:43.413  Error: (Life360) ----> Line 182 in '/home/pi/domoticz/plugins/Life360/plugin.py'

2019-06-20 12:29:52.933  (Life360) Checking Life360 Circle...
2019-06-20 12:29:55.146  Error: (Life360) 'onHeartbeat' failed 'ValueError':''Peter NS' is not in list'.
2019-06-20 12:29:55.146  Error: (Life360) ----> Line 294 in '/home/pi/domoticz/plugins/Life360/plugin.py'
2019-06-20 12:29:55.146  Error: (Life360) ----> Line 182 in '/home/pi/domoticz/plugins/Life360/plugin.py'
Removed the hardware and add it again. The error is gone.
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
tomigonzo
Posts: 4
Joined: Tuesday 05 February 2019 11:13
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by tomigonzo »

febalci wrote: Thursday 20 June 2019 10:32
tomigonzo wrote: Wednesday 19 June 2019 22:52sure
There could be a number of issues but i highly doubt it is on the plugin part; but instead on domoticz Synology side:
1. Is the domoticz version on your Synology a Python plugin supported version?
2. Is there any other Python plugin working on your installation?
3. As far as i remember there were 2 folders on Synology; one was in "/volume1/@appstore/domoticz/plugins" and the other was in "/usr/somethingsomething...". Only one of these folders were working as plugin installaton folder.
4. The life360 plugin files might be corrupted on download, check it with a text editor...
1, is there Python plugin NON-supported version?
2, noit should be the first one.
3, there are same, linked/mirrored folders
4, i going to check it, but it could be ok
febalci
Posts: 331
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 »

tomigonzo wrote: Friday 21 June 2019 18:40 1, is there Python plugin NON-supported version?
2, noit should be the first one.
3, there are same, linked/mirrored folders
4, i going to check it, but it could be ok
Jadahl distributes Synology Domoticz packages as Domoticz stable for DSM 6.2 and Domoticz Stable for DSM 6.2 with Python. You cannot run any python plugins with the first one: http://jadahl.dscloud.me/ Also, you have to install Python 3.x on Synology. Anyway, please try some other plugin, if it is also not working, there is a problem with your Domoticz or Python installation, not with the plugin itself.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests