Maximize utilization of solar power

I would like to consume the energy produced by my solar panel over buying energy.

I have a couple of Appdaemon apps that optimize usage of my big consumers in the house. Today I only optimize on price based on Nordpool. Depending on the hourly cost on energy (my apps are triggered every hour) I consume or not.
I would like to also look at if my solar panel produces energy. At the same time I don’t want to switch equipment on/off many times per hour.

Is it possible to do a simple prediction when an even hour starts to se if I should enable consumption just because the sun is shining. I can’t figure out how to do this in a simple way.

You can take a look at GitHub - davidusb-geek/emhass: emhass: Energy Management for Home Assistant, is a Python module designed to optimize your home energy interfacing with Home Assistant. and see if it fits your use case.
There is also this to help you ask ChatGPT for an addon solution.
Just to give you an idea for programming: there are plenty of forecast apps to get production from (Solcast, Forecast.Solar, Open Meteo), you can get power clamps from Shelly to get an api access to your energy data, direct api from your inverter or your smart meter of you have one and a readable interface (P1, SML …).
With an home assistant automation you can also programm “cool off” time"

Thanks! I will take a look.
I have sensors for the production and I have AppDaemon apps to control my heavy consumers. What I lack is the forecast parts. I will for sure look at what you wrote.