Teleinfo: your Linky meter in Gladys with the LiXee TIC module

Hello everyone! I present to you Teleinfo, an external integration that reads the tele-information (TIC) from your Linky or electronic meter with the LiXee TIC DIN rail module (USB, around €30). Source code: github.com/prohand/gladys-teleinfo.

The important point: USB

A Gladys external integration cannot read a USB serial key. This is the first thing to know before buying the module.

  • External integrations each run in their own Docker container, isolated by Gladys (read-only file system, no hardware access).
  • An integration manifest can request hardware access, but only among 4 classes: coral-usb, coral-pcie, gpu, and video. There is no class for a serial port (/dev/ttyUSB0, /dev/ttyACM0…).
  • These classes are only granted to sub-containers, and never in the form of a free /dev path.

Consequence: plugging the LiXee module into the Gladys server is not enough. The integration will not see it, even if it is properly detected by Linux.

The ZLinky (the Zigbee version of the LiXee) does not have this problem: it goes through Zigbee2MQTT. But the cheaper DIN rail USB version needs a network relay.

The solution: ser2net

ser2net shares the module’s serial port over the network (raw TCP), and the integration connects to it:

Meter (I1/I2) -> LiXee module (USB) -> ser2net (TCP 2000) -> Teleinfo integration -> Gladys

ser2net runs on the machine where the module is plugged in: the Gladys server itself, or a Raspberry Pi near the electrical panel (practical, the USB cable is limited to about 5 m).

sudo apt install ser2net
ls -l /dev/serial/by-id/

Then /etc/ser2net.yaml:

connection: &teleinfo
  accepter: tcp,2000
  enable: on
  options:
    kickolduser: true
  connector: serialdev,/dev/serial/by-id/usb-XXXX-if00-port0,1200e71,local
  • 1200e71 for historical mode (electronic meters, and most Linky by default).
  • 9600e71 for a Linky in standard mode.
  • Then sudo systemctl restart ser2net && sudo systemctl enable ser2net.

Warning: ser2net has no password. Keep this port on your local network, never open on the Internet.

What is sent to Gladys

The mode (historical or standard) is detected automatically. A device is created per meter, with only the values that your meter sends (single or three-phase, Base, HC/HP, Tempo, EJP).

  • Historical mode: index (Base, HC/HP, EJP, Tempo) in kWh, apparent power (PAPP), instantaneous and maximum intensity, subscribed intensity, tariff period, overload (ADPS).
  • Standard mode: total and per index drawn energy, injected energy, instantaneous and maximum apparent power, effective current and voltage, average voltage, load curve, current tariff.

The categories and units are the same as those used by Gladys for the ZLinky in Zigbee: a meter looks the same in both cases.

The values are sent every 60 seconds by default (adjustable from 15 seconds to 1 hour), only when they change, to avoid filling the history.

Scenes and dashboard (Gladys 5.1+)

The integration adds its own cards in the scene editor (category Integrations) and a widget for the dashboard.

  • Trigger « Tariff period change »: runs the scene when switching HC ↔ HP. Possible filter on the new period (off-peak, peak, base). Example: water heater during off-peak hours.
  • Trigger « Subscribed power overload »: warns before tripping. One trigger per overload, even if the power oscillates around the limit.
  • Action « Read the meter »: returns power, period, total index, and overload, for a condition or a message.
  • Widget « Electric meter »: live power, index, 24-hour curve, tariff period, overload, and reception status.

These functions require Gladys 5.1 or newer.

Installation

  1. Plug the LiXee module into the I1 and I2 terminals of the meter (no polarity, current cut off at the panel).
  2. Install and configure ser2net as above.
  3. In Gladys, install the Teleinfo integration, then enter the IP address of the ser2net machine and the port (2000).
  4. Click Test the connection: the meter number and current power are displayed. Then add the meter from the Discovery tab.

The connection status in the Configuration screen clearly indicates the problem: unreachable gateway, or connected but no valid frame (wrong speed or wiring). The detailed guide is in the documentation.

What I’m looking for

  • Testers with a real meter: the integration is tested with simulated frames, but not yet on a real Linky. @mutmut, you offered to test with your LiXee TIC DIN rail module here: with pleasure! If your teleinfo2mqtt already reads the port, you will need to stop it during the test (only one program at a time on the serial port). Feedback on three-phase and standard mode is also welcome.
  • An opinion on serial access: @pierre-gilles, a serial hardware class (for /dev/ttyUSB* / /dev/ttyACM*), granted by the user like coral-usb or video, would avoid ser2net. It would also be useful for other USB key integrations, such as the RFPlayer which is also requested in the thread. Is this feasible on the Gladys side?

Thanks for your feedback!

1 Like