Easiest solution to use surplus solar energy

Hi Folks

I am looking for the most practicable and elegant way of implementing the following automation:

  • Defined Variable “Pool Filter Time” for example 6 hours
  • Switch on pool pump as soon as there is >150W feedback power into the grid for more than 5min (Pump has about 90W)
  • Switch off pump as soon as feedback power drops to 0W for more than 5min
  • Count the time the pump has been on during the day and subtract from “Pool Filter Time”
  • During the night (10PM for example) start the pump for the time remaining on “Pool Filter Time” to use off-peak electricity rate.
  • If Time On > Pool Filter Time during the day (surplus solar) start the pump no matter the timer but during the night only if it didn’t run enough during the day

I tried it with a simple Timer Helper in HA but it does not seem to count correctly.

Hello, I m interested in this type of things too. My use case is slightly different, but very very close : I would like to start my electrical water heater during the day ONLY IF I have enough solar power available left. If not, I will only allow the electrical water heater to start at night.

That is a second project I have but on my water heater it is very easy as it has an extra input for PV controls. So I only need to stuff a shelly relay in there.

It normally heats the water to 50°C for example, whenever it is needed.
If the PV input is activated, it starts heating until PV input is disabled or the maximum Temperature 65°C is reached.

If you have one of the newer heat pump water heaters, the chance is high it has a control similar to this, maybe check the manual.

If not I think it is very easily solvable with a shelly relay (depending on the wattage of the heater you may need to control a bigger relay with the shelly relay) and you just switch it on when you have solar and then switch it on during the night. If the water is already hot enough from solar during the day, it will just not start heating in the night as there is a thermostat in there.

Thanks for the suggestions, I will look into it.