New Teleinfo Binding - Tester and Feedback welcome

Hi
My teleinfobindings is working intermittently
This is what I get from the log file


Could you help?

Hi @Dids,
Can you give me more details ? OH version, teleinfo binding version, teleinfo USB hardware, step to reproduce, etc.

Hi
I am using (more appropriate would be I am trying to use) openHAB 2.5
The binding version is your latest one i believe:
org.openhab.binding.teleinfo-2.5.0-20191104-2035.
I use RS232 modem from the meter to a serial device server (Sollae https://www.eztcp.com/en/products/cse-h20.php). TCP through my local network to my computer. On the computer I use a virtual serial port emulator (VSPE from eterlogic.com) that allows to split serial ports and use the same port on several applications.
It works with other software (homidom for example) but not fully with the binding as I get frames corrupted. It goes from unkown to online and rapidly after to offline.
The serial device server allows several configuration
image

Your achitecture is not simple :slight_smile:
First, can you activated DEBUG logs on teleinfo binding and send me this log file plz ?
Second, your serial port seems be sharing on many softwares ("
and use the same port on several applications
"). Have you tested the teleinfo binding when this serial port is not sharing with others softwares ?

I use your binding since a few weeks.
With time, the “currentPower” data is fired many many times very quickly. It increase with time.
I have to disable and re-enabled binding to start a new session and all gets ok.
But in a few hours or days, i will have the same behaviour.
Any idea ?

Hi @rgouyet, the “currentPower” is a computed data from IINST data and “currentPower” configuration value (named “power factor”). The defaut value of “power factor” is defined to 230 (volts). The currentPower value is (just) computed like that:

currentPower = IINST * powerFactor

So, if your currentPower channel is updated “many many times very quickly”, then your IINST channel must have the same behavior, no ?

Can you give me some details about your electricty meter ? single-phase or tree-phase ? your pricing option (Base, HC, Tempo, EJP) ?

Teleinfo ADCO 81177588XXXX

Single-phase Electricity meter with HC/HP option - CBEMM Evolution ICC (aka “Compteur Bleu Electronique MonophasĂ© Multitarif Evolution ICC”)

I don’t see IINST spaming in the log

My items are defined in .items file.
And the value 230 is the only thing editable in the binding page.

Can you send me suspicions logs please ? And the steps to reproduce ?

For information, the source code for ‘currentPower’ channel updating is in the https://github.com/nokyyz/openhab2-addons/blob/master/bundles/org.openhab.binding.teleinfo/src/main/java/org/openhab/binding/teleinfo/internal/handler/cbemm/TeleinfoAbstractCbemmElectricityMeterHandler.java file. Here a copy of this code:

BigDecimal powerFactor = (BigDecimal) getThing().getChannel(CHANNEL_CBEMM_CURRENT_POWER).getConfiguration()
.get(CHANNEL_CBEMM_CURRENT_POWER_CONFIG_PARAMETER_POWERFACTOR);
updateState(CHANNEL_CBEMM_CURRENT_POWER, new DecimalType(frame.getIinst() * powerFactor.intValue()));

OpenHAB 2.5.3
org.openhab.binding.teleinfo-2.5.0-20191104-2035.jar

Here is my teleinfo device :

Here is the item definition :

Number:ElectricCurrent GF_Garage_Teleinfo_Isousc “Isousc” (gTeleinfo, gPersistence) {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:isousc”}

String GF_Garage_Teleinfo_Ptec “Ptec” (gTeleinfo) {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:ptec”}

Number:ElectricCurrent GF_Garage_Teleinfo_Imax “Imax” (gTeleinfo) {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:imax”}

Number:ElectricCurrent GF_Garage_Teleinfo_Adps “Adps” (gTeleinfo) {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:adps”}

Number GF_Garage_Teleinfo_Papp “Papp” (gTeleinfo) {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:papp”}

Number:ElectricCurrent GF_Garage_Teleinfo_Iinst “Iinst” (gTeleinfo) {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:iinst”}

Number:Power GF_Garage_Teleinfo_CurrentPower “Currentpower” (gTeleinfo) [“Door”, “iss:room:Garage”, “iss:type:DevElectricity”] {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:currentPower”}

Number:Energy GF_Garage_Teleinfo_Hchc “Hchc” (gTeleinfo) {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:hchc”}

Number:Energy GF_Garage_Teleinfo_Hchp “Hchp” (gTeleinfo) {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:hchp”}

String GF_Garage_Teleinfo_Hhphc “Hhphc” (gTeleinfo) {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:hhphc”}

DateTime GF_Garage_Teleinfo_LastUpdate “Last update [%1$td/%1$tm/%1$tY %1$tT]” (gTeleinfo) {channel=“teleinfo:cbemm_evolution_icc_hc_electricitymeter:8494ef47:811775880891:lastUpdate”}

And here are log files (2mn 
) :
events.log (147.9 KB) openhab.log (232.6 KB)

From your events.log, I think that each Teleinfo frame is repeated 10 times per second. In below sample, LastUpdate is updated 10 times with no changes for others Teleinfo values (IINST, PAPP,
):

2020-04-04 08:36:40.838 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_LastUpdate changed from 2020-04-04T08:36:39.138+0200 to 2020-04-04T08:36:40.808+0200
2020-04-04 08:36:40.855 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_Hchp changed from 10464961 Wh to 10464962 Wh
2020-04-04 08:36:40.857 [vent.ItemStateChangedEvent] - TeleinfoADCO811775880891_HCHP changed from 10464961 to 10464962
2020-04-04 08:36:40.938 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_LastUpdate changed from 2020-04-04T08:36:40.808+0200 to 2020-04-04T08:36:40.819+0200
2020-04-04 08:36:41.039 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_LastUpdate changed from 2020-04-04T08:36:40.819+0200 to 2020-04-04T08:36:40.862+0200
2020-04-04 08:36:41.104 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_LastUpdate changed from 2020-04-04T08:36:40.862+0200 to 2020-04-04T08:36:40.864+0200
2020-04-04 08:36:41.131 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_LastUpdate changed from 2020-04-04T08:36:40.864+0200 to 2020-04-04T08:36:40.866+0200
2020-04-04 08:36:41.132 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_LastUpdate changed from 2020-04-04T08:36:40.866+0200 to 2020-04-04T08:36:40.878+0200
2020-04-04 08:36:41.133 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_LastUpdate changed from 2020-04-04T08:36:40.878+0200 to 2020-04-04T08:36:40.893+0200
2020-04-04 08:36:41.134 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_LastUpdate changed from 2020-04-04T08:36:40.893+0200 to 2020-04-04T08:36:40.905+0200
2020-04-04 08:36:41.135 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_LastUpdate changed from 2020-04-04T08:36:40.905+0200 to 2020-04-04T08:36:40.911+0200
2020-04-04 08:36:41.137 [vent.ItemStateChangedEvent] - GF_Garage_Teleinfo_LastUpdate changed from 2020-04-04T08:36:40.911+0200 to 2020-04-04T08:36:40.914+0200

The normal frequency between each Teleinfo frame is about 1-2 seconds.
The Teleinfo binding performs ALL teleinfo frames from your hardware. So, IMHO this defect becomes from your hardware.
Can you dump the Teleinfo stream in a file directly from your hardware device ?

I used it since several years (with other piece of software) and I never had this issue.
As you wrote, it sends all data frame every 1 or 2 s (only once per data)

If I disable the teleinfo:serialcontroller and enabled it again, it’s ok for a few hours and then it cames back to repeat the stream


I think I will add a cron rule to diable and enable the serial control to avoid to spam my logs


Can you try to disable/enable teleinfo:serialcontroller many times and checks if the frequency increases (n times in same second) for the 
_LastUpdate item in your events.log ? maybe your problem is due to an suscription/unsuscription mechanism on disable/enable teleinfo:serialcontroller action


Hi everybody,
Thanks to @hollysaiqs contribution, the Teleinfo binding has been submitted to OpenHAB reviewers 2 days ago (pull request 7516).
Maybe Teleinfo binding will be officially OpenHAB addons in few days ! :grinning:

Thank for your feebacks

Hi all,
The Teleinfo binding is an officially OpenHAB 2.x addon ! Available from openHAB 2.5.9 snapshot version (build #220).

Bye

Hi All,
First of all, thank you for the development of this binding.
I recently purchased this USB CGE module and connected it to my Raspberry Pi 3 running OpenHab 2.5.10 with teleinfo binding 2.5.11
When I type cat /dev/ttyUSB0 I get the teleinfo data correctly:

ADCO 8xxxxxxx1 R
OPTARIF BASE 0
ISOUSC 45 ?
BASE 012235168 ’
PTEC TH
 $
IINST 002 Y
IMAX 090 H
PAPP 00480 -
HHPHC A ,
MOTDETAT 000000 B
ADCO 811775366681 R
OPTARIF BASE 0
ISOUSC 45 ?
BASE 012235168 ’
PTEC TH
 $

But in openhab.log I get the following:
2020-12-27 22:33:31.124 [INFO ] [rial.TeleinfoSerialControllerHandler] - Try to restart Teleinfo receiving


And in event.log I get
2020-12-27 22:25:30.766 [hingStatusInfoChangedEvent] - ‘teleinfo:serialcontroller:teleinfoUSB’ changed from ONLINE to UNKNOWN: Serial Error: Retry in progress

2020-12-27 22:25:30.775 [hingStatusInfoChangedEvent] - ‘teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE): Controller is offline
2020-12-27 22:25:32.555 [hingStatusInfoChangedEvent] - ‘teleinfo:serialcontroller:teleinfoUSB’ changed from UNKNOWN: Serial Error: Retry in progress
 to ONLINE
2020-12-27 22:25:32.575 [hingStatusInfoChangedEvent] - ‘teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur’ changed from OFFLINE (BRIDGE_OFFLINE): Controller is offline to ONLINE
2020-12-27 22:26:30.843 [hingStatusInfoChangedEvent] - ‘teleinfo:serialcontroller:teleinfoUSB’ changed from ONLINE to UNKNOWN: Serial Error: Retry in progress


My thing is

Bridge teleinfo:serialcontroller:teleinfoUSB [ serialport=“/dev/ttyUSB0” ]{
Thing cbemm_base_electricitymeter Compteur [ adco=“8xxxxxxxxx1”]
}

And my items:

Number TLInfoEDF_PAPP “PAPP” (GF_Garage) {channel=“teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur:papp”}
Number:ElectricCurrent TLInfoEDF_ISOUSC “ISOUSC” (GF_Garage) {channel=“teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur:isousc”}
String TLInfoEDF_PTEC “PTEC” (GF_Garage) {channel=“teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur:ptec”}
Number:ElectricCurrent TLInfoEDF_IMAX “IMAX” (GF_Garage) {channel=“teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur:imax”}
Number:ElectricCurrent TLInfoEDF_ADPS “ADPS” (GF_Garage) {channel=“teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur:adps”}
Number:ElectricCurrent TLInfoEDF_IINST “IINST” (GF_Garage) {channel=“teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur:iinst”}
Number:Energy TLInfoEDF_HCHC “HCHC” (GF_Garage) {channel=“teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur:hchc”}
Number:Energy TLInfoEDF_HCHP “HCHP” (GF_Garage) {channel=“teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur:hchp”}
String TLInfoEDF_HHPHC “HHPHC” (GF_Garage) {channel=“teleinfo:cbemm_base_electricitymeter:teleinfoUSB:Compteur:hhphc”}

Any support on diagnosing my problem would be very welcome.

Edit: I just uploaded the log trace of the plugin

Thank you and have a great New Year 2021

OlivierTrace openhab.txt (8.0 KB)

Hi Olivier,

It seems you have an electricity meter with the ICC evolution. Can you try to replace every cbemm_base_electricitymeter by cbemm_evolution_icc_base_electricitymeter?
You can also test the auto discovery feature of the binding, it should auto detect your meter configuration.

Olivier

Hi Olivier,

Thank you for your quick reply. I first tested the replacement of 'cbemm_base_electricitymeterbycbemm_evolution_icc_base_electricitymeter` in my thing and item definition but it did not change the log file so I removed both and used the autodetect feature. I get the following resut in the attached picture.

So I cannot link Items. It seems that, somehow, the stream received from the serial port does not have the expected format.

Olivier

Hi Olivier, After many tests, modifications and Openhab restarts, it works !!!
Thank you again for the plugin and your help.

Kind regards

1 Like

Good news! Have you done it with textual config or with paper ui?
Is your detected electricity meter a cbemm_evolution_icc_base_electricitymeter?

Hi Olivier,

I think there was a problem in one of my config files. I rewrote them from scratch using a cbemm_evolution_icc_base_electricitymeter and it worked.

Thanks again for your help.