Python Plugin: Life 360 Presence Detection (deprecated)

Python and python framework

Moderator: leecollings

User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by EdwinK »

EdwinK wrote: Thursday 23 November 2017 17:27
febalci wrote: Wednesday 22 November 2017 8:13
Edwin, do you have something like this error in the beginning of your logfile?

Code: Select all

PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
I can't check it at the moment. The second I activate one of the mentioned scripts, Domoticz stops working and will not continue before removing the plugins again.
Checked at last, but I don't have that line in the logs.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by EdwinK »

Checked again, and got

Code: Select all

EventSystem: reset all events...
2017-11-29 21:43:40.101 PluginSystem: Started, Python version '3.5.3'.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
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 »

EdwinK wrote: Thursday 23 November 2017 18:26 Giving up for now.

Screen Shot 2017-11-23 at 18.25.39.png
Dear Edwin,
I believe you also tried 1.0.4 i uploaded today. If it is still the same;
I believe your situation is not directly related to the plugin itself but your domoticz installation if you still have that "Problem retrieving devices". I suggest:
1. Clearing your browser cache while the plugin is not installed and try installing again.
2. As I recall you also have a problem with another plugin maybe buienradar, it sounds like you might have a problem with the devices in domoticz database. If it is so, you either try to fix it by using sqlite or some other tool, or worst case scenario backup your db, delete it and recreate from scratch. But since i know it is a long and tedious approach, if i were you, i would only do it if you have some other serious problems with domoticz database.
If this is not the solution, i really run out of ideas. Good luck.
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by EdwinK »

Thanks. Looks like there is some serious problem with my python installation and domoticz. Will try and figure this out
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Mace
Posts: 65
Joined: Monday 21 August 2017 19:52
Target OS: Windows
Domoticz version: 3.8153
Location: Rhoon
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by Mace »

Here also some problems getting the plugin working. After creating the life360 directory in the plugins section and copying the files to it and finally restarting Domoticz, I don't see it in the hardware list. I do get an error in Domoticz:
PluginList: Parsing '/home/mace/domoticz/plugins/life360/', 'Error document empty.' at line 0 column 0 in XML ''

Running 3.8775
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 »

Try chmod +x with the files under life360 folder, could be permissions problem.
Mace
Posts: 65
Joined: Monday 21 August 2017 19:52
Target OS: Windows
Domoticz version: 3.8153
Location: Rhoon
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by Mace »

Didn't work. All relevant files have 755. After restart same error message and Life360 isn't in the list of hardware.
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 »

Mace wrote: Sunday 10 December 2017 11:09 Didn't work. All relevant files have 755. After restart same error message and Life360 isn't in the list of hardware.
Would you please check if plugin.py is not empty? And do you have any other plugin installed and working? Python Version?
Mace
Posts: 65
Joined: Monday 21 August 2017 19:52
Target OS: Windows
Domoticz version: 3.8153
Location: Rhoon
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by Mace »

plugin.py is same as downloaded file (checked with nano)

I've got NUT_UPS running, also have Buienradar, but that crashes if activated
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 »

Tried 8775 on windows with no problems. Did you also checked life360 folder permissions? And also try 0777 on folder and files.
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 »

Mace wrote: Sunday 10 December 2017 15:22 plugin.py is same as downloaded file (checked with nano)
Think i may have found something; the error "'Error document empty.' at line 0 column 0 in XML" says that the plugin definiton of the plugin.py is not validated correctly. This Part of the plugin.py:

Code: Select all

"""
<plugin key="Life360" name="Life 360 Presence" author="febalci" version="1.0.4">
    <params>
        <param field="Username" label="Life360 Username" width="150px" required="true" default="username"/>
        <param field="Password" label="Life360 Password" width="150px" required="true" default="password"/>
        <param field="Mode2" label="Poll Period (min)" width="75px" required="true" default="2"/>
        <param field="Mode3" label="Google Maps API Key" width="300px" required="false"/>        
        <param field="Mode6" label="Debug" width="75px">
            <options>
                <option label="True" value="Debug"/>
                <option label="False" value="Normal"  default="true" />
            </options>
        </param>
    </params>
</plugin>
"""
might have something corrupted; that is if you change anything here, before copying the file to life360 directory, there may be problem:

Code: Select all

<param field="Username" label="Life360 Username" default= "test" width="150px" required="true" default="username"/>
For example, here please note that it has 2 default values, test and username; so the xml file in unvalidated with errors. Any missing quotes, or unclosed fields etc. might cause this problem. So, in short, please make sure the beginning of the plugin.py is exactly the same as you downloaded.
Mace
Posts: 65
Joined: Monday 21 August 2017 19:52
Target OS: Windows
Domoticz version: 3.8153
Location: Rhoon
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by Mace »

Turns out something went wrong with downloading the files. Content somehow became the Internetpage code.....
Fixed this, but when I activate the plugin (so set it up in hardware), as soon as the devices are 'made' and I go to the device page, the list of devices is empty and a second later, Domoticz goes off-line.
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 »

Mace wrote: Wednesday 13 December 2017 17:21 Fixed this, but when I activate the plugin (so set it up in hardware), as soon as the devices are 'made' and I go to the device page, the list of devices is empty and a second later, Domoticz goes off-line.
I need a log file with the DEBUG option On to understand what is going on.
Mace
Posts: 65
Joined: Monday 21 August 2017 19:52
Target OS: Windows
Domoticz version: 3.8153
Location: Rhoon
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by Mace »

OK, will get that for you. Will be a couple of days before I have time.
corthebor
Posts: 13
Joined: Friday 16 October 2015 9:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by corthebor »

Hello
Can you explain the next error:

2017-12-17 12:31:27.372 Error: (Life360) 'onHeartbeat' failed 'HTTPError'.

I can't see any device.

Greetings Cor
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 »

I need your Domoticz version and also you better Turn on the debug option, for me to better understand the problem. Did you entered life360 username and password when creating the hardware?
corthebor
Posts: 13
Joined: Friday 16 October 2015 9:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by corthebor »

My domoticz is V3.8153

User and password is filled in.

With debug true:

2017-12-17 21:36:48.633 (Life360) Calling message handler 'onHeartbeat'.
2017-12-17 21:36:48.634 (Life360) onHeartBeat called:0/0
2017-12-17 21:36:48.634 (Life360) Checking Circle...
2017-12-17 21:36:49.105 Error: (Life360) 'onHeartbeat' failed 'HTTPError'.
2017-12-17 21:36:49.105 Error: (Life360) ----> Line 191 in /home/pi/domoticz/plugins/Life360/plugin.py, function onHeartbeat
2017-12-17 21:36:49.105 Error: (Life360) ----> Line 122 in /home/pi/domoticz/plugins/Life360/plugin.py, function onHeartbeat
2017-12-17 21:36:49.105 Error: (Life360) ----> Line 40 in /home/pi/domoticz/plugins/Life360/life360.py, function authenticate
2017-12-17 21:36:49.105 Error: (Life360) ----> Line 29 in /home/pi/domoticz/plugins/Life360/life360.py, function make_request
2017-12-17 21:36:49.105 Error: (Life360) ----> Line 163 in /usr/lib/python3.5/urllib/request.py, function urlopen
2017-12-17 21:36:49.105 Error: (Life360) ----> Line 472 in /usr/lib/python3.5/urllib/request.py, function open
2017-12-17 21:36:49.105 Error: (Life360) ----> Line 582 in /usr/lib/python3.5/urllib/request.py, function http_response
2017-12-17 21:36:49.105 Error: (Life360) ----> Line 510 in /usr/lib/python3.5/urllib/request.py, function error
2017-12-17 21:36:49.105 Error: (Life360) ----> Line 444 in /usr/lib/python3.5/urllib/request.py, function _call_chain
2017-12-17 21:36:49.105 Error: (Life360) ----> Line 590 in /usr/lib/python3.5/urllib/request.py, function http_error_default
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 »

Hello Cor,

life360 does not authenticate your request. Your username-password is wrong. Please put your email address for Life360 username, not only the username itself. You can check the authenticity of your username-password combo from life360 website-Login.
corthebor
Posts: 13
Joined: Friday 16 October 2015 9:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by corthebor »

that's it. Using email address as user-name

Thanks al lot.

Greetings
Cor
g00fy
Posts: 16
Joined: Friday 08 September 2017 8:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Dordrecht, The Netherlands
Contact:

Re: Python Plugin: Life 360 Presence Detection

Post by g00fy »

As we use life360 already for a while I am very interested in this plugin. So, I installed it on the last stable release of Domoticz, I configured a poll interval of 2 minutes and use a Google Maps API key.
It was working for a while (few hours). But then Domoticz started to crash every 3 till 4 hours with this messages in the log:

Code: Select all

2018-01-10 07:58:29.731  Error: Domoticz received fatal signal 11 !...
2018-01-10 07:58:29.733  Error:   /home/pi/domoticz/domoticz() [0x1cdc48]
2018-01-10 07:58:29.733  Error:   /home/pi/domoticz/domoticz(_Z14signal_handleri+0x58) [0x1cdd00]
2018-01-10 07:58:29.733  Error:   /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76aeb180]


Disabling the pugin resulted in normal operation again.

How can I debug this (setting debugging on doesn't give more information in the domoticz log). I would be very pleased to be able to make use of this plugin.

Thanks!
Emile.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest