Skip to content
Get started

Teleinformation from Linky electrical meter.

The teleinfo component allows you to retrieve data from a French electrical meter using Teleinformation (datasheet). It works with Linky electrical meter but also legacy EDF electrical meter.

Linky electrical meter

..

A simple electronic assembly with an optocoupler and a resistor could let you retrieve detailed power consumption or power production. There are plenty of examples on the web.

As the communication with the Teleinformation is done using UART, you need to have an UART bus in your configuration with the rx_pin connected to the output of the optocoupler component. Additionally, you need to set the baud rate to 9600bps if meter is configured to work in standard mode or 1200bps in historical mode. To find out which mode you are using, simply press -/+ buttons on the meter and look for Standard mode or Historical mode as below.

Linky electrical meter configured in standard mode.

..

Linky electrical meter configured in historical mode.

..

# Example configuration entry
teleinfo:
id: myteleinfo

In teleinfo platform:

  • historical_mode (Optional): Whether to use historical mode or standard mode. With historical mode, baudrate of 1200 must be used whereas 9600 must be used in standard mode. Defaults to false.

  • update_interval (Optional, Time): The interval to check the sensor. Defaults to 60s.

  • uart_id (Optional, ID): Manually specify the ID of the UART Component if you want to use multiple UART buses.

  • id (Optional, ID): Manually specify the ID used for code generation or multiple hubs.

sensor:
- platform: teleinfo
tag_name: "HCHC"
name: "Off-peak hours consumption"
teleinfo_id: myteleinfo
- platform: teleinfo
tag_name: "HCHP"
name: "Peak hours consumption"
teleinfo_id: myteleinfo
- platform: teleinfo
tag_name: "PAPP"
name: "Apparent power"
teleinfo_id: myteleinfo
  • tag_name (Required, string): Specify the tag you want to retrieve from the Teleinformation.
  • teleinfo_id (Optional, ID): Specify the ID of used hub.
  • All other options from Sensor.

A value that is not a number, for example from a frame corrupted in a way its checksum does not catch, is logged as a warning and ignored, so that it does not look like a meter reset.

The unit_of_measurement, device_class and state_class of a sensor are set automatically based on the prefix of its tag_name, for the main tags of both standard and historical mode:

Tag prefixModeUnitDevice classState class
EAStandardWhenergytotal_increasing
ERStandardvarhreactive_energytotal_increasing
IRMSStandardAcurrentmeasurement
URMS, UMOYStandardVvoltagemeasurement
SINST, SMAXStandardVAapparent_powermeasurement
PREF, PCOUPStandardkVAapparent_powermeasurement
CCStandardWpowermeasurement
VTIC, NTARF, NJOURF, RELAISStandardnonenonenone
BASE, HCH, EJP, BBRHHistoricalWhenergytotal_increasing
IINST, IMAX, ISOUSC, ADPS, ADIRHistoricalAcurrentmeasurement
PAPP, PMAXHistoricalVAapparent_powermeasurement
PEJPHistoricalmindurationmeasurement

For example, IINST1, IINST2 and IINST3 all match the IINST prefix.

Some tags hold text, which a sensor cannot publish. Use a text sensor for them instead: ADSC, DATE, NGTF, LTARF, STGE, DPM1 to DPM3, FPM1 to FPM3, MSG1, MSG2, PRM, PJOURF+1 and PPOINTE in standard mode, and ADCO, OPTARIF, PTEC, DEMAIN, HHPHC, MOTDETAT and PPOT in historical mode. A sensor with one of these tags gets no pre-defined values, and a warning is logged when the configuration is validated.

Tags that do not match any prefix get the following defaults: unit Wh, device class energy, state class total_increasing and icon mdi:flash.

Any value you set explicitly in your configuration takes precedence over the pre-defined one. If you set a unit_of_measurement that is compatible with the pre-defined device_class (for example kWh for an energy tag, or mA for a current tag), the pre-defined device_class is kept. If it is not compatible, the pre-defined device_class is not applied, so that you don’t end up with an inconsistent combination. The same applies the other way round when you set device_class.

sensor:
- platform: teleinfo
tag_name: "HCHP"
name: "Peak hours consumption"
# kWh is compatible with the pre-defined energy device class, which is kept
unit_of_measurement: "kWh"
filters:
- multiply: 0.001
accuracy_decimals: 3
teleinfo_id: myteleinfo

WARNING

Previously, every sensor defaulted to Wh/energy/total_increasing, whatever its tag. Sensors whose tag matches a prefix above now use the correct unit and device class, for example PAPP now reports VA instead of Wh. To keep the previous behavior, set unit_of_measurement, device_class, state_class and icon explicitly.

Sensor values are 32-bit floating point numbers, which hold every whole number exactly only up to 16 777 216. Energy indexes such as EAST, EASF01 or HCHP are sent in Wh, and many meters have counted more than that (about 16.8 MWh). Above it, a sensor only moves in steps of 2 Wh, and above 33 554 432 Wh (about 33.6 MWh) in steps of 4 Wh. Converting to kWh with a multiply filter does not help, because the value is already rounded when the filter runs.

If you need every Wh, for example to compute the power from the index, read the tag with a text sensor instead. It keeps the exact digits sent by the meter:

text_sensor:
- platform: teleinfo
tag_name: "EAST"
name: "Total energy index"
teleinfo_id: myteleinfo

Then convert it to a number in Home Assistant, which uses 64-bit floating point numbers, for example with a template sensor:

# Home Assistant configuration
template:
- sensor:
- name: "Total energy"
unit_of_measurement: "Wh"
device_class: energy
state_class: total_increasing
# Use the entity ID Home Assistant gave the text sensor above; it usually starts with the
# device name, for example sensor.linky_total_energy_index
availability: "{{ states('sensor.total_energy_index') | is_number }}"
state: "{{ states('sensor.total_energy_index') | int }}"
text_sensor:
- platform: teleinfo
tag_name: "OPTARIF"
name: "optarif"
teleinfo_id: myteleinfo
  • tag_name (Required, string): Specify the tag you want to retrieve from the Teleinformation.
  • teleinfo_id (Optional, ID): Specify the ID of used hub.
  • All other options from Text Sensor.