Closed wimleers closed 1 year ago
P.S.: I just posted a very detailed response to your questions on the PR — which you merged while I was working on it, so I'm now worried you won't see it 😅 https://github.com/ebaauw/homebridge-p1/pull/69#issuecomment-1425648028
The value should have been treated as an unsigned int, so it can handle values up to 65535, see https://github.com/ebaauw/homebridge-lib/commit/4a1ddf006b876fe129ca69fd175d6b1311bce8c4.
I am a bit worried about the history value of 35940. This would indicate that you consumed 3596 Wh or 3.5940 kWh since the previous history entry (presumably 10 minutes ago). Was the P1 cable disconnected, causing consumption to be added over multiple 10-min periods?
As written at https://github.com/ebaauw/homebridge-p1/pull/69#issuecomment-1427000431:
git clone
d https://github.com/ebaauw/homebridge-p1/commit/e07fc82b69da3b0f48562ee47d4296ec5d177397 and npm link
ed it.
That still resulted in this:
[2/13/2023, 12:21:41 PM] [P1] Electricity History: History Entries: error: RangeError: The value of "value" is out of range. It must be >= -32768 and <= 32767. Received 35940
at new NodeError (node:internal/errors:399:5)
at checkInt (node:internal/buffer:74:11)
at writeU_Int16LE (node:internal/buffer:724:3)
at Buffer.writeInt16LE (node:internal/buffer:867:10)
at ConsumptionValue.writeEntry (/Users/admin/Desktop/homebridge-p1/node_modules/homebridge-lib/lib/ServiceDelegate/History.js:79:47)
at History.entryToBuffer (/Users/admin/Desktop/homebridge-p1/node_modules/homebridge-lib/lib/ServiceDelegate/History.js:602:19)
at History._onGetEntries (/Users/admin/Desktop/homebridge-p1/node_modules/homebridge-lib/lib/ServiceDelegate/History.js:687:24)
at CharacteristicDelegate._onGet (/Users/admin/Desktop/homebridge-p1/node_modules/homebridge-lib/lib/CharacteristicDelegate.js:353:26)
at Characteristic.emit (node:events:513:28)
at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2463:14
[2/13/2023, 12:21:42 PM] [P1] Electricity History: History Entries: error: RangeError: The value of "value" is out of range. It must be >= -32768 and <= 32767. Received 35940
at new NodeError (node:internal/errors:399:5)
at checkInt (node:internal/buffer:74:11)
at writeU_Int16LE (node:internal/buffer:724:3)
at Buffer.writeInt16LE (node:internal/buffer:867:10)
at ConsumptionValue.writeEntry (/Users/admin/Desktop/homebridge-p1/node_modules/homebridge-lib/lib/ServiceDelegate/History.js:79:47)
at History.entryToBuffer (/Users/admin/Desktop/homebridge-p1/node_modules/homebridge-lib/lib/ServiceDelegate/History.js:602:19)
at History._onGetEntries (/Users/admin/Desktop/homebridge-p1/node_modules/homebridge-lib/lib/ServiceDelegate/History.js:687:24)
at CharacteristicDelegate._onGet (/Users/admin/Desktop/homebridge-p1/node_modules/homebridge-lib/lib/CharacteristicDelegate.js:353:26)
at Characteristic.emit (node:events:513:28)
at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2463:14
Updating to 1.3.3-0
resolved this and allowed the Eve history to finish loading:
Updating to 1.3.3-0 resolved this and allowed the Eve history to finish loading:
Yeah, I think (hope), I finally tamed the history for Total Consumption. Also, I’m now simply ignoring the invalid value (after issuing a warning message), and continue with the next entry.
Published v1.3.3.
This has been reliably ever since updating 1.3.3-0
! 🥳 Closing 😊
This plugin has been working wonderfully. The Eve history charts are super valuable. They still work great for
Electricity Delivered
andGas
, but myElectricity
suddenly stopped working yesterday!Then I was able to screenshot this, the actual error: 😨
Happy to provide you with a dump of anything you need. Happy to investigate myself if you can give pointers 😊