ebaauw / homebridge-p1

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

Keep getting log messages despite log level 0 #75

Closed jeroen020 closed 1 year ago

jeroen020 commented 1 year ago

It's been a while since I check my Pi running Homebridge and I was updating my plugins today. On the Status page I'm getting continuous (multiple per second) log messages from the P1 plugin. I've set the Log Level of the Electricity accessory to 0 in the Eve app, but no change. The log does state [31/03/2023, 14:23:06] [P1] Electricity: Log Level: changed to 0 (from 1) Maybe something caused by the latest Apple updates?

ebaauw commented 1 year ago

No, this is Homebridge stuff, nothing to do with iOS, etc. versions. What messages do you get after that "Log Level: changed to 0" message?

jeroen020 commented 1 year ago

It looks like this:

[31/03/2023, 18:12:20] [P1] Electricity: Log Level: changed to 0 (from 1)
2023-03-31T16:12:21.029Z ciao:Responder Sending response via unicast to {"address":"192.168.2.140","port":5353,"interface":"eth0"} (took 6 ms): [PTR,PTR,PTR,PTR] answers and [TXT,SRV,A,AAAA,AAAA,NSEC,NSEC,TXT,SRV,A,AAAA,AAAA,NSEC,NSEC,TXT,SRV,A,AAAA,AAAA,NSEC,NSEC,TXT,SRV,A,AAAA,AAAA,NSEC,NSEC] additionals with size 1398B (UPS: 1440)
2023-03-31T16:12:21.030Z ciao:Responder Sending response via unicast to {"address":"192.168.2.140","port":5353,"interface":"eth0"} (took 7 ms): [PTR,PTR,PTR,PTR] answers and [TXT,SRV,A,AAAA,AAAA,NSEC,NSEC,TXT,SRV,A,AAAA,AAAA,NSEC,NSEC,TXT,SRV,A,AAAA,AAAA,NSEC,NSEC,TXT,SRV,A,AAAA,AAAA,NSEC,NSEC] additionals with size 1316B (UPS: 1440)
[31/03/2023, 18:12:21] [P1] Electricity Phase 1: Consumption: set to 1254 W (from 1247 W)
[31/03/2023, 18:12:21] [P1] Electricity Phase 1: Voltage: set to 227.9 V (from 228 V)
[31/03/2023, 18:12:21] [P1] Electricity Phase 2: Voltage: set to 228.8 V (from 229 V)
[31/03/2023, 18:12:21] [P1] Electricity Phase 3: Voltage: set to 228.5 V (from 228.6 V)
[31/03/2023, 18:12:21] [P1] Electricity Delivered Phase 3: Consumption: set to 70 W (from 78 W)
[31/03/2023, 18:12:22] [P1] Electricity Phase 1: Consumption: set to 1245 W (from 1254 W)
[31/03/2023, 18:12:22] [P1] Electricity Phase 1: Voltage: set to 228.1 V (from 227.9 V)
[31/03/2023, 18:12:22] [P1] Electricity Phase 2: Consumption: set to 78 W (from 79 W)
[31/03/2023, 18:12:22] [P1] Electricity Phase 2: Voltage: set to 229.1 V (from 228.8 V)
[31/03/2023, 18:12:22] [P1] Electricity Phase 3: Voltage: set to 228.7 V (from 228.5 V)
[31/03/2023, 18:12:22] [P1] Electricity Delivered Phase 3: Consumption: set to 79 W (from 70 W)
ebaauw commented 1 year ago

Thanks. Looks like the accessory for the phases doesn’t sync the log level to the electricity accessory.

ebaauw commented 1 year ago

In v1.3.5.

jeroen020 commented 1 year ago

Just installed but now P1 throws errors (so fast I can’t even copy & paste from the status screen in HB) and I need to disable the plugin for HomeBridge to work. I got the lines below from a screenshot I took:

EDIT : reverted to 1.3.4 and then I no longer get the issue.

[09/04/2023, 10:35:43] [P1] ISK5\2M550T-1012 v5.0
[09/04/2023,
10:35:431
[P11 Electricity: Configured Name: warning: 7 listeners
Hostname
homebridge
[09/04/2023,
10:35:43] [P1] Electricity: On: warning: 7 listeners
[09/04/2023, 10:35:43] (P1] Electricity: Log Level: warning: 7 listeners
IPv4 (eth0)
192.168.2.235
[09/04/2023, 10:35:43] (P1] Electricity History: Configured Name: warning:
7 listeners
[09/04/2023, 10:35:43] (P] Electricity History: History Request: warning: 7 listeners
IPv6 (eth0)
fabd:3f06:28d:4369:81c:9a77:c
[09/04/2023,
10:35:431
[P11 Electricity History: SetTime: warning: 7 listeners
[09/04/2023,
10:35:431 P11 warning: TypeError: delegate: not an AccessoryDelegate
Node.is Version v18.15.0
ElectricityDetails.inheritLogLevel
Lib/node modules /homebridge-pl/node modules /homebridge
-lib/lib/AccessoryDelegate.is:288:13)
User
pi
at new ElectricityDetails (/usr/local/lib/node modules /homebridge-pl/lib/PlAccessory.is:69:10 ) at Electricity.check (/usr/local/lib/node modules /homebridge-pl/lib/PlAccessory. is:29:24)
Storage Path /var/lib/homebridge
at new Electricity (/usr/local/lib/node modules /homebridge-pl/lib/PlAccessory.is:56:10 ) at PIPlatform.onData (/usr/local/lib/node modules /homebridge-pl/lib/PIPlatform. is: 181:26)
Config Path /var/lib/homebridge/config.son
at PIClient.<anonymous> (/usr/local/lib/node modules /homebridge-pl/lib/PIPlatform.is: 117:40)
Service Mode
Yes
at PIClient.emit (node:events: 513:28 ) at PIClient.emit (node: domain: 489: 12)
at PiClient.parseTelegram (/usr/local/lib/node_ modules /homebridge-pl/lib/PIClient.js:682:12)
ReadlineParser.
<anonymous> (/usr/local/lib/node modules /homebridge-pl/lib/PiClient. is:424:51)
ebaauw commented 1 year ago

Hm, looks like the inheritLogLevel() is called a bit too early, before the main Electricity accessory has initialised.

ebaauw commented 1 year ago

Could you try beta v1.3.6-0? I don't have 3-phase electricity, so it's hard for me to test.

jeroen020 commented 1 year ago

Just tried and the beta fixes the issue, and now the log level = 0 command stops the continuous logging as expected. So this is the one I think! Thanks a lot of the rapid fix during Easter, much appreciated.

ebaauw commented 1 year ago

Published v1.3.6, and removed v1.3.5 and the beta.