ha-solcast-solar: System health exception
Discussed in https://github.com/BJReplay/ha-solcast-solar/discussions/185
<div type='discussions-op-text'>Originally posted by bert1111 October 17, 2024 Is this a solcast integration error or HA itself? I see this in the logs after updating solarman integration and rebooting. I am on the latest version of everything.
`Logger: homeassistant.components.system_health Bron: components/system_health/init.py:89 integratie: Systeemstatus (documentatie, problemen) Eerst voorgekomen: 15:10:03 (3 gebeurtenissen) Laatst gelogd: 16:09:47
Error fetching info Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/system_health/init.py”, line 89, in get_integration_info data = await registration.info_callback(hass) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/config/custom_components/solcast_solar/system_health.py”, line 27, in system_health_info used_requests = coordinator.solcast.get_api_used_count() ^^^^^^^^^^^^^^^^^^^ AttributeError: ‘mappingproxy’ object has no attribute ‘solcast’`</div>
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (7 by maintainers)
Hard Agree
As little as possible to fix is the right amount.
I’d consider pulling the entire system health hook but haven’t yet read enough to know if that is good or bad.
Solcast Server reachable is not currently available anywhere else, but implicit in successful initial set up and forecast fetch.
Everything else is available elsewhere in diagnostics.
Because no reason that no one will look at, I am going to modify this to record the server connection ‘ok’, and the total number of failed forecast fetches for the UTC day period, including retry attempts.
And to support competition I may also add the total number of 429s seen since records began, which will be v4.2.5.
@BJReplay, good point. What this code did before was a crap-shoot, and I definitely broke it by extending the volatile domain data stored, as one can. It got the very first list item [0] of the domain values converted to a list, which almost certainly now returns the last recorded entry options, hence the exception. So it was kind of broken forever, having worked as Oziee code, hoping that some hapless developer wouldn’t stumble upon the bomb.
It was inelegant, and doomed to fail, assuming that the coordinator was the only item that would be in the list of volatile data.
And it’s wrong! 😂 “API requests remaining” is actually API requests used so far for the day. Lols. No one looks at this.
And more Urdu translations will be required to extend it. 🤦🏻
Why did I not just let you silently close that discussion BJ?
It’s useless, but at least it now works as is. This has been broken for a very long time…
I can reproduce it by going to Repairs=> System information
Agree on the highly likely glitch.
Good point, but where can one see this information in the modern HA user interface or any diagnostic dump? Maybe I’m not looking hard enough… Get the API used from the sensor if needed. All of this info is included in the diagnostic dump, and this code seems a bit of a mostly-not-helpful relic.
Helpful would be a counter of the number of 429s hit for the past day, which should probably be in the diagnostic dump.