EVCC · Autoconsumo · Fronius · SMA · SG Ready · KNX · 10 min di lettura

EVCC Autoconsumo Ricarica VE con KNX: Coordinamento Fronius Modbus e SG Ready

EVCC (Electric Vehicle Charge Controller) è un controller open-source per l'autoconsumo che legge la produzione PV in tempo reale da inverter Fronius o SMA tramite Modbus TCP e regola automaticamente la corrente di ricarica del VE per corrispondere all'eccedenza solare esportata – integrato con KNX tramite il plugin EVCC KNX per la commutazione di modalità e il monitoraggio dallo strato di automazione dell'edificio.

Panoramica EVCC: cosa fa e come funziona

EVCC è un progetto open-source (github.com/evcc-io/evcc) che funge da controllore dedicato per l'autoconsumo nella ricarica dei veicoli elettrici. Si collega all'inverter solare per leggere la generazione in tempo reale e la potenza di rete, si collega a uno o più caricabatterie EV tramite OCPP o API native e regola continuamente la corrente di carica per massimizzare la frazione di energia solare utilizzata per la ricarica EV anziché essere esportata in rete.

EVCC viene eseguito come contenitore Docker o come add-on di Home Assistant, rendendo semplice il deployment su un Raspberry Pi 4 insieme a Home Assistant. La dashboard web di EVCC fornisce una visualizzazione in tempo reale della potenza PV, del flusso di rete, del SOC della batteria e dello stato di ricarica EV. Per l'integrazione KNX, il plugin KNX EVCC — abilitato in evcc.yaml — pubblica le variabili di stato EVCC sugli indirizzi di gruppo KNX e legge gli indirizzi di gruppo di selezione modalità dai pulsanti KNX.

Opzioni di deployment EVCC

  • Raspberry Pi 4 (4 GB): EVCC come contenitore Docker, funziona 24/7 a ~4 W
  • Home Assistant OS: Add-on ufficiale EVCC, configurazione a server singolo
  • Synology NAS: Container Docker in Container Manager
  • VM Proxmox: Docker o binario Linux nativo per configurazioni homelab

Supporto veicoli EVCC (elenco parziale)

  • Tesla (Model 3, Model Y, Model S) — tramite API Tesla
  • VW ID.4, ID.3 — tramite API WeConnect
  • Hyundai Ioniq 5, Ioniq 6 — tramite API Bluelink
  • BMW iX, i4 — tramite API BMW ConnectedDrive
  • Veicolo generico (nessuna API): limite batteria fisso 80%

Configurazione Modbus Fronius GEN24 in evcc.yaml

EVCC legge l'inverter Fronius GEN24 tramite SunSpec Modbus TCP utilizzando il tipo di contatore Fronius integrato. La configurazione richiede un IP statico per l'inverter e Modbus TCP abilitato nel pannello delle impostazioni del server web Fronius.

evcc.yaml — configurazione contatore e caricabatterie Fronius GEN24

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 — alternativa SMA Energy Meter

# 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: grid

Plugin EVCC KNX: abilitazione e configurazione

Il plugin EVCC KNX collega EVCC al bus KNX tramite un'interfaccia IP KNX (KNXnet/IP tunnelling o routing). Pubblica lo stato del punto di ricarica EVCC su indirizzi di gruppo KNX e ascolta i comandi di modalità da pulsanti KNX o scene di automazione. Abilitalo in evcc.yaml nella sezione messaging o plugins.

evcc.yaml — configurazione del plugin KNX

# 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)
Modalità EVCCValore KNXComportamentoAttivazione da KNX
spento0Nessuna ricarica — EV disconnesso dalla programmazionePressione lunga del pulsante o override manuale
ora (veloce)1Carica alla corrente massima indipendentemente dal solareShort press: 'Charge Now' scene
minpv2Carica al minimo (6A) + aumento con surplus solareShort press: 'Min + Solar' scene
pv3Solo solare: sospendi sotto soglia 6A, riprendi in caso di eccedenzaPredefinito / programmazione KNX alle 09:00

Coordinamento pompa di calore SG Ready: logica di priorità

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.

Logica di coordinamento priorità SG Ready + EVCC

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 import

Configurazione caricatore EVCC ABB Terra

I caricabatterie ABB Terra AC (11 kW e 22 kW) sono comunemente specificati negli edifici KNX commerciali. EVCC supporta ABB Terra tramite OCPP 1.6J utilizzando lo stesso approccio di configurazione di Easee, con un formato URL di connessione OCPP leggermente diverso.

evcc.yaml — Configurazione del caricabatterie ABB Terra

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)

Dashboard EVCC con indirizzi di gruppo di stato KNX

Il dashboard web EVCC (accessibile all'indirizzo http://evcc-server-ip:7070) fornisce una visualizzazione in tempo reale dell'autoconsumo. Per i sistemi di visualizzazione KNX (Gira X1, IP-Symcon, ARISTO BewO), gli indirizzi di gruppo di stato KNX di EVCC alimentano i dati in tempo reale ai display dei pannelli e ai dashboard delle app mobili.

Integrazione della visualizzazione KNX per lo stato EVCC

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

Messa in servizio con dati PV in tempo reale

La messa in servizio di EVCC dovrebbe essere eseguita in un giorno con generazione solare attiva per verificare che l'intera catena – dai dati Modbus Fronius attraverso la logica EVCC fino alla regolazione della corrente OCPP e agli aggiornamenti degli indirizzi di gruppo KNX – funzioni correttamente in condizioni operative reali.

Sequenza di test di messa in servizio EVCC

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

Hai bisogno di un pannello per l'autoconsumo EVCC con integrazione KNX?

Configuriamo EVCC con Fronius o SMA Modbus, setup del plugin KNX, logica di coordinamento SG Ready e documentazione completa di commissioning — distribuito e testato su Raspberry Pi o HA Green insieme al tuo pannello KNX.

Richiedi un preventivo →
Caricamento in corso ...
Torna all'inizio