ebaauw / homebridge-deconz

Homebridge plugin for deCONZ
Apache License 2.0
135 stars 7 forks source link

Characteristic was supplied illegal value: number -127 exceeded minimum of 100 #35

Closed Moritz921 closed 2 years ago

Moritz921 commented 2 years ago

If have just installed the homebridge-deconz plugin and added a few lights and an IKEA Tradfri motion sensor and on/off switch. After about 2 to 3 minutes after startup of homebridge, I get this error:

[10/04/2022, 14:12:43] [homebridge-deconz] This plugin generated a warning from the characteristic 'Status': characteristic was supplied illegal value: number -127 exceeded minimum of 100. See https://git.io/JtMGR for more info.
[10/04/2022, 14:12:43] [homebridge-deconz] Error: 
    at Characteristic.characteristicWarning (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2142:105)
    at Characteristic.validateUserInput (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2045:14)
    at Characteristic.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1582:21)
    at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
    at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57)
    at /usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at __awaiter (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:113:16)
    at Characteristic.handleGetRequest (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:689:38)
    at Characteristic.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2207:22)
    at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
    at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57)
    at /usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at __awaiter (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:113:16)
    at Characteristic.toHAP (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:1328:38)
[10/04/2022, 14:12:43] [deCONZ] TRÅDFRI Bewegungsmelder History: send data: 00
[10/04/2022, 14:12:43] [deCONZ] VPIR test Bewegung History: send data: 00
[10/04/2022, 14:12:43] [deCONZ] TRÅDFRI Bewegungsmelder History: get History Entries: return "AA=="

I get this error more than once, but I haven't figured out when exactly, because even when I don't control anything, the error gets called.

Additionally all homebridge accessories are extremely slow after installing this plugin, they stay in "updating" for about one minute and after that they show the corresponding value. The same minute waiting is present whey I try to control anything via homebridge, although the message of control pops up the second it responds again.

ebaauw commented 2 years ago

I get this error:

It’s a (not very useful) check by Homebridge that the value for the Status characteristic is within the valid range. Not very useful, since Home would only choke on standard characteristics having an invalid value. Still, Homebridge deCONZ shouldn’t set an invalid value. Unfortunately, the stack trace only shows Homebridge and HAP-NodeJS calls, and nothing by Homebridge deCONZ. I would at least need to know which service and accessory this concerns. Afaik Status is used only for the built-in Daylight sensor and CLIPGenericStatus sensors. I also think the error message might be wrong, as 100 is probably the maximum value instead of the minimum.

Additionally all homebridge accessories are extremely slow after installing this plugin, they stay in "updating" for about one minute and after that they show the corresponding value.

Typically that is caused by communication issues between your Apple device and Homebridge, in particular when the Apple device doesn’t receive the mDNS announcements by Homebridge.

ebaauw commented 2 years ago

Could you run v0.0.15 and attach the debug dump file created by that version?

Moritz921 commented 2 years ago

Thank you for further developing this module. I don't get the error with the new version anymore. The slowdown of homebridge also disappeared, although I'm not sure if this module has been the cause. Nonetheless I have attached the debug dump file.

homebridge-deconz.json.gz

ebaauw commented 2 years ago

Weird; other than creating a debug dump file, the new version doesn't change anything, which would prevent the error.

There is a CLIPGenericStatus sensor create by Phoscon,but looking at the rules, it wouldn't have value -127. Maybe the sensor got initialised in a funny way, but one of the rules activated and updated the value?

tchristian1103 commented 2 years ago

Same problem - as written on discord. Here's my debug dump file

homebridge-deconz.json.gz .

ebaauw commented 2 years ago

The deCONZ REST API plugin exposes two Daylight sensors, /sensors/1 and /sensors/72. The latter seems to work OK, but the first one reports rubbish:

{
  "config": {
    "configured": true,
    "on": true,
    "sunriseoffset": 30,
    "sunsetoffset": -30
  },
  "etag": "27c20ab9bbe080fb75d31f3699959311",
  "manufacturername": "Philips",
  "modelid": "PHDL00",
  "name": "Daylight",
  "state": {
    "dark": null,
    "daylight": null,
    "lastupdated": "none",
    "status": null
  },
  "swversion": "1.0",
  "type": "Daylight",
  "uniqueid": "00:21:2e:ff:ff:05:b5:e9-01"
}

Also note that both resources have the same uniqueid value - this will probably confuse the hell out of Homebridge deCONZ.

Are you exposing the Daylight sensor to HomeKit? I think the warning is caused by Homebride deCONZ trying to set Status to null, which HAP-NodeJS somehow treats as -127.

Can you delete the faulty Daylight sensor through the API (e.g. deconz delete /sensors/1); unexpose and re-expose the Daylight sensor; and check whether the warning still occurs?

Note to self: I don't yet include dynamic settings in the dump file.

tchristian1103 commented 2 years ago

I think it worked. Thank you very much! Now I have even learned what a Rest API client is and how to access the system with it!