kpsuperplane / homebridge-wiz-lan

Control Wiz lights over LAN
Apache License 2.0
115 stars 37 forks source link

homebridge-wiz-lan v3.2.0 is logging errors. #84

Closed MoTechnicalities closed 1 year ago

MoTechnicalities commented 2 years ago

Homebridge v1.3.8 Node.js Version v16.13.0 Npm Version v8.1.4 homebridge-wiz-lan v3.2.0 Scenes Enabled Loggs report this in the color red:

[23/11/2021, 17:24:05] [homebridge-wiz-lan] This plugin threw an error from the characteristic 'Saturation': Unhandled error thrown inside write handler for characteristic: Cannot read properties of undefined (reading 'temp'). See https://git.io/JtMGR for more info. [23/11/2021, 17:24:05] [homebridge-wiz-lan] This plugin threw an error from the characteristic 'Hue': Unhandled error thrown inside write handler for characteristic: Cannot read properties of undefined (reading 'temp'). See https://git.io/JtMGR for more info.

kpsuperplane commented 2 years ago

I'm not able to reproduce this and am having trouble tracking it down. Is it possible for you to put Homebridge in debug mode and get me a stack trace?

MoTechnicalities commented 2 years ago

I have searched for how to get you a stack trace but haven't found any useful resource. I do know how to place Homebridge in DEBUG mode. But would appreciate a brief explanation of how to get the stack trace and get it to you. I was experiencing very slow internet when those errors were being issued in red. I traced my slow internet to the need for a router reboot. After that I still get errors, but not in red.

The errors now read as follows: [24/11/2021, 19:08:35] [homebridge-wiz-lan] This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "NaN" (number). See https://git.io/JtMGR for more info.

MoTechnicalities commented 2 years ago

Relevant portion of my Log output in debug mode:

[31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb50ad1001 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb5071dab0 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb50ac7c47 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb5085b391 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb50ac5f32 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb50abacb2 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb50abb9e2 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb50720568 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb50ac67fb [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb50ac5cc1 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb5081f9b7 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb5081e371 [31/12/2021, 14:16:20] [Wiz] [getPilot] Sending getPilot to a8bb50ac5cbd [31/12/2021, 14:16:20] [Wiz] [Socket] [192.168.1.154:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb5085b391","rssi":-61,"src":"","state":false,"sceneId":6,"dimming":96}} [31/12/2021, 14:16:20] [Wiz] [Socket] [192.168.1.109:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb50ac67fb","rssi":-74,"src":"","state":false,"sceneId":14}} [31/12/2021, 14:16:20] [homebridge-wiz-lan] This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "NaN" (number). See https://git.io/JtMGR for more info. [31/12/2021, 14:16:20] [homebridge-wiz-lan] Error: at Brightness.Characteristic.characteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2074:105) at Brightness.Characteristic.validateUserInput (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1967:16) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1569:24 at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:9:18 at /usr/local/lib/node_modules/homebridge-wiz-lan/src/accessories/WizBulb/characteristics/dimming.ts:32:20 at onDone (/usr/local/lib/node_modules/homebridge-wiz-lan/src/accessories/WizBulb/pilot.ts:142:7) at /usr/local/lib/node_modules/homebridge-wiz-lan/src/accessories/WizBulb/pilot.ts:156:5 at /usr/local/lib/node_modules/homebridge-wiz-lan/src/util/network.ts:45:29 at Array.map () at /usr/local/lib/node_modules/homebridge-wiz-lan/src/util/network.ts:45:17 [31/12/2021, 14:16:20] [Wiz] [Socket] [192.168.1.74:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb50abb9e2","rssi":-72,"src":"","state":true,"sceneId":0,"temp":3670,"dimming":81,"schdPsetId":2}} [31/12/2021, 14:16:20] [Wiz] [Socket] [192.168.1.190:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb50ac5cc1","rssi":-47,"src":"","state":true,"sceneId":6,"dimming":45}} [31/12/2021, 14:16:20] [Wiz] [Socket] [192.168.1.77:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb50ac7c47","rssi":-83,"src":"","state":true,"sceneId":0,"temp":3670,"dimming":81,"schdPsetId":2}} [31/12/2021, 14:16:20] [Wiz] [Socket] [192.168.1.189:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb50ac5cbd","rssi":-70,"src":"","state":false,"sceneId":6,"dimming":55}} [31/12/2021, 14:16:20] [Wiz] [Socket] [192.168.1.164:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb50720568","rssi":-64,"src":"","state":false,"sceneId":19,"dimming":100}} [31/12/2021, 14:16:20] [Wiz] [Socket] [192.168.1.241:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb5071dab0","rssi":-66,"src":"","state":false,"sceneId":19,"dimming":100}}

MoTechnicalities commented 2 years ago

So in the above post NaN occurred after a log that getPilot received unacceptable or missing dimming information.

[31/12/2021, 14:16:20] [Wiz] [Socket] [192.168.1.109:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb50ac67fb","rssi":-74,"src":"","state":false,"sceneId":14}}

MoTechnicalities commented 2 years ago

So, it happens intermittently, when getPilot receives invalid dimming info. Here is another occurrence that happened with a different light:

[01/01/2022, 03:06:19] [Wiz] [Socket] [192.168.1.77:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb50ac7c47","rssi":-66,"src":"","state":true,"sceneId":14,"schdPsetId":2}}

NOTE MISSING dimming INFO

[01/01/2022, 03:06:19] [homebridge-wiz-lan] This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "NaN" (number). See https://git.io/JtMGR for more info.

[01/01/2022, 03:06:19] [homebridge-wiz-lan] Error: at Brightness.Characteristic.characteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2074:105) at Brightness.Characteristic.validateUserInput (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1967:16) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1569:24 at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:9:18 at /usr/local/lib/node_modules/homebridge-wiz-lan/src/accessories/WizBulb/characteristics/dimming.ts:32:20 at onDone (/usr/local/lib/node_modules/homebridge-wiz-lan/src/accessories/WizBulb/pilot.ts:142:7) at /usr/local/lib/node_modules/homebridge-wiz-lan/src/accessories/WizBulb/pilot.ts:156:5 at /usr/local/lib/node_modules/homebridge-wiz-lan/src/util/network.ts:45:29 at Array.map () at /usr/local/lib/node_modules/homebridge-wiz-lan/src/util/network.ts:45:17