Hybrid charging cable Mercedes: Charging interruption by switching off the socket

Hello, maybe someone has a tip for the following problem: We have a Mercedes C 350 E hybrid that we charge at home via the supplied charging cable (charging cable with a box for the 220V socket, supplied by Mercedes, manufacturer company Intertek). We now also have a new PV system that I want to use to charge the car. So that this only happens when solar power is available, the idea was to use a controlled switchable socket. I now have neulic h when it became dark and no solar power was available anymore was simply the charging cable on the mains side off the socket and experienced a nasty surprise the next morning. The control electronics in the car probably didn’t come along and the 12V vehicle battery was completely unloaded (there was nothing left!) because something still remained in operation. Now the question: Does anyone know a possibility how to get such an interruption of the charging process easily? Thanks in advance for eur e ideas on this.