Would not recommend the DC link with the existing thermostat, but instead set the thermostat to maximum, and instead have a separate temperature controller operating a DC rated contactor instead, as the thermostat will not last long switching DC, as it will absolutely arc and burn out. Separate small panel charging a 12V battery, probably something you will need to have lighting that is not grid dependant, and this runs a 16A 3 pole contactor with sensitive 12VDC coil, and all 3 16A contacts wired in series, so as to guarantee opening with DC use. then add in a voltage sense relay on the DC input, so that the voltage sense relay disables the contactor when solar panel voltage is below around 100V, as that will mean it is night, and probably no longer going to heat the tank anyway, but will leave the contactor on all night, wasting battery power. Temperature controller should have a LCD display, and run off 12VDC, so as to use minimal power during the night.
Contactor, temperature controller and voltage relay are all common industrial logic parts, and available world wide. Temperature sensor will need to be in contact with the inner tank, preferably stuck under the insulation at the electrical panel opening, where the foam fill will be visible and easy to dig a hole in to hold it in contact with the tank. Temperature sensor can be any type, thermocouple, PT100 or thermistor, and turn on failed probe detection in the controller. If using a thermocouple you will need to insulate it electrically from the tank, using some polyamide tape covering the bead tip. the others normally come with insulation anyway.