This post describes how I integrated a Sonoff Basic wifi switch with a type 2 QubeEV charger controlled by Home Assistant. You can likely use the information to integrate remote control with other charger types, and with other automation systems like SmartThings, OpenHab or Domoticz. Obviously you can also use a ZigBee or Z-Wave switch or whatever, I just chose the Sonoff because it’s dirt cheap and relatively small.
I have a QubEV type 2 charger from EV One Stop. It was the cheapest charger I could find at the time at £225ish not including RCD which I had the electrician include on the distribution board as an RCBO since a new breaker was required anyway. This charger is dumb. It’s just on all the time, with no timer controls to take advantage of cheaper time of day tariffs available to EV drivers now. Fine if you have timer controls on your car, but my EV doesn’t have a charge timer. Also, the charger is exposed to the street and has no locking functionality, so I wanted to take control of whether it was enabled or not.
Don’t follow this guide if you don’t know what you’re doing with mains supply. Fortunately this charger is really simple on the inside:
You can see the supply wires run into a junction box which feeds the controller (which talks to the EV to establish a charging session and turns on the contactor), and the contactor which switches the supply to the output socket. The plan was simple – run the supply wires for the controller through the wifi switch. If the controller has no power the contactor won’t be activated. You can likely identify the same components and wires in your charger – the incoming supply will split off to power the board or controller somewhere. Just interrupt that supply with the wifi switch and Bob’s your uncle.
WARNING: You cannot use the wi-fi switch to interrupt the switched supply that goes into or out of the contactor. The contactor has two smaller wires which control it, and two thicker wires in and two out that are the supply that goes to the EV. Those thicker wires will be carrying up to 40A and will simply blow up the wifi switch or start a fire. You may be able to interrupt the contactor control wires, but it will be simpler (and reduce the power consumption) if you switch the controller instead.
WARNING: The Sonoff Basic is not fused. You should strongly consider adding a fuse to it before using. Plenty of other posts on the internet to show you how to do that.
With that out of the way, here’s what I did.
Preconfigure wifi switch
Start by doing whatever you need to do add your wifi switch to your home automation system and check it works. In my case I flashed the Sonoff with Tasmota and then configured it with MQTT to connect to Home Assistant.
Test which wires you will be interrupting
I disabled the charger by switching off the breaker at the distribution board. Looking at the wiring layout, I found the live and neutral supply to the controller, then removed the live and restored the power to the charger with the car plugged in. As expected the car did not charge – in fact the LED on the front of the charger didn’t light either. Great – I’ve confirmed the right wires to interrupt to disable the charger. Power off again.
Extend controller supply wires and connect to Sonoff
I removed live and neutral cables going in to the controller, and connected them to the in side of the Sonoff. I had to extend them slightly in order to wedge the Sonoff into the bottom of the case.
Then I cut a pair of wires the same thickness as the ones I have removed from the terminal, and ran them from the Sonoff output to the controller input where I had previously removed wires. Switched it back on, tested all OK and closed up the case. There’s not much space for the wires running into the socket, so a little jiggling was required.
Finally I set up automation in Home Assistant to power on the charger between 02:00 and 06:00 when we have cheap electricity.
The Sonoff Basic doesn’t measure power throughput so you can’t report on the charge rate, but this charger has a charge rate switch on the side so I pretty much knew what the rate would be anyway. If you used a device that did report this, then you would be reporting on the current consumption of the charge controller, not the current flowing to the EV.
Have fun and try not to zap yourself.