PV over production to switch on Pool pump

Dear HA community,

since 3 Weeks I’ve a PV System with 1.5 kW Peak in place. Now I would like to use the PV over production to switch on my pool pump. I can measure the input in kWh from electricity supplier (positiv value) and the output in kWh to the electricity supplier (negative value).

I don’t have a battery, so I would like to use the excess electricity myself and switch on the pool pump in the summer. So that the pump is not constantly switched on and off again (e.g. when there is a cloud in the sky), there should also be the option of the minimum duration. At best, I can also set the maximum duration, as the pump only needs to run for a maximum of 3 hours a day for the pool volume.
Is there a way to implement this and if so, how?

BR
Patrick

You can use my blueprint: https://community.home-assistant.io/t/pv-solar-excess-optimizer-auto-control-appliances-wallbox-dish-washer-heatpump-based-on-excess-solar-power/

The only thing it does not support at the moment, is a maximum duration. However, you can easily create a separate automation, which switches the automation based on my blueprint off as soon as your pool pump reaches the desired maximum duration.

Thanks,

I’ve got this error message below. What’s the correct path for the script?

image