According to the description of the question, it is judged that the electric water heater and the solar water heater share a mixing valve.
The solution is: install a shut-off valve between the downpipe of the solar water heater and the mixing valve, and install a shut-off valve in the cold water pipe (downpipe 'inlet) of the solar water heater.
When using an electric water heater, close the shut-off valve of the downpipe (hot water pipe) of the solar water heater and open the shut-off valve of the solar water heater. electric water heater inlet pipe;
When using a solar water heater, close the shut-off valve of the electric water heater water inlet pipe and open the shut-off valve of the solar water heater downpipe.