Inverter that is offline #24
Replies: 8 comments 5 replies
-
If the last known power value within 24 hours was 0, no errors at all. |
Beta Was this translation helpful? Give feedback.
-
Another option is to "cache" the value until 00:00. For example;
|
Beta Was this translation helpful? Give feedback.
-
It is not the intention that we will cache for month and year totals, for that we have the energy dashboard long-term statistics. I'm now purely concerned with the error handling, something that unfortunately cannot really be prevented I think. The behavior we want to prevent is that an entity for total just jumps to 0 kWh, which causes an energy spike in the dashboard. |
Beta Was this translation helpful? Give feedback.
-
My inverter (zeversolar) can fail in two ways:
For now focussing on 1, I think the below pseudo code should work. try:
return get_inverter_data()
except TimeoutError:
if timeout_exceeds_24_hrs(): # as @freddieleeman suggest
raise IntegrationError()
if new_day_has_arrived():
return {"daily_energy_use": 0, "current_solar_power": 0}
# don't update "lifetime energy values
# setting "current_solar_power" will reset the sensor
# Provided it is defined with state class total increasing as defined in
# https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics
return {"current_solar_power": 0}
# don't update "daily_energy_use" and "lifetime energy values" |
Beta Was this translation helpful? Give feedback.
-
My two cents. I'm not a coder and will explain in a functional way. |
Beta Was this translation helpful? Give feedback.
-
This is what I currently have running on my zeversolar inverter dealing with the same challenge. https://github.com/sander76/home-assistant/tree/zever_local/homeassistant/components/zeversolar It uses the caching and the new day detection mentioned by @freddieleeman and @hepfister . It's running fine on my instance for some days now. No flooding of the logs anymore. See below my daily energy generation. |
Beta Was this translation helpful? Give feedback.
-
I think we should move this discussion towards the integration side of Omnik and let's see how we can integrate some form of caching (no longer via a file) like zeversolar. maybe @sander76 can you help us with what adjustments are needed on the dev branch? |
Beta Was this translation helpful? Give feedback.
-
Happy to help. I guess it all revolves around the The "caching" taking place is looking at the last successful solar data (which is assumed to be always valid) stored in the I would also only focus on daily energy and current power. total energy is tracked by hass itself. |
Beta Was this translation helpful? Give feedback.
-
A current problem is that most inverters switch off when there is no energy production from the sun. This causes the problem that every request that follows results in an exception error, resulting in a log file (in Home Assistant) that gets flooded with exceptions.
How would a python package best deal with this case:
Beta Was this translation helpful? Give feedback.
All reactions