How to control power to a water heater
Presumably the output of the inverter fed from your solar cells is on your side of the meter.  Therefore you don't get charged at all for any power you use up to what the solar panels are producing at the moment.  It already works as you seem to be asking.

For example, if your solar panels (thru the ineverter) are producing 1 kW when your 3.6 kW heater is on, then you will only be drawing 2.6 kW from the line, and will only be charged for the 2.6 kW.  If the panels are producing 4 kW with the heater running, then 3.6 kW goes to the heater locally, and you are actually dumping 400 W onto the line.  The power company can't tell the difference between you having everything off and producing 400 W that's going onto the line, and you producing 4 kW with 3.6 kW used internally and dumping the remaining 400 W onto the line.

There doesn't seem to be a problem here to solve.