Zum Hauptinhalt springen

OpenEVSE Smart-Home-Integration, kostenlos und Open Source

OpenEVSE-Integration für Gladys Assistant

OpenEVSE chargers over their local HTTP API: state, current, energy, temperature; optional commands.

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

Shows your OpenEVSE charger (ESP32 WiFi module, firmware 4.x or 5.x) in Gladys through its local HTTP API: no cloud, no account, straight on your network.

Never tested with a real charger. Not affiliated with OpenEVSE. The integration talks to the charger as the python-openevse-http library (used by Home Assistant) does. A firmware update may change the API.

What you get​

One device per charger, with:

FeatureContent
StatusNo vehicle, plugged in waiting, charging, paused, disabled, faults
ConnectorAvailable, occupied, faulted or unavailable ("charging station" category)
Charging stateCharging, vehicle connected, paused by the charger, idle
Vehicle plugged inYes / no
PowerIn W (given by the charger, else voltage × current)
Current, voltageIn A, in V
Current offered to the vehicleIn A (the pilot signal)
Energy of the sessionIn kWh, a plain sensor
Energy indexIn kWh, the total counter of the charger, guarded (see below)
Temperature of the chargerIn °C
Manual overrideNone (the charger decides), charge forced on, charge paused
Fault reportedYes / no (ground fault, stuck relay, over temperature…)
Start chargingButton (commands allowed only)
Pause chargingButton (commands allowed only)
Set the charging currentList from 6 A to the ceiling (commands allowed only)

Read every 30 seconds by default (10 s to 10 min, configurable).

Energy index (guarded)​

The energy index is the total counter of the charger (total_energy): Gladys turns it into the consumption and the cost of the charger in its Energy tab. Since Gladys counts every rise in full, the index goes through a guard (the one of the P1 Monitor integration):

  • an index of 0 is never published;
  • a plausible rise (25 kW on average at most since the last value) goes through;
  • a jump up or a drop (counter reset, another charger at the same address) is held back: the last accepted value is sent again, the status of the integration shows it, and the hold is kept in /data across a restart. Neither time nor repetition confirms it;
  • only the Accept the held index button of the configuration takes it, in two clicks: the first shows the value and the kWh at stake, the second (within 2 minutes) takes exactly that value (plus what the charger may have drawn since). A drop accepted bills nothing.

The charger is already counted by your main meter: in the Energy settings of Gladys, put it under your main meter so it is not counted twice. No daily consumption is published.

Installation​

  1. Give the charger a fixed IP address in your router (or use its name openevse-xxxx.local).
  2. Check in its web interface that the WiFi firmware is 4.0 or later (4.1.2 to start the charge and set the current). Firmwares 2.x and 3.x give no serial number: they are not supported.
  3. Install the integration from the Gladys store. In its configuration, enter the IP address of the charger, and, only if its web interface asks for them, the user name and the password (HTTP authentication).
  4. Save, then add the charger from the Discovery tab.

The password is kept by Gladys in its database, never shown again, and sent only to the charger (HTTP Basic authentication). The charger only speaks plain HTTP: the user name and the password travel in clear on your local network, as with the web interface itself. Keep the charger on a trusted network. They are never written to the logs, to /data, nor to a state. The configuration of the charger also holds its own passwords (WiFi, MQTT…): the integration only reads its identity, versions and currents (minimum, maximum, its own current) from it, nothing else is kept. Never paste an address with user:password@: it is refused, and never shown.

The Test the connection button reads the charger once (at most every 10 seconds).

Commands (off by default)​

"Start charging", "Pause charging" and "Set the charging current" refuse every command while Allow the commands is off. On, they go through the manual override of the charger (/override):

  • Pause sets a "paused" override: the charger stops charging. The settings of the override in force (current, session limits, auto release) are kept. The pause is never held back: it goes at once, in one request, without a read, even during another command (which gives way if it has not left yet; otherwise the pause is sent once more when it settles), even within the minute after a start, even during a 429 or 5xx pause, even right after the credentials were refused, whatever the firmware, and even right after a restart of the integration, before any read of the charger (its serial is kept in /data);
  • Start sets a "charge" override (the settings of the override in force are kept); never above the ceiling: the current of the override in force, else the charger's own current (max_current_soft), is lowered to it; refused when the charger does not give its current; refused without a vehicle plugged in, or on a fault or an unknown state; no effect (not sent) when the charger already charges without a pause; after a restart, it waits for a first read of the charger;
  • Charging current: from 6 A (or the hardware minimum of the charger) to the ceiling: the lower of the "Ceiling of the charging current" of the configuration (16 A by default, 80 A at most) and the hardware maximum read from the charger. The state of the override in force is kept: a pause stays a pause, changing the current never starts the charge again. WiFi firmware 4.1.2 or later.
  • One start or current change a minute at most: no fine regulation from Gladys.

They are buttons and a list, never switches: a "turn everything off" (from Gladys, Google Home, Alexa or HomeKit) never reaches them. A scene may trigger them, only through an explicit action, and only when the commands are allowed. Note that the AI chat of Gladys (MCP) can create and run such a scene: while the commands are allowed, it can start or pause the charge.

Before a start or a current change, the integration reads the charger again (state and override) and decides on that read only; the option is checked again right before sending. A command that cannot leave within 3.5 seconds is refused unsent. When the charger does not confirm (silence, a 5xx, an answer not understood), Gladys shows "Command sent, without confirmation": check the state, read again 5 then 20 seconds later. When a command stayed without confirmation, it may still reach the charger later: a pause sent within the next 90 seconds is watched, and sent again (twice at most) if a read shows the charge allowed again while no other command left.

The manual override keeps the behaviour of the charger: with "auto release" (a setting of the override), it ends when the vehicle is unplugged; a pause is then never reaffirmed without a vehicle. When the charger cannot say there is no override (a 404 without the firmware's message), start and the current are refused.

Errors and limits​

  • Charger unreachable: only the connector ("unavailable") and the status ("Charger unreachable") change; the other values keep their last one. New try after 30 s, 1, 2, then 5 minutes, never faster than the interval.
  • Credentials refused (or asked for while none is given): the status says so; new tries after 15 minutes, 1 hour, then every 6 hours, never sooner (kept in /data across a restart); saving new credentials tries again at once.
  • 429 (too many requests) or 5xx: a pause (1 minute to 6 hours for a 429) for the reads and the commands but the pause of the charge, never shorter than the interval, kept in /data across a restart.
  • One charger per integration. Neither the solar mode (divert), the schedule, the session limits, a restart nor the firmware can be changed from Gladys. The websocket of the charger is not used (periodic reads).
  • An OpenEVSE charger linked to an OCPP server (for example sescandell's OCPP integration) may be driven from both sides: the last command wins. Pick one driver.
  • The logs never hold the text of the charger's answers, the user name nor the password.

Credits​

Port of python-openevse-http (firstof9, Apache-2.0, version 1.9.0), the library of Home Assistant's OpenEVSE integration. Apache-2.0 license.

Konfigurationseinstellungen​

Diese Einstellungen fragt OpenEVSE in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
Your OpenEVSE chargersectionNeinShows your OpenEVSE charger (WiFi firmware 4.0 or later) in Gladys through its local HTTP API, without any cloud: state, vehicle plugged in, power, current, voltage, current offered, energy of the session, energy index, temperature, manual override. Enter the IP address of the charger (give it a fixed address in your router), and the user name and password of its web interface if you set some, save, then add it from the Discovery tab. Starting, pausing and the charging current can be changed from Gladys only if you allow the commands below. Never tested with a real charger. Not affiliated with OpenEVSE.
IP address of the chargerstringJaAn IPv4 address or a host name (openevse-xxxx.local), optionally followed by a port (80 by default).
User name of the web interfacestringNeinOnly if the web interface of the charger asks for one (Settings, HTTP authentication). Leave empty otherwise. Never in the address field.
Password of the web interfacesecretNeinWith the user name above. Kept by Gladys in its database, never shown again, sent only to the charger, in clear (HTTP Basic authentication) on the local network. Refused credentials are tried again after 15 min, 1 h, then every 6 h.
Allow the commandsbooleanNeinOff by default. On: Gladys may start and pause the charge (buttons) and set the charging current (list, 6 A to the ceiling below). Off: these three features refuse every command. Once on, the pause is never held back.
Ceiling of the charging current (A)numberNeinThe highest current Gladys may ask for, the start included: the lower of this value (16 A by default) and the hardware maximum read from the charger.
Refresh interval (s)numberNeinHow often the charger is read, in seconds.
Language of the feature namesselectNeinUsed for the feature names of the devices added from now on, for the status texts and for the command errors.

So installierst du OpenEVSE in Gladys​

  1. Öffne in Gladys Integrationen: OpenEVSE erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/lm1lc3n7/gladys-openevse:0.1.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-openevse.

OpenEVSE benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.

Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.

Über externe Integrationen​

OpenEVSE ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von LM1LC3N7 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂