ZacheryThomas / homeassistant-smartrent

Home Assistant Custom Component for SmartRent Locks 🔐, Thermostats 🌡, Sensors 💧 and Switches💡
MIT License
84 stars 3 forks source link

Issue in Home Assistant logs - SSL Certs #30

Open mayka-mack opened 1 month ago

mayka-mack commented 1 month ago

Below issue is appearing in the HA logs. Device activity at 11:40 for this thermostat entity specifies change to Heat/Cool Climate was performed by Home Assistant Cloud.

Logger: homeassistant.util.loop Source: util/loop.py:136 First occurred: 11:40:05 (1 occurrences) Last logged: 11:40:05

Detected blocking call to load_default_certs with args (<ssl.SSLContext object at 0x7ff383883a50>, <Purpose.SERVER_AUTH: _ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='1.3.6.1.5.5.7.3.1')>) inside the event loop by custom integration 'smartrent' at custom_components/smartrent/climate.py, line 149: await self.device.async_set_mode(smartrent_hvac_mode) (offender: /usr/local/lib/python3.12/ssl.py, line 713: context.load_default_certs(purpose)), please create a bug report at
https://github.com/ZacheryThomas/homeassistant-smartrent/issues
For developers, please see
https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_default_certs
Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 827, in async_turn_on await self.async_set_hvac_mode(mode) File "/config/custom_components/smartrent/climate.py", line 149, in async_set_hvac_mode await self.device.async_set_mode(smartrent_hvac_mode)

I see this in the logs as well, in case it's related:

Logger: smartrent.utils Source: runner.py:189 First occurred: 09:31:21 (39 occurrences) Last logged: 13:31:28

InvalidAuth detected. Trying again with updated token...
Exception occured! ConnectionClosedError <class 'websockets.exceptions.ConnectionClosedError'>
Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 959, in transfer_data message = await self.read_message() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 1029, in read_message frame = await self.read_data_frame(max_size=self.max_size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 1104, in read_data_frame frame = await self.read_frame(max_size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 1161, in read_frame frame = await Frame.read( ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/websockets/legacy/framing.py", line 68, in read data = await reader(2) ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/streams.py", line 750, in readexactly raise exceptions.IncompleteReadError(incomplete, n) asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/smartrent/utils.py", line 425, in _async_update_state_via_ws async for message in websocket: File "/usr/local/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 497, in __aiter__ yield await self.recv() ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 568, in recv await self.ensure_open() File "/usr/local/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 930, in ensure_open raise self.connection_closed_exc() websockets.exceptions.ConnectionClosedError: no close frame received or sent
Retrying websocket in 1.0 seconds...