Dynamic load balancing for EV chargers in Home Assistant. Measures current per phase at the main fuse and adjusts the charger's output power in real time to prevent the fuse from tripping. Supports phase switching (1↔3 phase), failsafe modes and charger profiles. MVP: go-e Gemini flex.
- Phase-specific load balancing — measures and balances current per phase (L1, L2, L3)
- Event-driven calculation with immediate downward adjustment on load increase
- Automatic phase switching — dynamically switches between 3-phase and 1-phase charging
- Hysteresis against hunting — debouncer (5s) prevents rapid on/off oscillation
- Failsafe on sensor loss — reduce (6A) or pause depending on configuration
- Configurable safety margin — adds a buffer below the fuse limit
- Charger profiles — modular support for different charger models (MVP: go-e Gemini flex)
- HA events for automations and notifications on all state changes
- Capacity warning sensor — binary sensor + event when capacity margin is low
- Utilization sensor — shows fuse utilization as a percentage
EV Load Balancer operates in a continuous cycle: measure → calculate → control.
Current per phase at the fuse
sensor.current_be1_30051 (L1: 18.3 A)
sensor.current_be2_30051 (L2: 12.1 A)
sensor.current_be3_30051 (L3: 15.7 A)
│
▼
┌─────────────────────────────────┐
│ Calculation │
│ │
│ Available per phase: │
│ L1: 25 - 2 (margin) - 18.3 │
│ = 4.7 A │
│ L2: 25 - 2 - 12.1 = 10.9 A │
│ L3: 25 - 2 - 15.7 = 7.3 A │
│ │
│ available_min = min(4.7, │
│ 10.9, 7.3) = 4.7 A │
│ │
│ target_current = floor(4.7) │
│ = 4 → clamped to [6, 16] A │
└─────────────────────────────────┘
│
▼
┌───────────────────┐ ┌─────────────────────┐
│ Control │ │ Pause logic │
│ │ │ │
│ Immediate down- │ │ available_min │
│ ward adjustment │ │ < min 15s→ PAUSE │
│ on load │ │ │
│ increase │ │ > min+2A 30s→RESUME│
│ │ │ │
│ 5s cooldown │ │ Phase switching: │
│ upward adjust. │ │ all phases >= 6A │
└───────────────────┘ │ for 60s → 3-phase │
│ └─────────────────────┘
▼
number.goe_{serial}_amp (sets charging current)
select.goe_{serial}_frc (pause/resume)
select.goe_{serial}_psm (phase selection)
Simplification: The diagram above shows a simplification — the actual calculation subtracts the charger's own draw (
device_load) from the phase load before calculating available capacity:max_a - (phase_load - device_load) - safety_margin.
The status sensor exposes all calculation details as attributes — useful for debugging and dashboard cards:
- Measurement: Reads current per phase from configured phase sensors
- Available capacity:
(max_ampere - safety_margin - measured_current)per phase - Limiting phase:
available_min = min(available_L1, available_L2, available_L3) - Target current:
target_current = floor(available_min), clamped to [min_current, max_current] - Control: Writes new current to the charger entity — immediately on downward adjustment, 5s debounce on upward adjustment
- Pause: If
available_min < min_currentfor 15 seconds → pause charging - Resume: If
available_min > (min_current + 2A)for 30 seconds → resume charging
Verify the following before installation:
Home Assistant:
- Home Assistant 2024.1.0 or later
- HACS installed (instructions)
Hardware:
- EV charger installed and connected to the home network
- Per-phase current measurement at the main fuse installed
Home Assistant integrations:
- Charger integration installed in HA (e.g. ha-goecharger-api2 for go-e)
- Phase sensors exposed in HA (e.g. via Nibe Modbus, P1 port, Shelly EM)
Network requirements:
- Home Assistant and the EV charger on the same network (or routable)
- Charger API accessible (local network communication, no cloud required)
Current measurement — options:
| Option | Integration | Sensors |
|---|---|---|
| Nibe Modbus (heat pump) | nibe-hass | sensor.current_be1_30051, be2, be3 |
| P1 port (Tibber, Easee home) | tibber-local | Per-phase current |
| Shelly EM | Shelly HA | Per-phase current |
| Eigil Stromberg | Modbus | Per-phase current |
Important: The sensors must show current in Ampere per phase at the main fuse — not at the distribution board or at the charger. It is the total load per phase that determines whether the fuse is at risk of tripping.
See the full setup guide: docs/charger-profiles/goe-gemini.md
The guide covers:
- Firmware requirements (≥ 59.x, API v2)
- Installation of
ha-goecharger-api2 - All entities that EV Load Balancer needs
- Recommended
amavalue (safe maximum) - Verified phase mapping
EV Load Balancer supports any charger that exposes the right entities in Home Assistant. See docs/charger-profiles/README.md for requirements and how to contribute support for your charger model.
General requirements for the charger integration:
-
number.*_amp— current setting (6–32A), readable and writable -
select.*_frc— force charge status (pause/resume), writable -
select.*_psm(optional) — phase selection (1/3 phase), writable -
sensor.*_nrg_4/5/6(optional) — current per phase, readable
- Open HACS in Home Assistant (HACS → Integrations)
- Click the menu (⋮) at the top right → Custom repositories
- Paste the URL:
https://github.com/cryptotomte/ev-load-balancer - Select category: Integration
- Click Add → find EV Load Balancer in the list → click Download
- Restart Home Assistant
- Go to Settings → Devices & Services → + Add integration
- Search for EV Load Balancer and follow the configuration guide below
- Copy the folder
custom_components/ev_load_balancer/to your HAcustom_components/folder - Restart Home Assistant
- Add the integration via Settings → Devices & Services
The configuration flow consists of six steps:
| Step | Content |
|---|---|
| 1. Charger profile | Select charger model (e.g. go-e Gemini flex) |
| 2. Serial number | Enter the charger's serial number |
| 3. Entities | Confirm or adjust entity IDs |
| 4. Phases | Configure phase sensors and fuse limits per phase |
| 5. Parameters | Safety margin, min/max current, failsafe behavior |
| 6. Confirm | Review settings and create the integration |
Settings can be adjusted afterwards without having to remove and recreate the integration:
- Phase sensors — change sensors or fuse limits
- Calculation parameters — safety margin, min/max current
- Failsafe behavior — action on sensor loss (reduce/pause) and safe default current
- Capacity warning threshold — limit in Ampere for warning sensor (default 3A)
Open Options Flow via: Settings → Devices & Services → EV Load Balancer → ⚙️
| Phase sensors | Calculation parameters |
|---|---|
![]() |
![]() |
Responsibility split between EV Load Balancer, the charger integration and EV Charging Manager (EVCM).
| Function | EV Load Balancer | Charger integration | EV Charging Manager |
|---|---|---|---|
| Current measurement at fuse | Reads sensors | — | — |
| Calculate available capacity | ✅ | — | — |
| Control charging current (amp) | ✅ Writes | Exposes entity | — |
| Pause/resume (frc) | ✅ Writes | Exposes entity | — |
| Phase switching (psm) | ✅ Writes | Exposes entity | — |
| Failsafe on sensor loss | ✅ | — | — |
| Identify who is charging | — | — | ✅ (RFID) |
| Session management | — | — | ✅ |
| Cost calculation | — | — | ✅ |
| Spot price reading | — | — | ✅ (reads, does not control) |
| API communication with charger | — | ✅ | — |
EV Load Balancer focuses solely on load balancing — keeping the grid load below the fuse limit. The integration does not communicate directly with the charger hardware but goes via the entities exposed by the charger integration.
The charger integration (e.g. ha-goecharger-api2) is responsible for all communication with the charger and exposes the entities that EV Load Balancer controls.
EV Charging Manager (separate integration) handles sessions, RFID cards, cost calculation and spot price optimization — features that are outside EV Load Balancer's scope.
The three components are independent and can be installed individually. EV Load Balancer + charger integration + EVCM can run simultaneously without conflict.
EV Load Balancer can export load balancing decisions to InfluxDB for historical analysis and visualization in Grafana.
Home Assistant automatically logs sensors to its internal database. Configure the InfluxDB integration in HA to also send these sensors:
# configuration.yaml
influxdb:
host: <your-influxdb-host>
include:
entities:
- sensor.ev_load_balancer_status
- sensor.ev_load_balancer_available_min
- sensor.ev_load_balancer_target_current
- sensor.ev_load_balancer_utilizationImport the automation template automations/ev_load_balancer_influxdb_export.yaml
in Home Assistant to export all load balancing events to
measurement ev_load_balancer_events.
Events exported:
| Event | Measurement | Tags | Fields |
|---|---|---|---|
ev_load_balancer_current_adjusted |
ev_load_balancer_events | event_type, charger_profile, state | old_current, new_current, available, reason |
ev_load_balancer_device_paused |
ev_load_balancer_events | event_type, charger_profile, state | reason, available_min |
ev_load_balancer_device_resumed |
ev_load_balancer_events | event_type, charger_profile, state | reason, available_min |
ev_load_balancer_phase_switched |
ev_load_balancer_events | event_type, charger_profile | from_mode, to_mode, reason |
| Visualization | InfluxDB query (concept) |
|---|---|
| Current adjustments per day | COUNT(new_current) WHERE event_type='current_adjusted' GROUP BY time(1d) |
| Average allocated current | MEAN(new_current) WHERE event_type='current_adjusted' GROUP BY time(1h) |
| Number of pauses per week | COUNT(*) WHERE event_type='device_paused' GROUP BY time(7d) |
| Pause reasons (distribution) | COUNT(*) WHERE event_type='device_paused' GROUP BY reason |
| Phase switches per day | COUNT(*) WHERE event_type='phase_switched' GROUP BY time(1d) |
| Capacity utilization | MEAN(utilization_pct) GROUP BY time(1h) |
| Lowest margin per day | MIN(available_min) GROUP BY time(1d) |
Symptom: Charging current does not change even though EV Load Balancer is active and shows a calculated value.
Check:
- Verify that the charger is in the correct mode —
frcmust allow external control (not forced off or on) - Check that entity IDs are correctly configured (Settings → EV Load Balancer → ⚙️)
- Check HA logs (
home-assistant.log) for error messages from EV Load Balancer - Verify that the charger integration is active and that entities do not show
unavailable
Symptom: sensor.ev_load_balancer_status or phase sensors show unavailable.
Check:
- Verify that the phase sensors work: open Developer Tools → States and search for your phase sensors
- Check the network connection to the current meter (Nibe, Shelly, P1 port)
- If phase sensors are unavailable the failsafe activates — check the selected action (reduce/pause) in Options Flow
- Restart Home Assistant and wait ~30 seconds for sensors to initialize
Symptom: Despite EV Load Balancer being active the fuse trips.
Check:
- Check the size of the safety margin — increase from default (2A) to 3–5A via Options Flow
- Verify that the phase sensors measure at the correct point — at the main fuse, not at the distribution board or the charger
- Check that
ama(absolute maximum value) on the charger is set to a safe value (recommendation: 10A) — see goe-gemini.md - Verify that no other large loads (stove, oven) switched on instantaneously — EV Load Balancer reacts to sensor readings, not predictively
Symptom: After HA restart the integration is in INITIALIZING state
for a while.
Explanation: This is normal behavior. After a restart the integration waits for Home Assistant to publish initial sensor values before it can calculate the correct current. This typically takes 10–30 seconds.
If the state persists:
- Check that the phase sensors return numeric values (not
unavailable) - Verify that the charger integration is correctly configured and the entities are available
- Check the logs for any errors during startup
EV Load Balancer is designed with a modular profile architecture. The MVP version includes support for go-e Gemini flex. Support for more chargers is added via community contributions.
Available profiles:
| Profile | Charger | Status | Guide |
|---|---|---|---|
goe_gemini |
go-e Charger Gemini flex | ✅ MVP | goe-gemini.md |
Want to contribute support for your charger?
Read docs/charger-profiles/README.md for a template and instructions on how to open a Pull Request.
EV Charging Manager (EVCM) is a separate integration for Home Assistant that handles charging sessions, RFID cards, cost calculation and scheduling based on spot prices.
EV Load Balancer and EVCM are independent integrations that address different problems:
- EV Load Balancer → How much can I charge right now without the fuse tripping?
- EV Charging Manager → Who is charging? What does it cost? When should I schedule charging?
They can and should be installed together if you want complete charging management. EV Load Balancer sets the capacity ceiling — EVCM optimizes the schedule within that ceiling.
Note: EV Charging Manager can read spot prices and plan charging, but does not control load balancing. EV Load Balancer does not control charging schedules or price sensitivity — it is purely real-time balancing.
MIT License — see LICENSE for details.
Copyright (c) 2026 cryptotomte
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.



