Always record datapoints, even if they haven't changed value
I noticed that I was missing some large chunks of data overnight on some graphs -- on investigating, it appears that if the data value hasn't changed, the sensor's value isn't recorded. (Since I use Graphite downstream from my Home Assistant to display graphs, it highlights missing data like this, whereas HA's own graphs are more lenient.) I also think it's useful to record the datapoints if we were successfully able to measure them, to differentiate from cases where the datapoint was unmeasureable due to a bug or other issue (which unfortunately tends to happen to me a fair bit due to wifi issues).
Is there any reason the original code skipped recording identical datapoints?
Yes there are reasons not to update:
- It keeps the last update more or less in sync with the inverter. If the logger in the inverter stops updating the server, then you'll also notice in HA
- Every update is recorded, the recorder database is notorious for wearing out HA instances running from SD on RPi's. The recommendation is to only write when there's an update (can't find the blog anymore, was already quite a while ago).
I do get your usecase however. We could add it as a config to the workarounds.yaml. Default current solution, and if enabled always update? Soliscloud_api uses the workarounds.yaml as well.
Oh, the workarounds.yaml is planned to go to the UI options (#234) in the future, so will become more user friendly ;-)
great, that works for me :) Thanks!
This code was still accidentally in PR #240 and caused regression in the fix for late reset of energy today, specifically https://github.com/hultenvp/solis-sensor/blob/master/custom_components/solis/service.py#L178:L179 I reverted it in 3.3.1.
Needs more rework before it can be integrated