Saltar al contenido principal

Integración domótica Legrand In One CPL, gratuita y de código abierto

Integración Legrand In One CPL para Gladys Assistant

Control Legrand In One (PLC) lights, dimmers and shutters through the 882 13 USB serial interface

info

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

Unofficial integration, not affiliated with Legrand. It controls the lights, dimmers and roller shutters of a Legrand In One (powerline, "CPL") installation from Gladys, and shows their state when someone presses a wall switch.

What you need​

  • A Legrand USB / RS232 interface, reference 882 13, plugged into the machine that runs Gladys.
  • A small "serial gateway" container that exposes this USB device on a TCP port. Gladys integrations cannot access USB devices directly, so this container does it for them (see the project README for a ready-to-use docker-compose.yml).

Setup​

  1. Start the serial gateway container. By default it listens on 172.17.0.1:2000.
  2. Install this integration and check the address and port in its settings.
  3. Press each wall switch once. The Legrand bus cannot list its devices, so the integration learns each circuit from the frames the switches send when they are pressed.
  4. Open the Discovery tab and run a scan. Each circuit seen on the bus appears as a light named Legrand <id>-<unit> (or a shutter Legrand volet <id>-<unit>), followed in brackets by the kind of device: (inter) for a switch, (variateur) for a dimmer key, (inter volet) for a shutter switch, (inter scenario) for the on/off key of a scenario switch. This is deduced from the keys heard so far: a scenario switch whose on/off key alone was pressed first shows as (inter), then turns to (inter scenario) once one of its scene keys is heard. Create the circuits you want and rename them.

If a switch does not appear, press it again and rescan. The list of known circuits is kept across restarts.

What it does​

  • Turns lights on and off from Gladys (dashboard, scenes, voice).
  • Sets the level of dimmers (brightness 20 to 100 %, see "Dimmers").
  • Raises, lowers and stops roller shutters (see "Shutters").
  • Updates the state in Gladys when a wall switch is used.
  • Shows each Legrand scenario button as a button in Gladys (Legrand scenario <id>-<unit>). It clicks when the scenario is pressed on a wall key, so you can use it as a trigger in Gladys scenes. Conversely, a Gladys scene can click this button to launch the Legrand scenario (see "Launching a Legrand scenario from Gladys").

Linked devices​

The bus never reports the state of a receiver. When a button drives several lights (a group, a scenario), only the button sends a frame and the lights stay silent. The settings Rule 1 to Rule 12 (one rule per field) tell the integration which lights follow which button. Nothing is sent on the bus: only the state shown in Gladys is updated.

Use the circuit numbers printed in the logs (944559-1). One rule per field. If you need more than 12 rules, put several in one field, separated by ;:

648966-1 -> 944559-1, 944559-2
648966-2 -> 944559-1=on, 944559-2=off

Several rules in one field: 929520-1 -> 944561-1; 929523-1 -> 944561-1.

  • With a light on the left, the lights on the right copy its state (on, off), whether it comes from a wall switch or from a command in Gladys.
  • With a scenario button on the left, each light on the right takes the fixed state written after = (on or off).

Dimmers​

An In One dimmer (672 10, 672 12, 672 14, plug-in dimmer 672 22, DIN dimmer 036 10...) speaks the same language as a switch, plus level orders (20 to 100 % in steps of 10) and dim up / dim down orders. As soon as the integration hears a level frame on a circuit, it treats it as a dimmer: run a scan again and the Gladys device gets a brightness of 0 to 100 % next to its on/off.

  • If your dimmer never sends a level frame (short presses only), list its circuit in the Dimmers setting (944559-1, 944560-2): the brightness is added at the next scan.
  • From Gladys, a brightness of 0 switches off; any other value is rounded to the nearest step (1 to 24 → 20 %, 55 → 60 %). The value really sent is shown back in Gladys.
  • A wall "dim up" or "dim down" key does not say the level reached: Gladys keeps the last known level.

This part follows the Open Web Net specification but has not been verified on a real dimmer yet. If you own one, a report on the GitHub repository (frames seen in the logs, result of the commands) will validate it.

Shutters​

An In One shutter switch (672 51, 672 55, 672 56, controls 672 53 / 672 54) sends up, down and stop orders. Each key heard appears at discovery as a shutter Legrand volet <id>-<unit> with a three-position control in Gladys: open, stop, close.

  • The state shown is the last order heard or sent, not the real position: the bus does not know it.
  • On a shutter switch a short press starts a full travel and a long press is for adjusting; from Gladys the integration sends the order as is. A moving shutter stops with "stop".
  • Shutters take no part in the "Linked devices" rules (lights only).

This part follows the Open Web Net specification but has not been verified on a real shutter yet. Same request: if you test it, say so on the GitHub repository.

Tested hardware​

This integration was developed on one installation, with:

  • the Legrand PLC/USB interface ref. 882 13 (seen by Linux as a BTicino "SFERA Tele Loop" USB serial device);
  • double transmitter-receiver switches ref. 672 02 (two directions: top key = on, bottom key = off);
  • a single transmitter-receiver switch ref. 672 01 (frames received and decoded; command from Gladys not tested);
  • a lighting scenario switch ref. 672 08 (on/off keys + two scenario keys);
  • a scenario transmitter ref. 672 80 (four scenario keys);
  • Gladys Assistant 5.3 on a Home Assistant Yellow (64-bit ARM).

How to read the devices in Gladys​

In the In One system every product has a unique identifier, and every receiver learns the transmitters that drive it (LEARN key). Only transmitter orders travel on the bus: "direction 1 of transmitter 944559 says on". The receivers that learned this transmitter react, silently.

So a device Legrand 944559-1 in Gladys is a transmitter key (identifier 944559, direction 1), not a lamp. Driving it from Gladys is like pressing that key: every receiver that learned it reacts. This is why a transmitter learned by several receivers switches several lamps, and why the state of a receiver can never be read: it does not exist on the bus. The Linked devices setting describes these associations so that Gladys shows the right state.

References of the In One PLC range​

From the Céliane technical guide. Only the four references above were tested; for the others the "Expected" column says what the protocol suggests, without verification. Since version 0.6.0 the whole PLC range for lighting, dimming and shutters is covered by the code: only testers are missing.

Lighting

ReferenceProductExpected
672 01Single transmitter-receiver switch 2,500 WTested for reception; command expected to work like the 672 02
672 02Double transmitter-receiver switch 2 × 1,000 WTested
672 03 / 672 04Single / double switch with indicatorLike 672 01 / 672 02: should work (the indicator is local, nothing on the bus)
672 08Lighting scenario switch (on/off + 2 scenarios)Tested
672 15Automatic switch 1,000 W (motion detector)Should send on/off orders like a switch
672 10 / 672 12 / 672 14, 036 10Dimmers 300 W, 600 W and DIN dimmer 1,000 WOn/off + brightness 20–100 % (see "Dimmers"); to be verified
672 22Plug-in dimmer receiverLike a dimmer; to be verified
882 03Plug-in dimmer 500 WLike a dimmer; to be verified
882 00, 882 01, 882 15, 882 20Infrared/radio remotes and scenario controlsNo: they do not use the PLC bus, except through a PLC/IR receiver that relays

Scenarios

ReferenceProductExpected
672 80Scenario transmitter (4 scenarios)Tested
672 84Touch-screen scenario managerIts scenarios should show up as buttons; not verified

Roller shutters and blinds

ReferenceProductExpected
672 51 / 672 55 / 672 56Individual shutter switch (plain, with override, with programmable level)Up / down / stop (see "Shutters"); to be verified
672 53 / 672 54Central control / group control (4 zones)Each key should appear as a shutter; to be verified
672 62Radio central shutter switchNo: radio, unless relayed by the PLC/RF interface 036 06

Heating, detectors, interfaces: thermostats 674 40 / 674 42, cable outlet 674 45, local override 674 48, programmer 674 49, detectors 675 22 / 675 23 / 675 24, interfaces 036 06 / 036 07 / 036 18 — outside the scope of this integration. Filters 882 12 / 882 21 / 882 23 are passive accessories.

If you test one of these references, say so on the project's GitHub repository: the table will be updated.

Sending commands​

The 882 13 interface sends one command at a time on the power line and refuses one that arrives while it is still sending the previous one. The integration therefore sends commands one by one: it waits for the interface's answer (accepted or refused), then a short pause, before the next, and sends a refused command again up to three times. A command that is refused every time is reported as failed in Gladys, and the state shown does not change. A scene that drives ten lamps thus takes a few seconds.

Launching a Legrand scenario from Gladys​

In a Gladys scene, add the "Control device" action, pick Legrand scenario <id>-<unit> and click the button. The integration sends one single frame on the power line (*25*11*#<address>##): the receivers that learned this scenario do the rest. It costs one frame whatever the number of lamps, which makes it the right way to switch many lamps on or off at once.

  • A scenario that was not programmed on any receiver does nothing.
  • Pressing the wall key only listens: the integration never sends anything in answer to a received frame.
  • A scenario launched from Gladys does not click back in Gladys (no loop with a scene triggered by the same button). Linked devices are updated in Gladys as for a wall press.
  • Scenario devices created with a version older than 0.5.0 are read-only: delete them in Gladys and run a discovery again so that they can be clicked.

Limits of this version​

  • The bus never reports the real state of a receiver. The state shown in Gladys is deduced from the frames and from the commands sent, so it can drift (for example after a Legrand scenario that switches lights off). A command from Gladys always puts it back in line.
  • To keep Gladys up to date after a Legrand scenario, use linked devices (rule scenario -> light=on).
  • Dimmers and shutters: written from the Open Web Net specification, not yet verified on hardware. A dimmer level is only known after a level frame; a shutter position is never known (only the last order is).
  • Scenarios can be launched but not programmed from Gladys: the receivers must have learned them (Legrand procedure).

Parámetros de configuración​

Estos son los parámetros que Legrand In One CPL te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
Serial gateway addressstringSí
Serial gateway TCP portnumberSí
DimmersstringNoCircuits of dimmer keys (672 10, 672 12, 672 14, 672 22, 036 10...), separated by commas, so Gladys gets a brightness for them: e.g. 944559-1, 944560-2. A circuit that sends a level frame is recognised on its own; this field is for the others. Not yet verified on hardware: feedback welcome.
Linked devicessectionNoThe bus never reports the state of a receiver. Each rule below tells which lights follow a button, in Gladys only (nothing is sent on the bus). Use the circuit numbers printed in the logs. A light on the left: the lights on the right copy its state, e.g. 648966-1 -> 944559-1, 944559-2. A scenario button on the left: give each light its state, e.g. 648966-3 -> 944559-1=off, 944559-2=off. More than 12 rules? Put several in one field, separated by ;
Rule 1stringNo
Rule 2stringNo
Rule 3stringNo
Rule 4stringNo
Rule 5stringNo
Rule 6stringNo
Rule 7stringNo
Rule 8stringNo
Rule 9stringNo
Rule 10stringNo
Rule 11stringNo
Rule 12stringNo

Cómo instalar Legrand In One CPL en Gladys​

  1. En Gladys, abre Integraciones: Legrand In One CPL 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/xdeco/gladys-integration-legrand-inone:0.6.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/XDECO/gladys-integration-legrand-inone.

Legrand In One CPL requiere Gladys >=4.86.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​

Legrand In One CPL 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 XDECO, 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 🙂