diff --git a/bundles/org.openhab.binding.teleinfo/README.md b/bundles/org.openhab.binding.teleinfo/README.md
old mode 100644
new mode 100755
index 4a2002a3bf9b3..7ebd4b22d555c
--- a/bundles/org.openhab.binding.teleinfo/README.md
+++ b/bundles/org.openhab.binding.teleinfo/README.md
@@ -12,6 +12,10 @@ These values can be used to
## Supported Things
+### Historical TIC mode
+
+Historical TIC mode is the only mode of all telemeters before Linky models and the default mode for Linky telemeters.
+
The Teleinfo binding provides support for both single-phase and three-phase connection, ICC evolution and the following pricing modes:
- HCHP mode
@@ -34,6 +38,19 @@ The Teleinfo binding provides support for both single-phase and three-phase conn
| cbetm_hc_electricitymeter | three-phase | HCHP | |
| cbetm_tempo_electricitymeter | three-phase | Tempo | |
+### Standard TIC mode
+
+Linky telemeters add a new `Standard` mode with more detailed information but still provide information on the legacy format under the `Historical` denomination.
+
+Standard mode doesn't depend on the pricing options, but it adds some useful information for electricity producers.
+
+| Thing type | Connection | Producer mode |
+|--------------------------------------------|--------------|--------------|
+| lsmm_electricitymeter | single-phase | |
+| lsmm_prod_electricitymeter | single-phase | [x] |
+| lstm_electricitymeter | three-phase | |
+| lstm_prod_electricitymeter | three-phase | [x] |
+
## Discovery
Before the binding can be used, a serial controller must be added. This needs to be done manually. Select __Teleinfo Serial Controller__ and enter the serial port.
@@ -49,30 +66,33 @@ Once the serial controller added, electricity meters will automatically appear a
|----------------------|--------------|---------------------------------------|---------------------------------|
| `serialcontroller` | `serialport` | Path to the serial controller | /dev/ttyXXXX, rfc2217://ip:port |
| `*_electricitymeter` | `adco` | Electricity meter identifier | 12 digits number |
+| | `ticMode` | TIC mode | `STANDARD`, `HISTORICAL` (default) |
## Channels
+### Historical TIC mode
+
Channel availability depends on the electricity connection (single or three-phase) and on the pricing mode (Base, HCHP, EJP or Tempo).
-| Channel | Type | Description | Phase | Mode |
+| Channel | Type | Description | Connection | Mode |
|----------|---------------------------|----------------------------------------------------------|--------|-------|
| isousc | `Number:ElectricCurrent` | Subscribed electric current | All | All |
| ptec | `String` | Current pricing period | All | All |
-| imax | `Number:ElectricCurrent` | Maximum consumed electric current | Single | All |
-| imax1 | `Number:ElectricCurrent` | Maximum consumed electric current on phase 1 | Three | All |
-| imax2 | `Number:ElectricCurrent` | Maximum consumed electric current on phase 2 | Three | All |
-| imax3 | `Number:ElectricCurrent` | Maximum consumed electric current on phase 3 | Three | All |
-| adps | `Number:ElectricCurrent` | Excess electric current warning | Single | All |
-| adir1 | `Number:ElectricCurrent` | Excess electric current on phase 1 warning | Three | All |
-| adir2 | `Number:ElectricCurrent` | Excess electric current on phase 2 warning | Three | All |
-| adir3 | `Number:ElectricCurrent` | Excess electric current on phase 3 warning | Three | All |
-| iinst | `Number:ElectricCurrent` | Instantaneous electric current | Single | All |
-| iinst1 | `Number:ElectricCurrent` | Instantaneous electric current on phase 1 | Three | All |
-| iinst2 | `Number:ElectricCurrent` | Instantaneous electric current on phase 2 | Three | All |
-| iinst3 | `Number:ElectricCurrent` | Instantaneous electric current on phase 3 | Three | All |
-| ppot | `String` | Electrical potential presence | Three | All |
-| pmax | `Number:Energy` | Maximum consumed electric power on all phases | Three | All |
-| papp | `Number:Power` | Instantaneous apparent power | Three, single (ICC evolution only) | All |
+| imax | `Number:ElectricCurrent` | Maximum consumed electric current | Single-phase | All |
+| imax1 | `Number:ElectricCurrent` | Maximum consumed electric current on phase 1 | Three-phase | All |
+| imax2 | `Number:ElectricCurrent` | Maximum consumed electric current on phase 2 | Three-phase | All |
+| imax3 | `Number:ElectricCurrent` | Maximum consumed electric current on phase 3 | Three-phase | All |
+| adps | `Number:ElectricCurrent` | Excess electric current warning | Single-phase | All |
+| adir1 | `Number:ElectricCurrent` | Excess electric current on phase 1 warning | Three-phase | All |
+| adir2 | `Number:ElectricCurrent` | Excess electric current on phase 2 warning | Three-phase | All |
+| adir3 | `Number:ElectricCurrent` | Excess electric current on phase 3 warning | Three-phase | All |
+| iinst | `Number:ElectricCurrent` | Instantaneous electric current | Single-phase | All |
+| iinst1 | `Number:ElectricCurrent` | Instantaneous electric current on phase 1 | Three-phase | All |
+| iinst2 | `Number:ElectricCurrent` | Instantaneous electric current on phase 2 | Three-phase | All |
+| iinst3 | `Number:ElectricCurrent` | Instantaneous electric current on phase 3 | Three-phase | All |
+| ppot | `String` | Electrical potential presence | Three-phase | All |
+| pmax | `Number:Energy` | Maximum consumed electric power on all phases | Three-phase | All |
+| papp | `Number:Power` | Instantaneous apparent power | Three-phase, single-phase (ICC evolution only) | All |
| hhphc | `String` | Pricing schedule group | All | HCHP |
| hchc | `Number:Energy` | Total consumed energy at low rate pricing | All | HCHP |
| hchp | `Number:Energy` | Total consumed energy at high rate pricing | All | HCHP |
@@ -88,8 +108,64 @@ Channel availability depends on the electricity connection (single or three-phas
| pejp | `Number:Duration` | Prior notice to EJP start | All | EJP |
| demain | `String` | Following day color | All | Tempo |
+### Standard TIC mode
+
+| Channel | Type | Description | Connection | Mode |
+|----------|---------------------------|----------------------------------------------------------|--------|-------|
+| ngtf | `String` | Provider schedule name | All | All |
+| ltarf | `String` | Current pricing label | All | All |
+| east | `Number:Energy` | Total active energy withdrawn | All | All |
+| easf*XX* | `Number:Energy` | Active energy withdrawn from provider on index | All | All |
+| easd*XX* | `Number:Energy` | Active energy withdrawn from distributor on index | All | All |
+| irms*X* | `Number:ElectricCurrent` | RMS Current on phase *X* | All for , Three-phase for | All |
+| urms*X* | `Number:Potential` | RMS Voltage on phase *X* | All for , Three-phase for | All |
+| pref | `Number:Power` | Reference apparent power | All | All |
+| pcoup | `Number:Power` | Apparent power rupture capacity | All | All |
+| sinsts | `Number:Power` | Instantaneous withdrawn apparent power | Single-phase | All |
+| smaxsn | `Number:Power` | Maximum withdrawn apparent power of the day | Single-phase | All |
+| smaxsnMinus1 | `Number:Power` | Maximum withdrawn apparent power of the previous day | Single-phase | All |
+| ccasn | `Number:Power` | Active charge point N | All | All |
+| ccasnMinus1 | `Number:Power` | Active charge point N-1 | All | All |
+| umoy*X* | `Number:Potential` | Mean Voltage on phase *X* | All for , Three-phase for | All |
+| dpm*X* | `String` | Start of mobile peak period | All | All |
+| fpm*X* | `String` | End of mobile peak period | All | All |
+| msg1 | `String` | Short message | All | All |
+| msg2 | `String` | Very short message | All | All |
+| ntarf | `String` | Index of current pricing | All | All |
+| njourf | `String` | Number of current provider schedule | All | All |
+| njourfPlus1 | `String` | Number of next day provider schedule | All | All |
+| pjourfPlus1 | `String` | Profile of next day provider schedule | All | All |
+| ppointe | `String` | Profile of next rush day | All | All |
+| date | `DateTime` | Date and Time | All | All |
+| smaxsnDate | `DateTime` | Timestamp of SMAXSN value | All | All |
+| smaxsnMinus1Date | `DateTime` | Timestamp of SMAXSN-1 value | All | All |
+| ccasnDate | `DateTime` | Timestamp of CCASN value | All | All |
+| ccasnMinus1Date | `DateTime` | Timestamp of CCASN-1 value | All | All |
+| umoy*X*Date | `DateTime` | Timestamp of UMOY*X* value | All for , Three-phase for | All |
+| dpm*X*Date | `DateTime` | Date of DPM*X* | All | All |
+| fpm*X*Date | `DateTime` | Date of FPM*X* | All | All |
+| relais*X* | `Switch` | relais status ( ) | All | All |
+| sinsts*X* | `Number:Power` | Instantaneous withdrawn apparent power on phase *X* | Three-phase | All |
+| smaxsn*X* | `Number:Power` | Maximum withdrawn apparent power of the day on phase *X* | Three-phase | All |
+| smaxsn*X*Minus1 | `Number:Power` | Maximum withdrawn apparent power on the previous day on phase *X* | Three-phase | All |
+| smaxs*X*nDate | `DateTime` | Timestamp of SMAXSN*X* value | Three-phase | All |
+| smaxsn*X*Minus1Date | `DateTime` | Timestamp of SMAXSN*X*-1 value | Three-phase | All |
+| eait | `Number:Energy` | Total active energy withdrawn | All | All |
+| erq*X* | `Number:Energy` | Active energy withdrawn from provider on index | All | All |
+| sinsti | `Number:Energy` | Active energy withdrawn from distributor on index | All | All |
+| smaxin | `Number:Power` | Maximum injected apparent power of the day | All for , Three-phase for | All |
+| smaxinMinus1 | `Number:Power` | Maximum injected apparent power of the previous day | All for , Three-phase for | All |
+| ccain | `Number:Power` | Injected active charge point N | All | Producer |
+| ccainMinus1 | `Number:Power` | Injected active charge point N-1 | All | Producer |
+| smaxinDate | `DateTime` | Timestamp of SMAXIN value | All | Producer |
+| smaxinMinus1Date | `DateTime` | Timestamp of SMAXIN-1 value | All | Producer |
+| ccainDate | `DateTime` | Timestamp of CCAIN value | All | Producer |
+| ccainMinus1Date | `DateTime` | Timestamp of CCAIN-1 value | All | Producer |
+
## Full Example
+### Historical TIC mode
+
The following `things` file declare a serial USB controller on `/dev/ttyUSB0` for a Single-phase Electricity meter with HC/HP option - CBEMM Evolution ICC and adco `031528042289` :
```
diff --git a/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/TeleinfoBindingConstants.java b/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/TeleinfoBindingConstants.java
index 3b942d2c22c39..f2ab5e97e32d4 100644
--- a/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/TeleinfoBindingConstants.java
+++ b/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/TeleinfoBindingConstants.java
@@ -12,6 +12,8 @@
*/
package org.openhab.binding.teleinfo.internal;
+import java.util.stream.IntStream;
+
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.thing.ThingTypeUID;
@@ -68,7 +70,6 @@ private TeleinfoBindingConstants() {
public static final String CHANNEL_CBETM_IINST1 = "iinst1";
public static final String CHANNEL_CBETM_IINST2 = "iinst2";
public static final String CHANNEL_CBETM_IINST3 = "iinst3";
- public static final String CHANNEL_CBETM_FRAME_TYPE = "frameType";
public static final String CHANNEL_CBETM_LONG_IMAX1 = "imax1";
public static final String CHANNEL_CBETM_LONG_IMAX2 = "imax2";
public static final String CHANNEL_CBETM_LONG_IMAX3 = "imax3";
@@ -77,6 +78,105 @@ private TeleinfoBindingConstants() {
public static final String CHANNEL_CBETM_SHORT_ADIR1 = "adir1";
public static final String CHANNEL_CBETM_SHORT_ADIR2 = "adir2";
public static final String CHANNEL_CBETM_SHORT_ADIR3 = "adir3";
+ // List of Linky standard mode channel ids
+ public static final String CHANNEL_LSM_NGTF = "commonLSMGroup#ngtf";
+ public static final String CHANNEL_LSM_LTARF = "commonLSMGroup#ltarf";
+ public static final String CHANNEL_LSM_EAST = "commonLSMGroup#east";
+ public static final String CHANNEL_LSM_EASF01 = "commonLSMGroup#easf01";
+ public static final String CHANNEL_LSM_EASF02 = "commonLSMGroup#easf02";
+ public static final String CHANNEL_LSM_EASF03 = "commonLSMGroup#easf03";
+ public static final String CHANNEL_LSM_EASF04 = "commonLSMGroup#easf04";
+ public static final String CHANNEL_LSM_EASF05 = "commonLSMGroup#easf05";
+ public static final String CHANNEL_LSM_EASF06 = "commonLSMGroup#easf06";
+ public static final String CHANNEL_LSM_EASF07 = "commonLSMGroup#easf07";
+ public static final String CHANNEL_LSM_EASF08 = "commonLSMGroup#easf08";
+ public static final String CHANNEL_LSM_EASF09 = "commonLSMGroup#easf09";
+ public static final String CHANNEL_LSM_EASF10 = "commonLSMGroup#easf10";
+ public static final String CHANNEL_LSM_EASD01 = "commonLSMGroup#easd01";
+ public static final String CHANNEL_LSM_EASD02 = "commonLSMGroup#easd02";
+ public static final String CHANNEL_LSM_EASD03 = "commonLSMGroup#easd03";
+ public static final String CHANNEL_LSM_EASD04 = "commonLSMGroup#easd04";
+ public static final String CHANNEL_LSM_IRMS1 = "commonLSMGroup#irms1";
+ public static final String CHANNEL_LSM_URMS1 = "commonLSMGroup#urms1";
+ public static final String CHANNEL_LSM_PREF = "commonLSMGroup#pref";
+ public static final String CHANNEL_LSM_PCOUP = "commonLSMGroup#pcoup";
+ public static final String CHANNEL_LSM_SINSTS = "commonLSMGroup#sinsts";
+ public static final String CHANNEL_LSM_SMAXSN = "commonLSMGroup#smaxsn";
+ public static final String CHANNEL_LSM_SMAXSN_MINUS_1 = "commonLSMGroup#smaxsnMinus1";
+ public static final String CHANNEL_LSM_CCASN = "commonLSMGroup#ccasn";
+ public static final String CHANNEL_LSM_CCASN_MINUS_1 = "commonLSMGroup#ccasnMinus1";
+ public static final String CHANNEL_LSM_UMOY1 = "commonLSMGroup#umoy1";
+ public static final String CHANNEL_LSM_STGE = "commonLSMGroup#stge";
+ public static final String CHANNEL_LSM_DPM1 = "commonLSMGroup#dpm1";
+ public static final String CHANNEL_LSM_FPM1 = "commonLSMGroup#fpm1";
+ public static final String CHANNEL_LSM_DPM2 = "commonLSMGroup#dpm2";
+ public static final String CHANNEL_LSM_FPM2 = "commonLSMGroup#fpm2";
+ public static final String CHANNEL_LSM_DPM3 = "commonLSMGroup#dpm3";
+ public static final String CHANNEL_LSM_FPM3 = "commonLSMGroup#fpm3";
+ public static final String CHANNEL_LSM_MSG1 = "commonLSMGroup#msg1";
+ public static final String CHANNEL_LSM_MSG2 = "commonLSMGroup#msg2";
+ public static final String CHANNEL_LSM_PRM = "commonLSMGroup#prm";
+ public static final String[] CHANNELS_LSM_RELAIS = IntStream.range(1, 9).mapToObj(i -> "commonLSMGroup#relais" + i)
+ .toArray(String[]::new);
+ public static final String CHANNEL_LSM_NTARF = "commonLSMGroup#ntarf";
+ public static final String CHANNEL_LSM_NJOURF = "commonLSMGroup#njourf";
+ public static final String CHANNEL_LSM_NJOURF_PLUS_1 = "commonLSMGroup#njourfPlus1";
+ public static final String CHANNEL_LSM_PJOURF_PLUS_1 = "commonLSMGroup#pjourfPlus1";
+ public static final String CHANNEL_LSM_PPOINTE = "commonLSMGroup#ppointe";
+
+ public static final String CHANNEL_LSM_IRMS2 = "threePhasedLSMGroup#irms2";
+ public static final String CHANNEL_LSM_IRMS3 = "threePhasedLSMGroup#irms3";
+ public static final String CHANNEL_LSM_URMS2 = "threePhasedLSMGroup#urms2";
+ public static final String CHANNEL_LSM_URMS3 = "threePhasedLSMGroup#urms3";
+ public static final String CHANNEL_LSM_SINSTS1 = "threePhasedLSMGroup#sinsts1";
+ public static final String CHANNEL_LSM_SINSTS2 = "threePhasedLSMGroup#sinsts2";
+ public static final String CHANNEL_LSM_SINSTS3 = "threePhasedLSMGroup#sinsts3";
+ public static final String CHANNEL_LSM_SMAXSN1 = "threePhasedLSMGroup#smaxsn1";
+ public static final String CHANNEL_LSM_SMAXSN2 = "threePhasedLSMGroup#smaxsn2";
+ public static final String CHANNEL_LSM_SMAXSN3 = "threePhasedLSMGroup#smaxsn3";
+ public static final String CHANNEL_LSM_SMAXSN1_MINUS_1 = "threePhasedLSMGroup#smaxsn1Minus1";
+ public static final String CHANNEL_LSM_SMAXSN2_MINUS_1 = "threePhasedLSMGroup#smaxsn2Minus1";
+ public static final String CHANNEL_LSM_SMAXSN3_MINUS_1 = "threePhasedLSMGroup#smaxsn3Minus1";
+ public static final String CHANNEL_LSM_UMOY2 = "threePhasedLSMGroup#umoy2";
+ public static final String CHANNEL_LSM_UMOY3 = "threePhasedLSMGroup#umoy3";
+
+ public static final String CHANNEL_LSM_EAIT = "producerLSMGroup#eait";
+ public static final String CHANNEL_LSM_ERQ1 = "producerLSMGroup#erq1";
+ public static final String CHANNEL_LSM_ERQ2 = "producerLSMGroup#erq2";
+ public static final String CHANNEL_LSM_ERQ3 = "producerLSMGroup#erq3";
+ public static final String CHANNEL_LSM_ERQ4 = "producerLSMGroup#erq4";
+ public static final String CHANNEL_LSM_SINSTI = "producerLSMGroup#sinsti";
+ public static final String CHANNEL_LSM_SMAXIN = "producerLSMGroup#smaxin";
+ public static final String CHANNEL_LSM_SMAXIN_MINUS_1 = "producerLSMGroup#smaxinMinus1";
+ public static final String CHANNEL_LSM_CCAIN = "producerLSMGroup#ccain";
+ public static final String CHANNEL_LSM_CCAIN_MINUS_1 = "producerLSMGroup#ccainMinus1";
+
+ public static final String CHANNEL_LSM_DATE = "commonLSMGroup#date";
+ public static final String CHANNEL_LSM_SMAXSN_DATE = "commonLSMGroup#smaxsnDate";
+ public static final String CHANNEL_LSM_SMAXSN_MINUS_1_DATE = "commonLSMGroup#smaxsnMinus1Date";
+ public static final String CHANNEL_LSM_CCASN_DATE = "commonLSMGroup#ccasnDate";
+ public static final String CHANNEL_LSM_CCASN_MINUS_1_DATE = "commonLSMGroup#ccasnMinus1Date";
+ public static final String CHANNEL_LSM_UMOY1_DATE = "commonLSMGroup#umoy1Date";
+ public static final String CHANNEL_LSM_DPM1_DATE = "commonLSMGroup#dpm1Date";
+ public static final String CHANNEL_LSM_FPM1_DATE = "commonLSMGroup#fpm1Date";
+ public static final String CHANNEL_LSM_DPM2_DATE = "commonLSMGroup#dpm2Date";
+ public static final String CHANNEL_LSM_FPM2_DATE = "commonLSMGroup#fpm2Date";
+ public static final String CHANNEL_LSM_DPM3_DATE = "commonLSMGroup#dpm3Date";
+ public static final String CHANNEL_LSM_FPM3_DATE = "commonLSMGroup#fpm3Date";
+
+ public static final String CHANNEL_LSM_SMAXIN_DATE = "producerLSMGroup#smaxinDate";
+ public static final String CHANNEL_LSM_SMAXIN_MINUS_1_DATE = "producerLSMGroup#smaxinMinus1Date";
+ public static final String CHANNEL_LSM_CCAIN_DATE = "producerLSMGroup#ccainDate";
+ public static final String CHANNEL_LSM_CCAIN_MINUS_1_DATE = "producerLSMGroup#ccainMinus1Date";
+
+ public static final String CHANNEL_LSM_SMAXSN1_DATE = "threePhasedLSMGroup#smaxsn1Date";
+ public static final String CHANNEL_LSM_SMAXSN2_DATE = "threePhasedLSMGroup#smaxsn2Date";
+ public static final String CHANNEL_LSM_SMAXSN3_DATE = "threePhasedLSMGroup#smaxsn3Date";
+ public static final String CHANNEL_LSM_SMAXSN1_MINUS_1_DATE = "threePhasedLSMGroup#smaxsn1Minus1Date";
+ public static final String CHANNEL_LSM_SMAXSN2_MINUS_1_DATE = "threePhasedLSMGroup#smaxsn2Minus1Date";
+ public static final String CHANNEL_LSM_SMAXSN3_MINUS_1_DATE = "threePhasedLSMGroup#smaxsn3Minus1Date";
+ public static final String CHANNEL_LSM_UMOY2_DATE = "threePhasedLSMGroup#umoy2Date";
+ public static final String CHANNEL_LSM_UMOY3_DATE = "threePhasedLSMGroup#umoy3Date";
public static final String NOT_A_CHANNEL = "";
@@ -118,6 +218,18 @@ private TeleinfoBindingConstants() {
public static final ThingTypeUID THING_TEMPO_CBETM_ELECTRICITY_METER_TYPE_UID = new ThingTypeUID(BINDING_ID,
"cbetm_tempo_electricitymeter");
+ public static final ThingTypeUID THING_LSMT_PROD_ELECTRICITY_METER_TYPE_UID = new ThingTypeUID(BINDING_ID,
+ "lsmt_prod_electricitymeter");
+
+ public static final ThingTypeUID THING_LSMM_PROD_ELECTRICITY_METER_TYPE_UID = new ThingTypeUID(BINDING_ID,
+ "lsmm_prod_electricitymeter");
+
+ public static final ThingTypeUID THING_LSMT_ELECTRICITY_METER_TYPE_UID = new ThingTypeUID(BINDING_ID,
+ "lsmt_electricitymeter");
+
+ public static final ThingTypeUID THING_LSMM_ELECTRICITY_METER_TYPE_UID = new ThingTypeUID(BINDING_ID,
+ "lsmm_electricitymeter");
+
public static final String ERROR_OFFLINE_SERIAL_NOT_FOUND = "@text/teleinfo.thingstate.serial_notfound";
public static final String ERROR_OFFLINE_SERIAL_INUSE = "@text/teleinfo.thingstate.serial_inuse";
public static final String ERROR_OFFLINE_SERIAL_UNSUPPORTED = "@text/teleinfo.thingstate.serial_unsupported";
diff --git a/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/TeleinfoDiscoveryService.java b/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/TeleinfoDiscoveryService.java
index f3ff6c4bcac81..c6f59a4980e6f 100644
--- a/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/TeleinfoDiscoveryService.java
+++ b/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/TeleinfoDiscoveryService.java
@@ -17,8 +17,6 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
@@ -47,13 +45,15 @@
public class TeleinfoDiscoveryService extends AbstractDiscoveryService
implements TeleinfoControllerHandlerListener, ThingHandlerService, DiscoveryService {
- private static final Set SUPPORTED_THING_TYPES = Stream.of(THING_HC_CBEMM_ELECTRICITY_METER_TYPE_UID,
+ private static final Set SUPPORTED_THING_TYPES = Set.of(THING_HC_CBEMM_ELECTRICITY_METER_TYPE_UID,
THING_BASE_CBEMM_ELECTRICITY_METER_TYPE_UID, THING_TEMPO_CBEMM_ELECTRICITY_METER_TYPE_UID,
THING_EJP_CBEMM_ELECTRICITY_METER_TYPE_UID, THING_HC_CBEMM_EVO_ICC_ELECTRICITY_METER_TYPE_UID,
THING_BASE_CBEMM_EVO_ICC_ELECTRICITY_METER_TYPE_UID, THING_TEMPO_CBEMM_EVO_ICC_ELECTRICITY_METER_TYPE_UID,
THING_EJP_CBEMM_EVO_ICC_ELECTRICITY_METER_TYPE_UID, THING_HC_CBETM_ELECTRICITY_METER_TYPE_UID,
THING_BASE_CBETM_ELECTRICITY_METER_TYPE_UID, THING_TEMPO_CBETM_ELECTRICITY_METER_TYPE_UID,
- THING_EJP_CBETM_ELECTRICITY_METER_TYPE_UID).collect(Collectors.toSet());
+ THING_EJP_CBETM_ELECTRICITY_METER_TYPE_UID, THING_LSMT_PROD_ELECTRICITY_METER_TYPE_UID,
+ THING_LSMT_ELECTRICITY_METER_TYPE_UID, THING_LSMM_PROD_ELECTRICITY_METER_TYPE_UID,
+ THING_LSMM_ELECTRICITY_METER_TYPE_UID);
private static final int SCAN_DURATION_IN_S = 60;
@@ -140,11 +140,12 @@ private void detectNewElectricityMeterFromReceivedFrame(final Frame frameSample)
TeleinfoAbstractControllerHandler controllerHandlerRef = controllerHandler;
if (controllerHandlerRef != null) {
logger.debug("New eletricity meter detection from frame {}", frameSample);
- if (frameSample.get(Label.ADCO) == null) {
- throw new IllegalStateException("Missing ADCO key");
+ if (frameSample.get(Label.ADCO) == null && frameSample.get(Label.ADSC) == null) {
+ throw new IllegalStateException("Missing ADCO or ADSC key");
}
- String adco = frameSample.get(Label.ADCO);
+ String adco = frameSample.get(Label.ADCO) != null ? frameSample.get(Label.ADCO)
+ : frameSample.get(Label.ADSC);
if (adco != null) {
ThingUID thingUID = new ThingUID(getThingTypeUID(frameSample), adco,
controllerHandlerRef.getThing().getUID().getId());
@@ -152,7 +153,7 @@ private void detectNewElectricityMeterFromReceivedFrame(final Frame frameSample)
final Map properties = getThingProperties(adco);
final String representationProperty = THING_ELECTRICITY_METER_PROPERTY_ADCO;
DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties)
- .withLabel("Teleinfo ADCO " + adco).withThingType(getThingTypeUID(frameSample))
+ .withLabel("Teleinfo ADCO/ADSC " + adco).withThingType(getThingTypeUID(frameSample))
.withBridge(controllerHandlerRef.getThing().getUID())
.withRepresentationProperty(representationProperty).build();
diff --git a/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/data/Evolution.java b/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/data/Evolution.java
index 158d58a844783..4a51753f1dafa 100644
--- a/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/data/Evolution.java
+++ b/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/data/Evolution.java
@@ -12,12 +12,15 @@
*/
package org.openhab.binding.teleinfo.internal.data;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
/**
* Define the evolution option values
*
* @author Olivier MARCEAU - Initial contribution
*
*/
+@NonNullByDefault
public enum Evolution {
ICC,
NONE
diff --git a/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/data/Frame.java b/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/data/Frame.java
index 3594885198abb..e83f83efa7747 100644
--- a/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/data/Frame.java
+++ b/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/data/Frame.java
@@ -20,6 +20,7 @@
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.teleinfo.internal.reader.io.serialport.InvalidFrameException;
import org.openhab.binding.teleinfo.internal.reader.io.serialport.Label;
+import org.openhab.binding.teleinfo.internal.serial.TeleinfoTicMode;
/**
* The {@link Frame} class defines common attributes for any Teleinfo frames.
@@ -32,11 +33,16 @@ public class Frame implements Serializable {
private static final long serialVersionUID = -1934715078822532494L;
private Map