Question about 2 CV. Boilers on 1 thermostat

Good day,

We have enough solar panels because of this I have
placed an electric boiler next to my gas boiler.
The intention is that as soon as there is a surplus of electricity,
that the Elect.Cv comes on and heats the living room.
Which circuit do I need via Home Assistant de
Nest Thermostat on/off.