tijsverkoyen / HomeAssistant-FusionSolar

Integrate FusionSolar into your Home Assistant.
MIT License
133 stars 25 forks source link

Total current year energy not available constantly #91

Closed jvcsw closed 1 year ago

jvcsw commented 1 year ago

Hi,

the annual energy total fails intermittently. It only happens with this sensor:

imagen

Now it shows up, now it shows up as unavailable:

imagen

Do you have any explanation?

I'am using a northbound account.

tijsverkoyen commented 1 year ago

Can you enable debug mode? With that you will see the data that Fusion Solar is returning. If the value is empty ('') or not present the sensor will be unavailable.

jvcsw commented 1 year ago

Enabled.

This information appears in the home assistant registry section?

tijsverkoyen commented 1 year ago

I think they should be available under Settings → System → Logs

jvcsw commented 1 year ago

This is the only trace I see at the moment...

Unexpected error fetching FusionSolarOpenAPIStationYearKpi data: Access frequency to high. failCode: 407, message: ACCESS_FREQUENCY_IS_TOO_HIGH

tijsverkoyen commented 1 year ago

Ok, wait until the unavailable sensor is available again and then check the logs when it is unavailable again.

jvcsw commented 1 year ago

Hi again,

this is the only thing I see in the logs, the error is repeated constantly.

Logger: custom_components.fusion_solar.sensor
Source: custom_components/fusion_solar/fusion_solar/openapi/openapi_api.py:194
Integration: FusionSolar ([documentation](https://github.com/tijsverkoyen/HomeAssistant-FusionSolar), [issues](https://github.com/tijsverkoyen/HomeAssistant-FusionSolar/issues))
First occurred: 15:25:19 (17 occurrences)
Last logged: 18:35:19
Unexpected error fetching FusionSolarOpenAPIStationYearKpi data: Access frequency to high. failCode: 407, message: ACCESS_FREQUENCY_IS_TOO_HIGH

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 217, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/fusion_solar/sensor.py", line 655, in async_update_station_year_kpi_data
    response = await hass.async_add_executor_job(api.get_kpi_station_year, station_codes)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/fusion_solar/fusion_solar/openapi/openapi_api.py", line 125, in get_kpi_station_year
    response = self._do_call(url, json)
  File "/config/custom_components/fusion_solar/fusion_solar/openapi/openapi_api.py", line 194, in _do_call
    raise FusionSolarOpenApiAccessFrequencyTooHighError(
custom_components.fusion_solar.fusion_solar.openapi.openapi_api.FusionSolarOpenApiAccessFrequencyTooHighError: Access frequency to high. failCode: 407, message: ACCESS_FREQUENCY_IS_TOO_HIGH
tijsverkoyen commented 1 year ago

@jvcsw thanks. This seems to be the same issue as reported in https://github.com/tijsverkoyen/HomeAssistant-FusionSolar/issues/89. I will close this issue, but you can follow in #89 I have a Pull Request ready that I will try to release later today.