dreautall / ha-stromnetzgraz

Home Assistant Custom Component for Stromnetz Graz
MIT License
17 stars 1 forks source link

Timeout fetching sensor data #18

Closed akargl closed 5 months ago

akargl commented 5 months ago

I've just setup a new HA installation and the sensor stay at "Unavailable" and I can see a timeout exception in the logs:

Logger: sngraz.sngraz
Source: /usr/local/lib/python3.12/site-packages/sngraz/sngraz.py:114
First occurred: 4:24:37 PM (3 occurrences)
Last logged: 5:56:09 PM

Timed out when connecting to API
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/sngraz/sngraz.py", line 102, in _query
    resp = await self.websession.post(API_ENDPOINT + path, **post_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 976, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 640, in read
    await self._waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/sngraz/sngraz.py", line 101, in _query
    async with async_timeout.timeout(self._timeout):
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 141, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 228, in _do_exit
    raise asyncio.TimeoutError
TimeoutError

It was still able to populate the device name with the correct "AT.8100.XXXX" format so the login credentials must be correct and the data is available in the 15min intervals in the web portal. Also I'm still running an older HA on another device and there the integration has been running fine for a long time for the same smartmeter/credentials.

I encountered this problem yesterday evening and removed and readded the integration with the same result some minutes ago.

Any clues what might be going on here? I'm happy to run any curl or similar commands to debug this.

dreautall commented 5 months ago

Does the issue still persist? Maybe it was a hick-up on their system, it's not always the fastest one...

The only other thing I could think of is to raise the timeout, but you're the first to report problems there.

akargl commented 5 months ago

I readded the integration again and it's working now. Probably really just some problem on their end. Thanks!