cyr-ius / hass-cozytouch

Cozytouch support for Home Assistant
GNU General Public License v2.0
23 stars 14 forks source link

Periodic Error on port 443 #7

Closed jugla closed 4 years ago

jugla commented 4 years ago

I have CozyTouch : 1.4.1b (within hacs). In log , I've got periodic error on port 443

`During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 725, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ha110-1.overkiz.com', port=443): Max retries exceeded with url: /enduser-mobile-web/enduserAPI/setup/devices/io%3A%2F2F0825-3323-9670%2F8076481%235/states (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0xa40df4f0>, 'Connection to ha110-1.overkiz.com timed out. (conect timeout=30)'))

NB: I've put an issue on biker91620 / ha-cozytouch (but it seems to be deprecated now)

jugla commented 4 years ago

More complete trace

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/cozytouchpy/client.py", line 64, in __make_request
    response = self.session.get(url, timeout=self.timeout)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 543, in get
    return self.request('GET', url, **kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 504, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ha110-1.overkiz.com', port=443): Max retries exceeded with url: /enduser-mobile-web/enduserAPI/setup/devices/io%3A%F%2F0825-3323-9670%2F8076481%235/states (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0xa40df4f0>, 'Connection to ha110-1.overkiz.com timed out. (onnect timeout=30)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
    await self.async_update()
  File "/home/homeassistant/.homeassistant/custom_components/cozytouch/sensor.py", line 124, in async_update
    await self.hass.async_add_executor_job(self.sensor.update)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/cozytouchpy/objects.py", line 186, in update
    self.states = self.client.get_device_info(self.deviceUrl)
  File "/srv/homeassistant/lib/python3.7/site-packages/cozytouchpy/client.py", line 134, in get_device_info
    response = self.__make_request("deviceInfo", data={"device_url": device_url})
  File "/srv/homeassistant/lib/python3.7/site-packages/cozytouchpy/client.py", line 66, in __make_request
    raise CozytouchException("Connection timeout")
cozytouchpy.exception.CozytouchException: Connection timeout
cyr-ius commented 4 years ago

Please test with latest version 1.4.3b

jugla commented 4 years ago

Great ! it works very well !! With all your modifications the component is far more stable !! Thanks again Philippe