I do not have the solar panels, but do have control of hot water by both gas boiler central heating and by electric immersion heater.
I put a smart temperature sensor on the hot water cylinder, a smart switch on the electric immersion heater and another on the zone control valve for the hot water circuit. I then made Generic Thermostats for both hot water and immersion heater using the same temperature sensor. The idea is that heating is usually by the gas boiler, but the electric immersion heater acts as a top-up if the temperature falls below a certain threshold (e.g. after two people use the shower in quick succssion)
The thermostats are then scheduled by calendars using the blueprint Heating X2: Schedule Thermostats with Calendars