ebaauw / homebridge-p1

Homebridge plugin for DSMR end-consumer (P1) interface
Apache License 2.0
54 stars 11 forks source link

What happened after latest update to homebridge? #66

Closed babaknahh1 closed 1 year ago

babaknahh1 commented 1 year ago

After the latest update to homebridge, this is what i´m getting and not sure how to fix it as i´m dont have the skills for it. It seems that the first part of the telegram is fine, then it just repeates tha trim-error without reading/parsing the data from the meter anymore to the errorlog

[10/12/2022, 22:33:36] [P1] read file: /etc/os-release [10/12/2022, 22:33:37] Homebridge v1.6.0 (HAP v0.11.0) (Homebridge 35C1) is running on port 51580. [10/12/2022, 22:33:37] [P1] read file: /proc/cpuinfo [10/12/2022, 22:33:37] [P1] hardware: Raspberry Pi 3B 1.2 (1GB) [10/12/2022, 22:33:37] [P1] os: Raspbian GNU/Linux 11 (bullseye) [10/12/2022, 22:33:38] [P1] npm registry: request 1: GET /homebridge-p1/latest [10/12/2022, 22:33:38] [P1] connected to /dev/ttyS0 [10/12/2022, 22:33:38] [P1] npm registry: request 1: 200 OK [10/12/2022, 22:33:38] [P1] latest version: homebridge-p1 v1.2.28 [10/12/2022, 22:33:54] [P1] telegram: ELL5\253833635_A

0-0:1.0.0(221210223346W) 1-0:1.8.0(00025622.372kWh) 1-0:2.8.0(00000000.001kWh) 1-0:3.8.0(00000001.587kvarh) 1-0:4.8.0(00006403.224kvarh) 1-0:1.7.0(0000.520kW) 1-0:2.7.0(0000.000kW) 1-0:3.7.0(0000.000kvar) 1-0:4.7.0(0000.594kvar) 1-0:21.7.0(0000.053kW) 1-0:41.7.0(0000.286kW) 1-0:61.7.0(0000.180kW) 1-0:22.7.0(0000.000kW) 1-0:42.7.0(0000.000kW) 1-0:62.7.0(0000.000kW) 1-0:23.7.0(0000.000kvar) 1-0:43.7.0(0000.000kvar) 1-0:63.7.0(0000.000kvar) 1-0:24.7.0(0000.238kvar) 1-0:44.7.0(0000.270kvar) 1-0:64.7.0(0000.085kvar) 1-0:32.7.0(239.6V) 1-0:52.7.0(237.5V) 1-0:72.7.0(239.1V) 1-0:31.7.0(001.0A) 1-0:51.7.0(001.7A) 1-0:71.7.0(000.9A) !DF99

[10/12/2022, 22:33:54] [P1] warning: 1-0:1.8.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:2.8.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:3.8.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:4.8.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:3.7.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:4.7.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:23.7.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:43.7.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:63.7.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:24.7.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:44.7.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] warning: 1-0:64.7.0: ignoring unknown key [10/12/2022, 22:33:54] [P1] raw data: {"type":"ELL5\253833635_A","checksum":"DF99","lastupdated":"2022-12-10T22:33:46","power":520,"power_back":0,"l1_power":53,"l2_power":286,"l3_power":180,"l1_power_back":0,"l2_power_back":0,"l3_power_back":0,"l1_voltage":239.6,"l2_voltage":237.5,"l3_voltage":239.1,"l1_current":1,"l2_current":1.7,"l3_current":0.9} [10/12/2022, 22:33:54] [P1] warning: TypeError: Cannot read properties of undefined (reading 'trim') at P1Client.parseTelegram (/var/lib/homebridge/node_modules/homebridge-p1/lib/P1Client.js:563:22) at ReadlineParser. (/var/lib/homebridge/node_modules/homebridge-p1/lib/P1Client.js:402:51) at ReadlineParser.emit (node:events:513:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:293:11) at ReadlineParser.Readable.push (node:internal/streams/readable:234:10) at ReadlineParser._transform (/var/lib/homebridge/node_modules/homebridge-p1/node_modules/@serialport/parser-delimiter/dist/index.js:28:18) at ReadlineParser.Transform._write (node:internal/streams/transform:175:8) at writeOrBuffer (node:internal/streams/writable:392:12) at _write (node:internal/streams/writable:333:10) [10/12/2022, 22:34:04] [P1] warning: 1-0:1.8.0: ignoring unknown key [10/12/2022, 22:34:04] [P1] warning: TypeError: Cannot read properties of undefined (reading 'trim') at P1Client.parseTelegram (/var/lib/homebridge/node_modules/homebridge-p1/lib/P1Client.js:563:22) at ReadlineParser. (/var/lib/homebridge/node_modules/homebridge-p1/lib/P1Client.js:402:51) at ReadlineParser.emit (node:events:513:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:293:11) at ReadlineParser.Readable.push (node:internal/streams/readable:234:10) at ReadlineParser._transform (/var/lib/homebridge/node_modules/homebridge-p1/node_modules/@serialport/parser-delimiter/dist/index.js:28:18) at ReadlineParser.Transform._write (node:internal/streams/transform:175:8) at writeOrBuffer (node:internal/streams/writable:392:12) at _write (node:internal/streams/writable:333:10) [10/12/2022, 22:34:08] [P1] flush cachedAccessories

ebaauw commented 1 year ago

Please attach the log file; the copy/paste corrupted the telegram.

babaknahh1 commented 1 year ago

homebridge.log (1).txt i think this is in regards to other codes i´ve added, not your repo

ebaauw commented 1 year ago

This is a very weird telegram. The checksum is valid and basic structure is DSMR alright, but I cannot make head nor tail from the contents:

Does this telegram come from the meter, or do you have a logger in between? What country are you in? What type of meter is this? What DSMR version does it provide? Usually there's a small sticker or label on the meter listing this. Does your network company provide any documentation?

I doubt the version of Homebridge is any way related to this. Did Homebridge P1 work with your meter and another version of Homebridge? If so, what other changes did you make besides upgrading Homebridge?

babaknahh1 commented 1 year ago

it´s a Sagemcom T211 in sweden. I don´t have any proper documentation. But if it´s key 0.2.0 i can read V0221 directly on the meter. And it does contain kvar and kvarh values as well. I don´t have a logger, it´s connected to the meter directly. It was working fine with 1.5.1 (homebridge) but then i did an update and i got errors. I've used tihs repo to get the correct data for the swedish t211: https://github.com/peterall/homebridge-p1