HandyHat / ha-hildebrandglow-dcc

Home Assistant integration for UK SMETS (Smart) meters pulling data from the DCC via the Hildebrand Glow API
MIT License
229 stars 31 forks source link

Runtime error. #291

Closed ColinRobbins closed 1 year ago

ColinRobbins commented 1 year ago

Describe the bug Seems to be working OK, but seen the following in the logs.

Version 1.0.2.

This error originated from a custom integration.

Logger: custom_components.hildebrandglow_dcc.sensor
Source: custom_components/hildebrandglow_dcc/sensor.py:194 
Integration: Hildebrand Glow (DCC) (documentation, issues) 
First occurred: 19:03:29 (2 occurrences) 
Last logged: 19:03:29

Unexpected exception: Request failed. Please open an issue
Traceback (most recent call last):
  File "/config/custom_components/hildebrandglow_dcc/sensor.py", line 181, in daily_data
    readings = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/glowmarkt/glowmarkt.py", line 50, in get_readings
    return self.client.get_readings(self.id, t_from, t_to, period, func, nulls)
  File "/usr/local/lib/python3.10/site-packages/glowmarkt/glowmarkt.py", line 248, in get_readings
    raise RuntimeError("Request failed")
RuntimeError: Request failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/hildebrandglow_dcc/sensor.py", line 194, in daily_data
    readings = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/glowmarkt/glowmarkt.py", line 50, in get_readings
    return self.client.get_readings(self.id, t_from, t_to, period, func, nulls)
  File "/usr/local/lib/python3.10/site-packages/glowmarkt/glowmarkt.py", line 248, in get_readings
    raise RuntimeError("Request failed")
RuntimeError: Request failed
HandyHat commented 1 year ago

This error message simply means the Glow API returned a non-200 status code. I've clarified this in v1.0.3 Thanks @ColinRobbins!