mletenay / home-assistant-goodwe-inverter

Experimental version of Home Assistant integration for Goodwe solar inverters
https://discord.gg/TaXyWXT
MIT License
146 stars 38 forks source link

Adjust scan interval to get updated data with more than one inverter #189

Closed midadami closed 9 months ago

midadami commented 1 year ago

In case you have only one inverter setup then it doesn't matter when the data is retrieved from inverter as long as it's every X seconds (scan interval). In case you have more than one inverter, each inverter will deliver the data at different moments (even with same interval). This results in values generated from both inverters to be always wrong as the data being used is always old/late.

You should be able to choose to synchronize inverters in configuration. If any inverter has the synchronize check enabled then the scan interval on all inverters is changed to the lowest scan interval at that moment and the petitions to the inverter will always be done at the same time (or less than 1 second apart).

In my case I can I set up both inverters pretty much same time but one shuts down every day after sunset so I would need to fix it every day. As long as solar production doesn't change drastically due to weather, data is coherent. In case weather creates moments where solar power is higher and lower every few seconds then I get negative consumption values or exporting more than my solar is generating (incoherent data).

midadami commented 11 months ago

I don't know if its possible to fix this issue due to the way HA works. The moment my PV generation jumps up and down on both inverters at different times (same update interval), the home consumption data is wrong.

Small example: My current consumption is around 2000W but it jumps from 500W to 4000W all the time as PV generation updates on either inverter https://gyazo.com/c59dfc0cd66304d588b700faa4bc1ca6

I would need some kind of coordination between inverter updates. Either both at same time or almost same time. In my case both inverters have same update interval. Something like if one inverter is going to update data, first check if other inverters are present with same interval to update them too (this way both inverters are updated at the same time).

Thanks