hahn-th / homematicip-rest-api

A python wrapper for the homematicIP REST API (Access Point Based)
https://hahn-th.github.io/homematicip-rest-api/
GNU General Public License v3.0
218 stars 63 forks source link

Max retries exceeded with url #337

Closed Scuby4ever closed 4 years ago

Scuby4ever commented 4 years ago

HI since some days I got the following log entry when trying to get the current status of my homemtic devices:

Traceback (most recent call last): File "/etc/openhab2/automation/jsr223/01_homematic/heizungbuerooben.py", line 18, in main() File "/etc/openhab2/automation/jsr223/01_homematic/heizungbuerooben.py", line 15, in main home.get_current_state() File "/home/openhab/.local/lib/python3.6/site-packages/homematicip/home.py", line 291, in get_current_state json_state = self.download_configuration() File "/home/openhab/.local/lib/python3.6/site-packages/homematicip/home.py", line 281, in download_configuration "home/getCurrentState", json.dumps(self._connection.clientCharacteristics) File "/home/openhab/.local/lib/python3.6/site-packages/homematicip/base/HomeMaticIPObject.py", line 54, in _restCall return self._connection._restCall(path, body) File "/home/openhab/.local/lib/python3.6/site-packages/homematicip/connection.py", line 50, in _restCall timeout=self._restCallTimout, File "/home/openhab/.local/lib/python3.6/site-packages/requests/api.py", line 119, in post return request('post', url, data=data, json=json, kwargs) File "/home/openhab/.local/lib/python3.6/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/home/openhab/.local/lib/python3.6/site-packages/requests/sessions.py", line 530, in request resp = self.send(prep, send_kwargs) File "/home/openhab/.local/lib/python3.6/site-packages/requests/sessions.py", line 643, in send r = adapter.send(request, kwargs) File "/home/openhab/.local/lib/python3.6/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='srv99.homematic.com', port=6969): Max retries exceeded with url: /hmip/home/getCurrentState (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fa72bc417b8>: Failed to establish a new connection: [Errno 111] Connection refused',)) Traceback (most recent call last): File "/home/openhab/.local/lib/python3.6/site-packages/urllib3/connection.py", line 160, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw) File "/home/openhab/.local/lib/python3.6/site-packages/urllib3/util/connection.py", line 80, in create_connection raise err File "/home/openhab/.local/lib/python3.6/site-packages/urllib3/util/connection.py", line 70, 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 "/home/openhab/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen chunked=chunked) File "/home/openhab/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 344, in _make_request self._validate_conn(conn) File "/home/openhab/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 843, in _validate_conn conn.connect() File "/home/openhab/.local/lib/python3.6/site-packages/urllib3/connection.py", line 316, in connect conn = self._new_conn() File "/home/openhab/.local/lib/python3.6/site-packages/urllib3/connection.py", line 169, in _new_conn self, "Failed to establish a new connection: %s" % e) urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fa72bc417b8>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/openhab/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/home/openhab/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen _stacktrace=sys.exc_info()[2]) File "/home/openhab/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='srv99.homematic.com', port=6969): Max retries exceeded with url: /hmip/home/getCurrentState (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fa72bc417b8>: Failed to establish a new connection: [Errno 111] Connection refused',))

can you help me our here ?

coreGreenberet commented 4 years ago

Connection Refused looks more like an network error here. Are you sure that the script can still access the hmip servers on the high ports? How often are you calling this script? Maybe you are doing it to often and EQ-3 is blocking you here.

Scuby4ever commented 4 years ago

High ports are fine so far.. Do you know what the max frequency of request is ? At the moment I am trying it every 60sec.

coreGreenberet commented 4 years ago

60 seconds should be fine. I have a script running via a cron every minute. So far I haven't had any issues with it