Presence Detection script log errors

Python and python framework

Moderator: leecollings

Post Reply
gschmidt
Posts: 200
Joined: Thursday 20 December 2018 11:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Presence Detection script log errors

Post by gschmidt »

Hi,

Domoticz Beta 4.10304 on a Rpi 3B+

I want to add presence detection in Domoticz.
Since the iDetect plugin is not working for me because I have a router/firewall running pfSense,
I tried the Python script described in https://www.domoticz.com/wiki/Presence_detection
This python script is working:
When the Phone is not present in the network the virtual Switch is set to OFF
When the Phone is present in the network the virtual Switch is set to ON

But When I look at the domoticz LOG I see the following error:

Code: Select all

2019-01-03 12:48:07.893 Error: EventSystem: Failed to execute python event script "/home/pi/domoticz/scripts/python/check_device_online.py"
2019-01-03 12:48:07.893 Error: EventSystem: File "/home/pi/domoticz/scripts/python/check_device_online.py", line 56
2019-01-03 12:48:07.893 Error: EventSystem: print datetime.datetime.now().strftime("%H:%M:%S") + "- pid file exists"
2019-01-03 12:48:07.893 Error: EventSystem: ^
2019-01-03 12:48:07.893 Error: EventSystem: SyntaxError: invalid syntax 
I think it has to do with the python version (I am running 2.7.13-2) but only the part to check if another instance of the script is running (pid)
When I check if the script work in LXTerminal I get the following message, which seems OK

Code: Select all

pi@Domotica-Pi:~ $ cd /home/pi/domoticz/scripts/python/
pi@Domotica-Pi:~/domoticz/scripts/python $ python check_device_online.py 192.168.1.70 19 10 30
13:15:03- pid file exists
13:15:03- script seems to be still running, exiting
13:15:03- If this is not correct, please delete file check_device_online.py_192.168.1.70.pid
pi@Domotica-Pi:~/domoticz/scripts/python $ 
Did somebody already manage to update the script without errors?

Greetzzz,

Gerben
unclekoen
Posts: 21
Joined: Saturday 27 October 2018 11:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Presence Detection script log errors

Post by unclekoen »

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest