Help needed - Home temperature and solar production

Hi all. I have a project in mind, but I have not really an idea on where to start to implement it… :sweat_smile:
I have a smart thermostat, a way to monitor my ftv production and both configured in HA. What I would like to do is to command my heat pump based on my ftv production, ie like this (times and temperatures are as an example):

  • between 18.30 and 0.00, heater off;
  • between 0.00 and 4.30 heater at 18.5°;
  • between 4.30 and 10.00 heater at 19.5°;
  • between 10. 00 and 18.30 heater at 20.5°

(and this is easy :joy:)

But if between 4.30 e le 18.30 the ftv production is over a certain point set the temperature at 22° instead of the one on program… Also, make the check only at certain intervals, in order to avoid continuous on and off of the heat pump…

I think it would be not so difficult to implement after understand how, but I cannot figure out a simple way to do it, except to use an automation with a lot of conditions and cases…
Any advice? :blush:

Thanks!