EVCC Self-Consumption EV Charging with KNX: Fronius Modbus and SG Ready Coordination
EVCC (Electric Vehicle Charge Controller) is an open-source self-consumption controller that reads live PV generation from Fronius or SMA inverters via Modbus TCP and automatically adjusts EV charge current to match surplus solar export — integrated with KNX via the EVCC KNX plugin for mode switching and status monitoring from the building automation layer.
EVCC overview: what it does and how it runs
EVCC is an open-source project (github.com/evcc-io/evcc) that acts as a dedicated self-consumption controller for electric vehicle charging. It connects to the solar inverter to read real-time generation and grid power, connects to one or more EV chargers via OCPP or native APIs, and continuously adjusts charge current to maximise the fraction of solar energy used for EV charging rather than exported to the grid.
EVCC runs as a Docker container or as a Home Assistant add-on, making it straightforward to deploy on a Raspberry Pi 4 alongside Home Assistant. The EVCC web dashboard provides real-time visualisation of PV power, grid flow, battery SOC, and EV charging state. For KNX integration, the EVCC KNX plugin — enabled in evcc.yaml — publishes EVCC state variables to KNX group addresses and reads mode selection GAs from KNX pushbuttons.
EVCC deployment options
- Raspberry Pi 4 (4GB): EVCC as Docker container, runs 24/7 on ~4W
- Home Assistant OS: EVCC official add-on, single server setup
- Synology NAS: Docker container in Container Manager
- Proxmox VM: Docker or native Linux binary for homelab setups
EVCC vehicle support (partial list)
- Tesla (Model 3, Model Y, Model S) — via Tesla API
- VW ID.4, ID.3 — via WeConnect API
- Hyundai Ioniq 5, Ioniq 6 — via Bluelink API
- BMW iX, i4 — via BMW ConnectedDrive API
- Generic vehicle (no API): fixed 80% battery limit
Fronius GEN24 Modbus configuration in evcc.yaml
EVCC reads the Fronius GEN24 inverter via SunSpec Modbus TCP using the built-in Fronius meter type. The configuration requires a static IP for the inverter and Modbus TCP enabled in the Fronius webserver settings panel.
evcc.yaml — Fronius GEN24 meter and charger configuration
meters:
- name: fronius_pv
type: template
template: fronius-symo
uri: http://192.168.1.100 # Fronius static IP
usage: pv # PV generation meter
- name: fronius_grid
type: template
template: fronius-smart-meter
uri: http://192.168.1.100
usage: grid # Grid import/export meter
- name: fronius_battery
type: template
template: fronius-battery
uri: http://192.168.1.100
usage: battery # Battery SOC + charge power (GEN24 Plus only)
chargers:
- name: easee_home
type: template
template: easee
user: user@email.com
password: EaseeAppPassword
charger: XXXXXXXX # Easee charger serial number
vehicles:
- name: my_tesla
type: template
template: tesla
title: Tesla Model 3
accessToken: <Tesla API token>
refreshToken: <Tesla refresh token>
site:
title: Home
meters:
grid: fronius_grid
pv: fronius_pv
battery: fronius_battery
loadpoints:
- title: EV Charger
charger: easee_home
vehicle: my_tesla
mode: pv # Default: PV-only self-consumption mode
minCurrent: 6 # Minimum 6A (1.38kW @ 230V)
maxCurrent: 16 # Maximum 16A (3.68kW @ 230V)evcc.yaml — SMA Energy Meter alternative
# SMA Sunny Boy + SMA Energy Meter
meters:
- name: sma_pv
type: template
template: sma-sunnyboy
uri: https://192.168.1.101 # SMA inverter static IP (HTTPS)
password: <SMA web UI password>
usage: pv
- name: sma_grid
type: template
template: sma-energymeter
# SMA Energy Meter uses Multicast UDP — no IP config needed
serial: 1234567890 # Serial from SMA Energy Meter label
usage: gridEVCC KNX plugin: enabling and configuring
The EVCC KNX plugin connects EVCC to the KNX bus via a KNX IP interface (KNXnet/IP tunnelling or routing). It publishes EVCC loadpoint state to KNX group addresses and listens for mode commands from KNX pushbuttons or automation scenes. Enable it in evcc.yaml under the messaging or plugins section.
evcc.yaml — KNX plugin configuration
# evcc.yaml — KNX plugin section knx: gateway: 192.168.1.10 # KNX IP interface / IP router static IP # or use: gateway: 224.0.23.12 (KNX multicast for IP routing) # Mode selection GAs — written by KNX pushbutton or automation # Values: 0=off, 1=now (fast), 2=minpv (min+pv), 3=pv (solar only) mode: "10/1/0" # Status GAs — published by EVCC to KNX (read-only from KNX side) activeMode: "10/1/1" # Current active mode (DPT 5.010) charging: "10/1/2" # Charging active boolean (DPT 1.001) chargePower: "10/1/3" # Current charge power W (DPT 13.010) sessionEnergy: "10/1/4" # Session energy kWh (DPT 14.056) vehicleSoc: "10/1/5" # Vehicle SOC % (DPT 5.001, if API connected) pvPower: "10/1/6" # PV power W from inverter (DPT 13.010) gridPower: "10/1/7" # Grid power W signed (DPT 13.010)
| EVCC Mode | KNX value | Behaviour | Trigger from KNX |
|---|---|---|---|
| off | 0 | No charging — EV disconnected from schedule | Long press pushbutton or manual override |
| now (fast) | 1 | Charge at maximum current regardless of solar | Short press: 'Charge Now' scene |
| minpv | 2 | Charge at minimum (6A) + increase with solar surplus | Short press: 'Min + Solar' scene |
| pv | 3 | Solar-only: suspend below 6A threshold, resume when surplus | Default / KNX schedule at 09:00 |
SG Ready heat pump coordination: priority logic
When both EVCC (controlling EV charging) and SG Ready (controlling heat pump) compete for the same PV surplus, a priority arbitration layer prevents grid import while maximising total self-consumption across both loads. The coordination logic runs in KNX (MDT Logic Module) or Home Assistant automations using EVCC's KNX status GAs.
SG Ready + EVCC priority coordination logic
Source data from KNX GAs (all published by EVCC KNX plugin):
GA 10/1/6 = PV power W (from Fronius Modbus)
GA 10/1/7 = Grid power W (negative = export, positive = import)
GA 10/1/3 = Current EV charge power W
Priority logic (KNX Logic Module or HA automation):
STEP 1 — Heat pump base load:
IF GA 10/1/7 < −500W (exporting > 500W):
→ SG Ready State 3 (S2=1, S1=0) = encouraged mode
Heat pump increases setpoint by +2°C, absorbs ~1 kW extra
STEP 2 — EV charging from remainder:
Available for EV = GA 10/1/7 (grid export W) − 0W margin
IF available > 1400W (enough for 6A minimum):
→ Write EVCC mode=pv to GA 10/1/0 (value 3)
EVCC automatically adjusts current to use remaining surplus
STEP 3 — Maximum surplus (SG Ready State 4):
IF GA 10/1/7 < −6000W AND EVCC charging at maximum (16A):
→ SG Ready State 4 (S1=1, S2=1) = maximum HP power
Heat pump runs at rated capacity, absorbs 3–6 kW additional
STEP 4 — Grid import prevention:
IF GA 10/1/7 > +200W (importing more than 200W):
→ SG Ready → State 2 (normal, reduce heat pump load)
→ If still importing after 60s: EVCC mode=off (suspend EV)
Prevents the heat pump + EV combination from causing grid importEVCC ABB Terra charger configuration
ABB Terra AC chargers (11 kW and 22 kW) are commonly specified in commercial KNX buildings. EVCC supports ABB Terra via OCPP 1.6J using the same configuration approach as Easee, with a slightly different OCPP connection URL format.
evcc.yaml — ABB Terra charger configuration
chargers:
- name: abb_terra_1
type: template
template: ocpp
id: ABBTerra01 # Charge point ID configured in ABB Terra
# ABB Terra OCPP central system URL in charger settings:
# ws://192.168.1.200:8887/ABBTerra01
maxCurrent: 32 # ABB Terra AC W22 max 32A 3-phase
# ABB Terra specific: enable OCPP in charger web UI
# URL: http://<ABB-terra-IP>/configuration
# OCPP Central System URI: ws://evcc-server-ip:8887/ABBTerra01
# OCPP version: OCPP16 (select from dropdown)EVCC dashboard with KNX status group addresses
The EVCC web dashboard (accessible at http://evcc-server-ip:7070) provides live self-consumption visualisation. For KNX visualisation systems (Gira X1, IP-Symcon, ARISTO BewO), the EVCC KNX status GAs feed real-time data to panel displays and mobile app dashboards.
KNX visualisation integration for EVCC status
Gira X1 / Gira HomeServer visualisation page: Display widget: "PV Power" → reads GA 10/1/6 (DPT 13.010 W) Display widget: "Grid Power" → reads GA 10/1/7 (DPT 13.010 W) Display widget: "EV Charging W" → reads GA 10/1/3 Toggle button: "Charge Mode" → writes 1/2/3 to GA 10/1/0 Indicator lamp: "Charging Active" → reads GA 10/1/2 (DPT 1.001) IP-Symcon dashboard: Create KNX variables linked to EVCC GAs Dashboard widget type: Gauge (PV Power, 0–10000W) Dashboard widget type: LED indicator (Charging Active) Dashboard widget type: Selector (Mode: Off/Now/MinPV/PV) → Variable change triggers IPS script to write GA 10/1/0 KNX touch panel (e.g. Gira e2 or MDT IP touch panel): EV charging page with live power values Mode selector from page pushbutton widgets Session energy total shown in kWh display element
Commissioning with live PV data
EVCC commissioning should be performed on a day with active solar generation to verify that the complete chain — from Fronius Modbus data through EVCC logic to OCPP current adjustment and KNX GA updates — functions correctly under real operating conditions.
EVCC commissioning test sequence
Step 1 — Inverter data verification: Open EVCC dashboard (http://evcc-ip:7070) Confirm: PV power > 0W on sunny morning by 10:00 Confirm: Grid power negative (exporting) when PV > building load Cross-check: EVCC PV power should match Fronius webserver ±5% Step 2 — Charger connection test: Plug EV into charger EVCC dashboard: Loadpoint shows "Connected" status Vehicle SOC displayed (if API configured) Step 3 — PV mode test: Set EVCC mode: PV (write 3 to GA 10/1/0 from ETS6) Observe: EVCC begins charging when surplus > 1.4 kW EVCC dashboard: current slider visible and tracking solar Step 4 — KNX status GA verification: ETS6 Group Monitor: watch GA 10/1/3 (charge power) Verify: value updates every 30 seconds as current changes Watch GA 10/1/2: confirms 1 (true) when EV charging active Step 5 — Mode switching from KNX: ETS6 → write 1 to GA 10/1/0 (mode: now/fast) Confirm: EVCC dashboard shows "Now" mode, current jumps to 16A Write 3 back → confirm PV mode resume, current reduces to surplus-matched level Step 6 — SG Ready coordination test: With EV charging at 6A (low surplus): confirm SG Ready stays at State 2 With >3kW surplus: confirm SG Ready activates State 3 Confirm EV current increases alongside SG Ready activation
Need an EVCC self-consumption panel with KNX integration?
We configure EVCC with Fronius or SMA Modbus, KNX plugin setup, SG Ready coordination logic, and full commissioning documentation — deployed and tested on a Raspberry Pi or HA Green alongside your KNX panel.
Request a quote →