Present Detection error in script

Python and python framework

Moderator: leecollings

Post Reply
Ressler
Posts: 3
Joined: Wednesday 11 September 2019 9:43
Target OS: -
Domoticz version:
Contact:

Present Detection error in script

Post by Ressler »

Hello everyone,,
I'm trying to run the present detection script provided by domoticz

It always starts with the phone is offline when running in a putty window:

command: python check_device_online.py 192.168.1.50 44 10 30

and this is the response:

20:56:36- script started.
20:56:36- according to domoticz, 192.168.1.50 is offline
20:56:37- 192.168.1.50 offline, waiting for it to come back
20:57:00- 192.168.1.50 online, tell domoticz it's back
Traceback (most recent call last):
File "check_device_online.py", line 117, in <module>
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command&param=switchlight&idx=" + switchid + "&switchcmd=On&level=0" + "&passcode=" + domoticzpasscode)
File "check_device_online.py", line 96, in domoticzrequest
response = urllib2.urlopen(request)
File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 400: Bad Request
The logfile states it is offline and then online:
10.0.0.0.1 192.168.1.254 hotmail.com
19:48:26- according to domoticz, 192.168.1.50 is offline
19:48:43- 192.168.1.50 offline, waiting for it to come back
19:49:29- 192.168.1.50 online, tell domoticz it's back

Question is why is it offline and then online and where does the error come from.The switches in domoticz are not turned on.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest