Thorgal789 wrote: ↑Saturday 19 October 2019 19:11
To create a key
Code: Select all
python3 API_KEY.py <ip>:<port> create
With same ip and port you have set in the plugin.
Did that, the reply was:
pi@RaspberryPI-Domoticz:~/domoticz/plugins/Domoticz-deCONZ $ python3 API_KEY.py 127.0.0.1:80 create
Traceback (most recent call last):
File "/usr/lib/python3.4/urllib/request.py", line 1174, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.4/http/client.py", line 1142, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.4/http/client.py", line 1180, in _send_request
self.endheaders(body)
File "/usr/lib/python3.4/http/client.py", line 1138, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.4/http/client.py", line 963, in _send_output
self.send(msg)
File "/usr/lib/python3.4/http/client.py", line 898, in send
self.connect()
File "/usr/lib/python3.4/http/client.py", line 875, in connect
self.timeout, self.source_address)
File "/usr/lib/python3.4/socket.py", line 509, in create_connection
raise err
File "/usr/lib/python3.4/socket.py", line 500, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "API_KEY.py", line 25, in <module>
response = request.urlopen(req,timeout=3).read()
File "/usr/lib/python3.4/urllib/request.py", line 153, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.4/urllib/request.py", line 455, in open
response = self._open(req, data)
File "/usr/lib/python3.4/urllib/request.py", line 473, in _open
'_open', req)
File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(*args)
File "/usr/lib/python3.4/urllib/request.py", line 1202, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.4/urllib/request.py", line 1176, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "API_KEY.py", line 33, in <module>
elif e.code == 403:
AttributeError: 'URLError' object has no attribute 'code'