thomasgermain / pymultiMATIC

Python interface with Vaillant multiMATIC
MIT License
56 stars 11 forks source link

error v 0.0.6 #12

Closed Tomasonx closed 4 years ago

Tomasonx commented 4 years ago

I have some errors in my HA.

Between 2019-12-02 22:00 and 2019-12-03 07:30 I have this error 22 times.

I will post here the last one. I just removed [my_serial_number].

Tomasonx commented 4 years ago

2019-12-03 07:29:00 ERROR (MainThread) [custom_components.vaillant] Enable to fetch data from vaillant API Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 61, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/usr/local/lib/python3.7/socket.py", line 748, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen chunked=chunked, File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn conn.connect() File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 334, in connect conn = self._new_conn() File "/usr/local/lib/python3.7/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 0x6ef9a3f0>: Failed to establish a new connection: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='smart.vaillant.com', port=443): Max retries exceeded with url: /mobile/api/v4/facilities/[my_serial_number]/hvacstate/v1/overview (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6ef9a3f0>: Failed to establish a new connection: [Errno -3] Try again'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pymultimatic/api/connector.py", line 210, in _safe_call headers=header) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='smart.vaillant.com', port=443): Max retries exceeded with url: /mobile/api/v4/facilities/[my_serial_number]/hvacstate/v1/overview (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6ef9a3f0>: Failed to establish a new connection: [Errno -3] Try again'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/config/custom_components/vaillant/init.py", line 176, in _update_system self.manager.request_hvac_update() File "/usr/local/lib/python3.7/site-packages/pymultimatic/systemmanager.py", line 457, in request_hvac_update state = mapper.map_hvac_sync_state(self._connector.get(urls.hvac())) File "/usr/local/lib/python3.7/site-packages/pymultimatic/api/connector.py", line 134, in get return self.query(url) File "/usr/local/lib/python3.7/site-packages/pymultimatic/api/connector.py", line 118, in query return self._safe_call(method, url, payload) File "/usr/local/lib/python3.7/site-packages/pymultimatic/api/connector.py", line 237, in _safe_call payload) from exc pymultimatic.api.error.ApiError: ('Cannot GET url: https://smart.vaillant.com/mobile/api/v4/facilities/[my_serial_number]/hvacstate/v1/overview', None, None)

thomasgermain commented 4 years ago

Hi,

just checked my logs and I have the same kind of error.

I think they removed https://smart.vaillant.com/mobile/api/v4/facilities/xxx/hvacstate/v1/overview from the API. I'll have a look.

Thomas

thomasgermain commented 4 years ago

Just got that from the android app: (Basically, saying maintenance in progress)

Screenshot_20191203-110438

Tomasonx commented 4 years ago

Can you test if server is UP before you take the data? Because the server is a lot in "maintenance".

thomasgermain commented 4 years ago

The problem seems to be fixed at their side.

The server itself was UP (I mean, https://smart.vaillant.com). It doesn't make sense to test each individual URL before actually calling the API.

I'm gonna keep this one open since only one part of the API was down, but the connector is failing all the way to get data. It should at least grab available data.

kromosomX commented 4 years ago

I use the IOS app couple of times a day and I get the "maintenance in progress" message at least once a day, so this happens frequently. It may be a strange coincidence (or maybe maintenance periods are very short) but shutting down the IOS app and restarting it helps 9 times out of 10.

thomasgermain commented 4 years ago

I did some improvements for the authentication handling which might solve (or, I hope, at least reduce) the problem, the last version of t he component is here

Tomasonx commented 4 years ago

I haven't seen this error in a while so you can close it.

Maybe in the future you can keep a counter with how many failed authentications are on the server (ex. from 2019-12-01 => 10 errors)