Skip to main content

evcc smart home integration, free and open source

evcc integration for Gladys Assistant

Solar EV charging with evcc: energy flow, loadpoints, vehicles, modes and limits.

This integration brings evcc into Gladys. evcc controls the charging of electric vehicles with solar surplus, dynamic tariffs or a charging plan. Gladys follows evcc live (solar production, home, grid, battery, loadpoints, vehicles), changes the charging mode and the limits, and runs scenes when a vehicle is plugged in or a charge finishes.

The integration talks to evcc on your local network, without any cloud. It was developed and tested against evcc's demo mode (versions 0.210 and 0.317), without a real charger: feedback welcome.

Requirements​

  • Gladys Assistant 5.1 or newer.
  • evcc running on your network (Raspberry Pi, Docker, Home Assistant…), version 0.200 or newer recommended. Older versions are read as well as possible.
  • The address of evcc, as you open it in your browser, for example http://192.168.1.20:7070. Gladys must be able to reach it.

Configuration​

  1. Integrations → evcc, then Configuration.
  2. evcc address: the address of its web interface. Without a port, 7070 is used. Behind a reverse proxy, a path is allowed (https://example.org/evcc).
  3. Admin password: optional. Recent evcc versions change the mode and the limits without it. If your evcc (or your proxy) answers "unauthorized", enter it.
  4. Language of the feature names: French by default. The names are frozen when you add the device.
  5. Save, then click Test the connection: the evcc version and the number of loadpoints and vehicles are shown.
  6. In the Discover tab, add the devices you want.

The integration follows evcc through its websocket: values arrive at every evcc cycle (30 s by default). If the websocket drops, it reads the state every 30 s and reconnects by itself.

The devices​

Site​

One device named after your evcc site, with what evcc measures:

FeatureDetail
Solar productionW, if evcc has a PV meter
Home consumptionW
GridW, positive when the house imports, negative when it exports
Home batterylevel in %, charging and discharging power in W, if there is a battery
Grid pricecurrent price of a kWh, if a tariff is configured in evcc

Loadpoint​

One device per evcc loadpoint:

FeatureDetail
Modecontrollable: Off, Solar, Min + solar, Fast
Charging statecharging, plugged in, waiting (evcc waits for the sun or a slot), paused (vehicle full), idle
Vehicle plugged inyes or no
Charging powerkW
Charging currentA
Session energykWh charged since plugging in
Time remainingminutes, evcc's estimate while charging
Charge limitcontrollable: battery level aimed at for this session, in %
Vehiclename of the vehicle evcc identified
Cheap grid chargingevcc charges because the grid is cheap (dynamic tariff)
Charger meterindex in kWh, if the charger has a meter: Gladys derives its consumption and cost in the energy monitoring

Since evcc 0.317, the "Solar" mode is called Smart in evcc, and "Min + solar" is Smart with the Always charge option. The integration keeps the four historical modes, understood by every evcc version.

An integrated device (heat pump, socket switched by evcc) only has the mode, the state, the power, the energy and the meter.

Vehicle​

One device per vehicle configured in evcc:

FeatureDetail
Battery level%, known while the vehicle is plugged in (the last value stays)
Rangekm, likewise
Charge limitcontrollable: maximum battery level of the vehicle in evcc, in %
Plugged inthe vehicle is plugged into a loadpoint
Charging planthe next plan (level and time), or "No plan"

Dashboard widget​

The evcc widget shows the energy flow (solar, home, grid in kW), the home battery, the grid price and one row per loadpoint (state, power, mode). Four buttons change the mode of a loadpoint: the one chosen in the widget settings, otherwise the first one. The current mode carries a check mark. If evcc stops answering, the widget shows the last known values, without buttons.

Scene triggers​

TriggerWhenVariables
Vehicle plugged ina vehicle is plugged in, once evcc identified it (2 minutes at most)loadpoint, vehicle
Vehicle unpluggeda vehicle is unpluggedloadpoint, vehicle, energy charged (kWh), time plugged in (minutes)
Charging starteda charge starts; a short pause (clouds) is not a new chargeloadpoint, vehicle, mode
Charging finishedthe charge stopped for 10 minutes, or the vehicle was unpluggedloadpoint, vehicle, energy (kWh), charging time (minutes), solar share (%)
Charging mode changedthe mode of a loadpoint changes, in evcc or from Gladysloadpoint, new mode, previous mode

In a message, a variable is written {{triggerEvent.data.vehicle}}, {{triggerEvent.data.energy_kwh}}…

Each trigger can be limited to a loadpoint and, except the mode change, to a vehicle. The mode change can be limited to one mode.

Scene actions​

ActionEffect
Set the charging modeOff, Solar, Min + solar or Fast on a loadpoint
Set a charge limitbattery level (%) of a loadpoint or a vehicle, or energy (kWh) of a loadpoint; 0 removes the limit

A refused action (evcc unreachable, value out of range, a device that is not a loadpoint) fails with a clear message, and the scene goes on.

Scene examples​

  • Fast charge in the evening if the battery is low: at 9 pm, if the battery level of the vehicle is below 30 %, set the mode of the loadpoint to Fast, then set the limit to 60 %.
  • Know when the car is full: trigger "Charging finished" on your vehicle, send "Charge finished: {{triggerEvent.data.energy_kwh}} kWh, {{triggerEvent.data.solar_percent}} % solar".
  • Back to solar when leaving: trigger "Vehicle unplugged", set the mode to Solar so that the next charge starts on the surplus again.

Troubleshooting​

  • "evcc does not answer at the configured address": open the address in a browser from the network of Gladys. Check the port (7070 by default) and that no firewall blocks Gladys.
  • "The configured address does not answer like evcc": the address points to another service, or a proxy returns an error page.
  • "evcc asks for its admin password": enter it in the configuration.
  • The battery level of a vehicle does not move: evcc only reads the vehicle while it is plugged in (or if it has a car maker integration). The last value stays shown.
  • "Vehicle plugged in" comes with an empty vehicle: evcc did not identify the vehicle within 2 minutes. Check the identification in evcc, or set a default vehicle on the loadpoint.
  • Detailed logs: add the variable LOG_LEVEL=debug to the container.

Limitations​

  • One evcc instance per installation of the integration.
  • Charging plans are read but not created from Gladys (use evcc).
  • Repeating plans (every weekday) are not shown.
  • The number of phases, the minimum and maximum current, the home battery and the advanced settings stay in evcc.
  • Developed without a real charger, against evcc's demo mode: feedback welcome on the Gladys forum.
  • Independent project, not affiliated with evcc.

Configuration settings​

These are the settings evcc asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Connect your evccsectionNoEnter the address of evcc as you open it in your browser (port 7070 by default). The integration follows evcc live through its websocket. The admin password is only needed if your evcc asks for it to change a mode or a limit.
evcc addressstringYesWithout a port, 7070 is used. A path is allowed behind a reverse proxy.
Admin password (optional)secretNoRecent evcc versions change modes and limits without it.
Language of the feature namesselectNo

How to install evcc in Gladys​

  1. In Gladys, open Integrations: evcc appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/guim31/gladys-evcc:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/guim31/gladys-evcc.

evcc requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

evcc is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂