Saltar al contenido principal

Integración domótica Charger Station, gratuita y de código abierto

Integración Charger Station para Gladys Assistant

Follow your charging stations in Gladys, live, through the OCPP protocol.

info

La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.

Supervision. This integration observes any number of OCPP 1.6 charge points and shows their state in Gladys (connector status, charging state, power, current, voltage, total energy). There is no way to start, stop, or limit a charge from Gladys yet; the only command is the permanent cable lock of Autel charge points (see "Cable lock" below).

How it works​

flowchart LR
CP(["Charge point"]) <-->|OCPP, WebSocket| Relay["OCPP relay"]
Relay <-->|OCPP, forwarded| Cloud[("Vendor cloud")]
Relay <-.->|state and config, HTTP| Gladys[("Gladys")]

The integration runs its own OCPP relay. Every charge point connects to the same URL — the relay tells them apart by the identity each one announces on connection. The moment a charge point points at that URL (see Setup below), the relay supervises it automatically, with no need to declare it in Gladys first: it answers it normally, so charging itself keeps working. But until you attach it to its own origin cloud, that cloud is completely out of the loop — nothing that goes through the vendor's app (remote start/stop, live status, charge history) works during that window, since the vendor's backend has no connection to the charge point at all. Attaching the origin cloud changes that: the relay then also forwards the charge point's traffic there, and the vendor's app works exactly as before again. The relay only observes what passes through it to build the state shown in Gladys; it never invents or withholds anything on the wire, in either mode.

Prerequisites​

Gladys 5.1.0 or later. The charge point state is published using Gladys's charging-station device features, and the dashboard widget relies on integration widgets — older versions don't know about either.

Each charge point's vendor app or portal must let you view and change the OCPP server URL it connects to. Not every vendor exposes this — if yours doesn't, this integration cannot be used for that charge point.

Before changing anything, write down the OCPP server URL currently shown by the vendor app. It is the only way back to the vendor's own cloud if you ever want to stop using this integration for that charger.

Setup​

Five steps, once per charge point. Nothing is lost along the way: the charge point keeps its own connection to the vendor's cloud, Gladys simply sits in the middle and watches.

  1. Write down the OCPP server URL your charge point currently uses, from its vendor app. This is your only way back to the vendor's cloud — keep it somewhere safe.
  2. Point the charge point at Gladys: in that same app, replace the URL with the one shown in the walkthrough on the integration's Configuration screen — it's filled in for you, address and port included. The same URL works for every charge point.
  3. Add it to Gladys: it connects immediately and appears in the Discovery tab, already supervised. Add it from there.
  4. Give it back its cloud: on the Configuration screen, run the "Add a charge point" action, pick it from the list, and paste the URL from step 1 — exactly as the vendor app showed it, including any trailing query string some vendors use (e.g. ending in ?sn=).
  5. Done. The charge point reconnects on its own within seconds and carries on talking to its vendor's cloud exactly as before, through Gladys — which now follows it live.

Repeat for every other charge point: same Gladys URL, its own vendor URL, even a different vendor.

To fix a mistake or change a charge point's origin cloud URL, run the action again for the same charge point with the corrected URL (check its current URL on its device card first). To detach a charge point from its cloud and put it back into local-only supervision, run the action for it with an empty URL — takes effect the next time that charge point reconnects (it keeps relaying through its current connection until then).

If you delete a charge point's device from Gladys while it still has an origin cloud configured, it disappears from the picker and the action can no longer change it — the relay keeps using that cloud. Add the device back from Discovery to regain control of it.

Starting over​

Uninstalling the integration removes everything it created: its devices, its stored configuration, and the relay's own container and data. Nothing is left behind, so reinstalling starts genuinely fresh.

To go back to your vendor's cloud directly, put the URL you noted in step 1 back into the charge point's app — it stops going through Gladys at its next reconnection.

What you see on a charge point​

Each connector reports two state features, plus its measurements (power, current, voltage, total energy):

  • Status — what the connector itself is doing: Available, Occupied, Reserved, Unavailable, Faulted.
  • Charging state — what the session is doing: Charging, Vehicle connected, Paused (vehicle), Paused (charger), Idle.

OCPP 1.6 charge points report a single, more detailed status, which is split across those two: Preparing and Finishing both show as "Occupied / Vehicle connected" (a vehicle is physically connected in both cases), Charging as "Occupied / Charging", and SuspendedEV/SuspendedEVSE as "Occupied / Paused (vehicle)"/"Occupied / Paused (charger)". When no session is in progress, the charging state reads Idle. Both features stay empty until the charge point has reported its status at least once.

Values update as they happen, within a few seconds: the relay tells the integration about every change it observes rather than being asked at intervals. A charge point that connects for the first time also appears in Discovery on its own, without waiting for a refresh.

Cable lock (Autel)​

Autel charge points can keep their cable permanently locked in the connector (vendor feature, not part of standard OCPP). On those charge points, each connector gets a Cable lock switch, which you can use in Gladys (dashboard, scenes…) and in the widget. It only appears once the charge point has confirmed it has the function: shortly after it connects, the relay asks it for its list of supported functions (a standard OCPP request, the vendor's own cloud does the same).

  • The charge point never reports this state by itself. The integration learns it from the lock and unlock commands it sees go by — whether sent from Gladys or from the vendor's app (the app's commands travel through the relay once the charge point is attached to its origin cloud, see Setup). The switch therefore shows no value until the first command, and the widget offers both "Lock" and "Unlock" until then.
  • A command done with the vendor's app without the relay in between (Bluetooth, direct Wi-Fi) cannot be seen: the switch then shows the last command it knew about.
  • The relay forgets the state when it restarts: it shows nothing again until the next command.
  • If a charge point was created before this version, click Update on its device card so the switch appears.

Dashboard widget​

Add a Charge point box to a dashboard and pick the charge point. A widget shows one connector (connector 1 by default): for a charge point with several connectors, add one widget per connector.

At the top, the widget always says what the connector is doing right now, in plain words, with the session duration while charging. The rest is up to the widget settings:

SettingDefaultEffect
Connector1The connector shown.
TilesPower, Session energy, Session duration, CostAny of: live power, energy and duration of the current session (or of the last one when idle), cost, max power offered by the charge point, meter total energy.
ChartAutomaticAutomatic: power curve while charging, energy of the recent sessions otherwise. Or always one of them, or none.
Power curve periodLast 12 hoursFrom the last hour to the last week.
Price per kWh (€)emptySee "Cost" below.
Show charge point detailsyesConnector status, limit offered by the charge point, error code if any, last message to the relay, vendor and model.
Show the charge point controlsyesButtons for what the charge point can be told to do, if anything (see "Cable lock"): the button does the opposite of the known state, both buttons while it is unknown.

A tile with nothing to show yet (no session, for instance) is hidden. A widget has limited room: with both the chart and the details, only the first 5 selected tiles are shown.

Cost​

  • If Gladys's Energy screen is set up (charge point attached to your electricity meter, contract filled in), the tile shows the cost of the last 30 minutes, computed by Gladys with your contract (peak/off-peak hours, Tempo…). Gladys computes these costs in the background: the tile appears after the first run and may lag behind by up to half an hour. If the charge point was created before this version, click Update on its device card first.
  • Otherwise, if you entered a price per kWh, the tile shows the session cost (session energy × that fixed price, no peak/off-peak hours).
  • Otherwise, no cost tile.

Recent sessions are kept by the relay in memory: the list starts over when the integration restarts.

Multiple connectors​

A charge point is one device in Gladys, whatever its number of physical connectors. It starts with one connector's worth of features (status, charging state, power, current, voltage, energy); if it has more than one physical connector, the extra ones appear as additional features ("Connector 2 - ...", etc.) once the gateway has actually seen them report their status at least once. If you've already created the device, Gladys shows an Update button once new connectors are picked up — nothing is added silently to a device you already created. If a connector doesn't appear yet, try Rescan from the Discovery tab after using that connector.

Security note​

Exposing the relay's OCPP port makes it reachable by anything on your LAN, without authentication — this is inherent to how OCPP charge points connect to a server. The relay only ever observes what passes through it and never makes decisions on its own (it never invents a transaction, never authorizes a charge): at worst, a rogue device on your LAN could feed misleading data into this integration's view, but it cannot affect a real charge point, which keeps its own independent connection to its vendor's cloud through the relay. Keep this in mind on a shared or untrusted network.

Known limitations (this version)​

  • The relay's state resets on restart (host reboot, a crash): it only remembers what it has seen since it last started, including which charge points are configured — the integration re-sends the full configured set as soon as it reconnects to Gladys, so this self-heals within seconds and does not require re-running the action. Freshly restarted, already-known charge points briefly disappear until they reconnect (normally within seconds); this does not delete any device you already created in Gladys.
  • Starting a charge session while a charge point is still locally supervised (no origin cloud attached yet), then attaching a cloud mid-session: the charge point may keep referencing the session it started locally once it reconnects into relay mode, which the real origin cloud never saw. A rare overlap in practice (attaching a cloud is usually done once, right after first connecting) — if it happens, the affected session's data may not reach the origin cloud correctly; the next session is unaffected.
  • Almost no control from Gladys. Starting, stopping, or limiting a charge is not possible in this version; the cable lock of Autel charge points is the only command.

Troubleshooting​

Check the integration's logs from the Gladys UI (supervision block → container selector) for the main container and, separately, for the gateway sub-container — that is where the OCPP relay itself logs every connection, disconnection, and relayed message (full payload, both directions) for every charge point.

Parámetros de configuración​

Estos son los parámetros que Charger Station te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
Connecting a charge pointsectionNoIn your charge point's app, note down its current OCPP URL and keep every setting you find there: that's what lets you get back to normal operation if anything goes wrong. Replace that URL with ws://{{gladys_host}}:{{port:ocpp}}/ - the same one for every charge point. Your charge point reconnects right away and appears in the Discovery tab: add it to Gladys. Then come back here, in the Action section below, select your charge point and paste the OCPP URL you noted in the first step - that's what lets it keep talking to its vendor's cloud, now relayed through Gladys.

Cómo instalar Charger Station en Gladys​

  1. En Gladys, abre Integraciones: Charger Station aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
  2. Haz clic en Instalar. Gladys descarga la imagen Docker (ghcr.io/sescandell/gladys-ocpp-integration:1.2.0), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración).
  3. Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
  4. También puedes instalarla directamente desde la URL de su repositorio: https://github.com/sescandell/gladys-ocpp-integration.

Charger Station requiere Gladys >=5.1.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.

¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.

Sobre las integraciones externas​

Charger Station es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene sescandell, no el equipo principal de Gladys.

Suscríbete a la newsletter de Gladys Assistant

Unos pocos correos al mes sobre nuevas versiones y novedades del proyecto. Enviados por Pierre-Gilles Leymarie, fundador del proyecto. Puedes darte de baja cuando quieras 🙂