Charge battery from solar when there is an excess... refinements

Hi there,

I got Home Assistant setup yesterday to automate the charging of my Ecoflow Delta Pro when there is excess solar from our home based array.

It’s working okay in the following setup, but I think it can be made better:

  • Switch on smartplug AC to Delta Pro when the Grid export is above 300 watts for 3 mins
  • When grid reading changes adjust the charging rate to be the rate of excess minus 100 watts, check each 5 mins for adjustments to avoid flapping
    *Check every 3 mins for whether the excess has turned positive and disable the smart plug since we are now charging at too high a rate.

I guess the main issue I have is that since we are measuring from the excess to trigger the rate change, when I apply a charge rate the excess drops by the amount of the charging rate meaning that the next time it triggered we reduce the rate of charge, and this flaps back and forth depending on the current solar generation :frowning:

Is there a way to generate a moving average of the excess power in the last n minutes (say 10 or 15) in a variable that could be used to try and filter out this flapping, so that the rate would not keep flapping up and down. For example I’d then use this value minus 100 as the charging rate…

I have a development background but couldn’t find any docs relating to how I might go about this, any tips or pointers would be most appreciated!



1 Like