API
Mit evcc kann über REST und MQTT APIs interagiert werden.
Alle API IDs (z.B. die Loadpoint ID) beginnen bei 1
.
REST API
GET /api/state
: evcc state (static configuration and dynamic state as JSON object)GET /api/health
: evcc health checkPOST /api/buffersoc/<soc>
: battery buffer SoC in %POST /api/prioritysoc/<soc>
: battery priority SoC in %POST /api/residualpower/<power>
: grid residual power in WPOST /api/smartcostlimit/<cost>
: smart charging cost limit (previously known as "cheap" tariff)GET /api/tariff/<type>
: list of prices (grid/feedin/planner)GET /api/sessions[?format=csv&lang=<lang>]
: charging sessionsGET /api/telemetry
: telemetry enabled statusPOST /api/telemetry/<status>
: enable/disable telemetry (true/false)
Loadpoint
POST /api/loadpoints/<id>/mode/<mode>
: charge mode (off/pv/minpv/now)POST /api/loadpoints/<id>/minsoc/<soc>
: minimum SoC in %POST /api/loadpoints/<id>/target/soc/<soc>
: target SoC in %POST /api/loadpoints/<id>/target/energy/<energy>
: target energy in kWhPOST /api/loadpoints/<id>/target/time/<time>
: target time in RFC3339 / ISO format **DELETE /api/loadpoints/<id>/target/time
: disable target chargingGET /api/loadpoints/<id>/target/plan[?targetTime=<time>]
: charging plan detailsPOST /api/loadpoints/<id>/phases/<phases>
: enabled phases (0=auto/1=1p/3=3p)POST /api/loadpoints/<id>/mincurrent/<current>
: current minCurrent value in APOST /api/loadpoints/<id>/maxcurrent/<current>
: current maxCurrent value in APOST /api/loadpoints/<id>/enable/threshold/<threshold>
: threshold value in WPOST /api/loadpoints/<id>/disable/threshold/<threshold>
: threshold value in W
Beispiel: curl -X POST http://evcc:7070/api/loadpoints/1/mode/pv
um den Lademodus des 1. Ladepunkts auf pv
zu stellen.
MQTT API
Die MQTT API folgt der REST API Struktur:
evcc
: root topicevcc/status
: status (online
/offline
)evcc/updated
: timestamp of last updateevcc/site
: site dynamic stateevcc/site/bufferSoc
: battery buffer SoC (writable)evcc/site/prioritySoc
: battery priority SoC (writable)evcc/site/residualPower
: grid residual power (writable)evcc/site/smartcostlimit
: smart charging cost limit (previously known as "cheap" tariff) (writable)evcc/loadpoints
: number of available loadpointsevcc/loadpoints/<id>
: loadpoint dynamic stateevcc/loadpoints/<id>/mode
: loadpoint charge mode (writable)evcc/loadpoints/<id>/minSoc
: loadpoint minimum SoC (writable)evcc/loadpoints/<id>/targetSoc
: loadpoint target SoC in % (writable)evcc/loadpoints/<id>/targetEnergy
: loadpoint target energy in kWh (writable)evcc/loadpoints/<id>/targetTime
: loadpoint target time in RFC3339 / ISO format (writable) **evcc/loadpoints/<id>/phases
: loadpoint enabled phases (writable)evcc/loadpoints/<id>/minCurrent
: loadpoint current minCurrent value (writable)evcc/loadpoints/<id>/maxCurrent
: loadpoint current maxCurrent value (writable)evcc/loadpoints/<id>/enableThreshold
: loadpoint threshold value (writable)evcc/loadpoints/<id>/disableThreshold
: loadpoint threshold value (writable)
Um schreibbare Einstellungen durchzuführen, muss ein /set
am Ende des Topics hinzugefügt werden an welches der neue Wert gesendet wird.
Beispiel: mosquitto_pub -t "evcc/loadpoints/1/phases/set" -m "3"
um die Anzahl der netzseitigen Phasen am 1. Ladepunkt auf 3
festzulegen.
** Zeitangabe efolgt in UTC im Format yyyy-mm-ddThh:mm:ssZ
Beispiele:
2023-03-05T07:00:00Z
= 5. März 2023 um 8:00 Uhr MEZ
2023-08-17T19:30:00Z
= 17. August 2023 um 21:30 Uhr MESZ