Saltar al contenido principal

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

Integración NexBlue para Gladys Assistant

NexBlue charger over local Modbus TCP: state, power, energy, stop; optional start and current.

info

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

This integration shows a NexBlue EV charger in Gladys, read on your local network through Modbus TCP (port 502), without any cloud nor account. It can stop the charge, and, only if you allow it, start it and set the charging current.

Never tested with a real device. It was built from the page NexBlue publishes ("NexBlue Modbus Documentation", nexblue.com) and tested against a simulated charger only. Unofficial: not affiliated with NexBlue.

Models and minimum firmware given by NexBlue for this Modbus map:

ModelFirmware
Edge 2, Edge Max, Point 203.09.88
Delta, Delta Max03.08.59

An older firmware is named in the status: update the charger in the NexBlue app.

Before you start​

  1. In the NexBlue app, open the charger settings and turn Modbus TCP on. Note the unit id (200 unless you changed it).
  2. Give the charger a fixed IP address on your router.
  3. Modbus TCP has no password: anyone on your network can read and control the charger. Keep it on a trusted network (no port forwarding to the internet).
  4. Use one way of control at a time: NexBlue warns that the app, its portal, its OpenAPI, OCPP and Modbus may conflict. Under OCPP control the charger refuses start and stop over Modbus: Gladys then shows the values only (its stop and start are refused by the charger, the status says so).

Configuration​

FieldMeaning
IP address of the chargerModbus port 502 unless you add one (192.168.1.60:502).
Modbus unit id200 unless changed in the NexBlue app (1 to 247).
Allow start and currentOff by default: see "Start and current" below.
Highest charging current (A)6 to 32 A (16 by default): the most Gladys may set.
Refresh intervalSeconds between two reads (30 by default, 10 at least).
LanguageNames of the device and features added from now on, status and errors.

Save, then add the charger from the Discovery tab.

The device is keyed on the serial number the charger gives over Modbus, read first in every connection: another serial number at the address is another device (the old one shows unreachable), and its values never go to the first one. Until a serial number is read, nothing is published (the status says why).

The Test the connection button reads the charger once, never sooner than the refresh interval after the last read (it then shows the last result).

Order of the 32-bit values​

NexBlue's page contradicts itself on the order of the 32-bit and 64-bit values. Gladys finds it on the charger itself, from its date register (only one order gives a real date), and keeps it with the serial number of that charger. When the date of the charger is not set, the order kept for that same serial number is used to show the values, but the charging current is never written: a current is written only in the order the date gave in the same Modbus connection. Another charger at the address (another serial) never takes it. While no order is known (the date not set, the charger never seen before), power, currents, voltages and energy are not read, the charging current cannot be set, and the status says so; the state and the stop work.

What you get​

FeatureGladys categoryNote
Charge point statustextAvailable, Preparing, Charging, SuspendedEVSE, SuspendedEV…
Connector, charging statecharging stationfrom the status
Vehicle plugged inEV chargePreparing to Finishing: yes; Available: no; others: unknown
Errorbinary sensor1 when a bit of the error register is set
Stopped over Modbusbinary sensorIF_START reads 0
Fallback limit appliedbinary sensorthe charger applies its fallback limit (see below)
Charging powerenergy sensor, W
Current and voltage L1, L2, L3energy sensor, A and Va phase at 0 V (not connected) is left unknown
Energy meterenergy sensor, index (kWh)the lifetime energy of the charger, guarded (below)
Energy of the sessionEV charge, kWh
Current limit setEV charge, Aregister 1000
Stop / Start chargingbuttonssee below
Charging currentselection, 6 A to the ceilingsee below

A value that is implausible or not read is left unknown, never published as 0 or as an old value. If the alarms block does not answer, the other values are published all the same (the status lists what was not read). A charger with two connectors (Delta) is one device: NexBlue's map gives values for the charger, not per connector.

Energy meter​

Gladys counts every rise of an index as consumption. So the meter is never published at 0, and a drop (reset, charger replaced) or a jump larger than the charger can draw (25 kW) is held back: nothing is published for it, the status says so with its values, whatever the time. If it is real, press Accept the held index: the first press shows it, a second press 3 s to 5 minutes later accepts exactly that value.

Stop charging​

Stop charging writes IF_START (register 1006) to 0. It does not depend on the option, nor on the value sent by the button, a read in progress (it ends it), a command waiting (it goes first; the commands clicked before it and not sent yet are dropped), a failed read, a backoff, an unknown order of the 32-bit values, nor a configuration Gladys cannot read yet (it then goes to the charger of the last read).

The stop answers an error only in these cases:

  • no address is known (none in the configuration, or the configuration cannot be read and no charger was ever read);
  • the charger cannot be reached for 3 s (connection tried again every 250 ms): "could not leave yet", the stop is kept and tried again every 15 s;
  • the charger refuses the write (under OCPP control, for example): kept and written again every 15 s, the status says so;
  • it was sent but the read back does not show it yet: "sent, without confirmation".

A stop not seen applied is kept in /data, one per charger (also across a restart: it is written again at the start, before anything else, even when /data is slow to read) and checked every 15 s: written again while the charger shows IF_START 1, an unknown value or nothing (IF_START holds only 0 or 1: any other value read counts as unknown). It is let go only when the charger it was sent to shows IF_START 0, or when a newer Start clicked in Gladys left for that same charger. It is never let go by time, nor because it could not leave (charger down, /data stuck).

NexBlue says the values of these registers are lost when the charger loses power: after a power cut, a stop already seen applied is not written again by Gladys.

Start and current​

Off by default. With Allow start and current on, Gladys may:

  • Start charging: writes IF_START to 1 (nothing is sent when it already reads 1 and no stop is held);
  • set the charging current: 6 A up to the configured ceiling, never above 32 A nor above the Max Charging Current the charger gives (register 136), read in the same connection as the write. When 136 cannot be read, or reads under 6 A (0 included), nothing is written (never 32 A by default). Gladys never writes the current below 6 A: use Stop charging.

Before each command Gladys reads, in the same Modbus connection, the serial number (another charger, or one that cannot be read, refuses the command), IF_START and the current limit. It refuses while a stop is being sent, checks the option and the configuration again right before the write, and confirms only by a read back showing the value asked. Otherwise it says "sent, without confirmation" (check in a few seconds) or "nothing sent". Commands go one at a time, in their order of arrival; one waiting its turn starts within 15 s or not at all.

The current is written again: fallback limit​

NexBlue's charger keeps a current set over Modbus only while it keeps receiving it: when no current limit is written within its fallback timeout (register 1004, 30 s to 30 minutes, 5 minutes by default), it applies its fallback limit (register 1002, set in the NexBlue app) until the next write. So once you set a current from Gladys, Gladys writes it again with every read, and reads the charger every third of that timeout, counted from the start of each read (every 10 s at the most often; 10 s while the timeout is unknown or outside 30 s - 30 min); a failed read is tried again within 5 s. Each rewrite is checked against the Max Charging Current (136) and the date read in the same connection: 136 not read that time, or the date not confirming the order, skips that write. While a stop is held for the charger, the current is not written again. The status shows it.

Gladys stops writing it again, and the charger then applies its fallback limit at the end of its timeout, when:

  • "Allow start and current" is turned off, or the ceiling is lowered below that current;
  • the Max Charging Current read (136) is below that current, or under 6 A;
  • the address or the unit id changes;
  • the charger shows another limit set elsewhere (the NexBlue app) while its fallback is not active;
  • the integration or Gladys restarts (the current set is not kept: set it again).

While the charger cannot be reached, nothing reaches it either: it applies its fallback limit at the end of its timeout, and Gladys writes the current again at its first read that succeeds.

Set the fallback limit in the NexBlue app to the current you want when Gladys is not there. Gladys never writes the fallback limit nor the timeout. Phase switching is not handled.

Data kept​

/data/nexblue-state.json (readable by the integration only): the time of the last read, the charger of the last read, its serial number and model, the order of its 32-bit values (with the serial number it was found on), the stops not seen applied and the guard of the energy meter. No password, no personal data.

Parámetros de configuración​

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

ParámetroTipoObligatorioDescripción
Your NexBlue chargersectionNoShows your NexBlue charger (Edge 2, Edge Max, Point 2 from firmware 03.09.88; Delta, Delta Max from 03.08.59) in Gladys over Modbus TCP on your local network, without any cloud: state, vehicle plugged in, power, current and voltage per phase, energy meter, energy of the session. In the NexBlue app, turn "Modbus TCP" on in the charger settings; give the charger a fixed address, enter it below, save, then add it from the Discovery tab. Stopping the charge is always possible; starting it and the charging current only if you allow them below. A current set from Gladys is written again regularly: if Gladys stops, the charger applies its fallback limit. Modbus TCP has no password: keep the charger on a trusted network. Under OCPP control the charger refuses start and stop over Modbus. Never tested with a real device. Not affiliated with NexBlue.
IP address of the chargerstringSíAn IPv4 address or a host name (Modbus port 502 unless you add one, for example 192.168.1.60:502).
Modbus unit idnumberNoThe unit id of the charger, 200 unless changed in the NexBlue app (1 to 247).
Allow start and currentbooleanNoOff by default. On: Gladys may start the charge and set the charging current (6 A up to the ceiling below), and then writes that current again regularly. Off: these commands are refused and nothing is written again (the charger then applies its own fallback limit at the end of its fallback timeout). Stopping the charge never depends on this option.
Highest charging current (A)numberNoThe highest current Gladys may set, 6 to 32 A (16 by default). The charger also applies its own maximum (read over Modbus) and the limit of its installation.
Refresh interval (s)numberNoHow often the charger is read, in seconds. While a current set from Gladys is kept, the charger is read and that current written again at least every third of its fallback timeout (10 s at the least).
Language of the feature namesselectNoUsed for the names of the device and features added from now on, the status and the command errors.

Cómo instalar NexBlue en Gladys​

  1. En Gladys, abre Integraciones: NexBlue 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/lm1lc3n7/gladys-nexblue:0.1.1), 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/LM1LC3N7/gladys-nexblue.

NexBlue 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​

NexBlue 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 LM1LC3N7, 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 🙂