I'm trying to run the present detection script provided by domoticz : http://www.domoticz.com/wiki/Presence_detection
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¶m=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:
19:48:26- script started.
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.
Present Detection error in script
Moderator: leecollings
-
- Posts: 331
- Joined: Wednesday 21 December 2016 9:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Contact:
Re: Present Detection error in script
Perhaps it's related to: viewtopic.php?f=6&t=22012&p=171692#p171692
-
- Posts: 22
- Joined: Wednesday 05 October 2016 7:46
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Present Detection error in script
Tried changing the python version and this did not help.
Who is online
Users browsing this forum: No registered users and 1 guest