Kosmik
Honorary Master
*Disclosure AI helped me formulate the post as its a lot lol.
I wanted to share a project I've been developing to automate EV charging using Home Assistant, solar generation and home battery monitoring, without needing a dedicated solar-aware EV charger.
The setup uses a Deye hybrid inverter, an existing 7 kW AC wallbox and a Wi-Fi-controlled EVSE feeder.
The vehicle in my case is a Geely E2, but the approach should be applicable to many EVs and ordinary AC chargers that don't provide remote control or dynamic charging-current adjustment.


An important consideration was ensuring that the electrical installation would support the wallbox safely, independently of the Home Assistant automation.
The garage distribution board was upgraded to a larger enclosure, accommodating both the existing garage circuits and the additional EV charging equipment.
A new 6 mm² copper feeder was installed between the main household distribution board and the garage.
Although I currently expect to charge primarily between 8 A and 20 A, the 7 kW wallbox supports up to approximately 32 A.
The 6 mm² cable was selected to provide capacity for higher charging currents, subject to the cable installation conditions, protection arrangements and electrician's assessment.
The installation incorporates:
The changeover provides three operating positions:
In MANUAL mode, the wallbox operates as a normal standalone EV charger.
The manual bypass avoids the smart switching device but does not bypass the circuit breakers, residual-current protection or required safety isolation.
This separation between electrical protection, automated control and manual operation was a key design consideration.
The electrical work and equipment selection were handled by a qualified electrician.
Rather than waste that generation, I wanted to redirect it towards charging the EV.
However, I didn't want the EV to unnecessarily discharge the home battery or draw substantial power from the grid.
The solution is a Home Assistant controller that makes charging decisions based on solar generation, available headroom, household battery SOC and actual power flows.
These software modes are independent of the physical AUTO/OFF/MANUAL changeover switch.
Automatic charging currently uses these parameters:
The controller evaluates several Home Assistant template sensors, including solar generation, battery charging/discharging, grid import/export and calculated available solar headroom.
It then enables or disables the EVSE feeder using the Wi-Fi switch.
I've tested charging at 12 A, approximately 2.8 kW at 230 V.
This works reasonably well as a compromise with the available solar generation, although it isn't true dynamic solar following.
A limitation of this approach is that Home Assistant cannot automatically reduce the EV's charging current when solar production drops. It can only enable or disable the charging supply.
The controller therefore relies on delayed power-deficit detection and minimum operating conditions rather than continuously matching available generation.
The controller uses a monitoring-fault sensor and additional availability checks.
I've also tried to minimise unnecessary automation complexity, as this runs on a Raspberry Pi 3 B+ alongside the rest of my Home Assistant installation.
The implementation is still undergoing testing and refinement, particularly around sustained grid import, battery discharge and restart behaviour.
The physical manual bypass is an additional safeguard against losing charging functionality due to a control-system failure.
The design is intentionally fairly straightforward and should be adaptable to other hybrid inverters and EV charging setups.

I wanted to share a project I've been developing to automate EV charging using Home Assistant, solar generation and home battery monitoring, without needing a dedicated solar-aware EV charger.
The setup uses a Deye hybrid inverter, an existing 7 kW AC wallbox and a Wi-Fi-controlled EVSE feeder.
The vehicle in my case is a Geely E2, but the approach should be applicable to many EVs and ordinary AC chargers that don't provide remote control or dynamic charging-current adjustment.
1. The setup
- 8 kW Deye hybrid inverter
- Approximately 6.5 kW solar PV
- 11 kWh home battery
- Standard 7 kW single-phase AC EV wallbox
- eWeLink 63 A Wi-Fi smart metering switch
- Home Assistant running on a Raspberry Pi 3 B+
- Solarman inverter integration
- EV with manually adjustable AC charging current
2. Electrical installation and manual bypass


An important consideration was ensuring that the electrical installation would support the wallbox safely, independently of the Home Assistant automation.
The garage distribution board was upgraded to a larger enclosure, accommodating both the existing garage circuits and the additional EV charging equipment.
A new 6 mm² copper feeder was installed between the main household distribution board and the garage.
Although I currently expect to charge primarily between 8 A and 20 A, the 7 kW wallbox supports up to approximately 32 A.
The 6 mm² cable was selected to provide capacity for higher charging currents, subject to the cable installation conditions, protection arrangements and electrician's assessment.
The installation incorporates:
- Dedicated protection at the main distribution board and garage distribution board
- EV charging circuit protection and appropriate residual-current protection
- eWeLink 63 A Wi-Fi metering switch for automated feeder control
- 40 A two-pole AUTO/OFF/MANUAL changeover arrangement
- External EV charger isolator
Why the manual bypass matters
I specifically wanted to avoid a situation where a Home Assistant failure, Wi-Fi outage or smart-switch malfunction prevents the vehicle from charging.The changeover provides three operating positions:
| Position | Behaviour |
|---|---|
| AUTO | EVSE receives power through the smart switch, under Home Assistant control |
| OFF | EVSE supply is disconnected through the changeover |
| MANUAL | EVSE receives power through a hardwired bypass, independently of Home Assistant and the smart switch |
In MANUAL mode, the wallbox operates as a normal standalone EV charger.
The manual bypass avoids the smart switching device but does not bypass the circuit breakers, residual-current protection or required safety isolation.
This separation between electrical protection, automated control and manual operation was a key design consideration.
The electrical work and equipment selection were handled by a qualified electrician.
3. The objective
My inverter operates in zero-export mode. Once the household battery is sufficiently charged and household demand is satisfied, additional available solar generation can be curtailed.Rather than waste that generation, I wanted to redirect it towards charging the EV.
However, I didn't want the EV to unnecessarily discharge the home battery or draw substantial power from the grid.
The solution is a Home Assistant controller that makes charging decisions based on solar generation, available headroom, household battery SOC and actual power flows.
4. How the controller works
I created four operating modes:| Mode | Function |
|---|---|
| Auto | Enables charging when solar and battery conditions permit |
| Off | Keeps charging disabled |
| On | Enables charging regardless of solar availability |
| Override | Temporarily enables charging for a defined period |
These software modes are independent of the physical AUTO/OFF/MANUAL changeover switch.
Automatic charging currently uses these parameters:
- Operating window: 08:00–17:00
- Minimum home battery SOC for starting: 80%
- Minimum solar production: 2,200 W
- Minimum calculated solar headroom: 2,200 W
- Solar-ready confirmation delay: 5 minutes
- Sustained power-deficit delay: 10 minutes
The controller evaluates several Home Assistant template sensors, including solar generation, battery charging/discharging, grid import/export and calculated available solar headroom.
It then enables or disables the EVSE feeder using the Wi-Fi switch.
5. Charging current
The EV itself allows the AC charging current to be set manually.I've tested charging at 12 A, approximately 2.8 kW at 230 V.
This works reasonably well as a compromise with the available solar generation, although it isn't true dynamic solar following.
A limitation of this approach is that Home Assistant cannot automatically reduce the EV's charging current when solar production drops. It can only enable or disable the charging supply.
The controller therefore relies on delayed power-deficit detection and minimum operating conditions rather than continuously matching available generation.
6. Reliability considerations
One area I've paid particular attention to is avoiding inappropriate switching when inverter readings become unavailable or Home Assistant restarts.The controller uses a monitoring-fault sensor and additional availability checks.
I've also tried to minimise unnecessary automation complexity, as this runs on a Raspberry Pi 3 B+ alongside the rest of my Home Assistant installation.
The implementation is still undergoing testing and refinement, particularly around sustained grid import, battery discharge and restart behaviour.
The physical manual bypass is an additional safeguard against losing charging functionality due to a control-system failure.
7. Current results
The following have been tested successfully:- Automatic charging initiation under suitable solar conditions
- Blocking automatic charging when insufficient solar is available
- Manual charging mode
- Charging at 12 A
- Automatic shutdown at the end of the permitted charging window
- Monitoring the inverter's response to EV charging demand
8. Next steps and feedback
I'm particularly interested in how others handle:- PV fluctuations and switching hysteresis
- Battery discharge versus grid import as the primary stopping condition
- Home Assistant restart and sensor-availability issues
- Avoiding repeated power cycling of an ordinary EVSE
- Potential improvements to calculated solar headroom when operating with zero export
The design is intentionally fairly straightforward and should be adaptable to other hybrid inverters and EV charging setups.

Last edited: