BJReplay / ha-solcast-solar

Solcast Integration for Home Assistant
Apache License 2.0
124 stars 24 forks source link

After updating to v4.0.29 there are zero values. #31

Closed matomatusov closed 4 weeks ago

matomatusov commented 4 weeks ago

This error originated from a custom integration.

Logger: custom_components.solcast_solar.solcastapi Source: custom_components/solcast_solar/solcastapi.py:189 integration: Solcast PV Forecast (documentation, issues) First occurred: 3:26:15 PM (1 occurrences) Last logged: 3:26:15 PM

SOLCAST - sites_data Exception error: Traceback (most recent call last): File "/config/custom_components/solcast_solar/solcastapi.py", line 181, in sites_data raise Exception(f"SOLCAST - HTTP sites_data error: Solcast Error gathering rooftop sites data") Exception: SOLCAST - HTTP sites_data error: Solcast Error gathering rooftop sites data


This error originated from a custom integration.

Logger: custom_components.solcast_solar.solcastapi Source: custom_components/solcast_solar/solcastapi.py:180 integration: Solcast PV Forecast (documentation, issues) First occurred: 3:26:15 PM (1 occurrences) Last logged: 3:26:15 PM

SOLCAST - Solcast integration did not start correctly, as rooftop sites data is needed. Suggestion: Restart the integration


This error originated from a custom integration.

Logger: custom_components.solcast_solar.solcastapi Source: custom_components/solcast_solar/solcastapi.py:177 integration: Solcast PV Forecast (documentation, issues) First occurred: 3:26:15 PM (1 occurrences) Last logged: 3:26:15 PM

SOLCAST - sites_data Solcast.com http status Error 429 - Gathering rooftop sites data

1

autoSteve commented 4 weeks ago

As the log says. Restart the integration... I tried to make this very clear in the log... Clearly I have failed, and maybe it should be in capital letters.

This error is being caused because the sites data cannot be gathered from Solcast, @matomatusov. If the sites data cannot be gathered then the integration cannot start. This is being caused because the Solcast API is busy, and you have a hobbyist account. It is no fault of this integration, which has, in this case, reported the situation perfectly.

Once a successful gather is done then this issue should never be seen again for you, because the sites data will then be cached. On 429 failures in future the integration will revert to what's in the cache.

Restart the integration or HA. And if it fails again, restart again. And again. And again if you need to...

autoSteve commented 4 weeks ago

Further, @matomatusov, from the readme...

image
matomatusov commented 4 weeks ago

Thanks for the explanation and information. And great that you took over the project. I had to restart a few times.

autoSteve commented 4 weeks ago

Solcast is getting a bit feisty with the "go away, we're busy" 429 responses these days, @matomatusov.

My greatest hope at the moment is that the retries and caching that I have included make this a thing of the past.

Incorporated is caching of sites data, current usage data, and an equal-to-solcast feistly back-off retry mechanism for forecast GETs that seems to have done the trick for early testers.

It may be that I need to build in an equally feisty retry for sites data so that souls like you don't even hit the issue. I've considered it, but that would probably well slow down the integration start up.

Cheers!