homebridge-wiz-lan icon indicating copy to clipboard operation
homebridge-wiz-lan copied to clipboard

NaN error from brightness

Open bierlos opened this issue 3 years ago • 2 comments

This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "NaN" (number).

bierlos avatar Jan 17 '22 08:01 bierlos

This is related to #84. I documented the issue. But it is not clear if he will or can fix it.

MoTechnicalities avatar Jan 17 '22 08:01 MoTechnicalities

@kpsuperplane The NaN error is generated when a bulb does not send the Brightness characteristic. And this only seems to happens occasionally while a bulb is off ("state":false), as follows:

[24/01/2022, 13:42:22] [Wiz] [Socket] [192.168.1.109:38899] Received message: {"method":"getPilot","env":"pro","result":{"mac":"a8bb50ac67fb","rssi":-63,"src":"","state":false,"sceneId":14}}

Note that after "sceneId":14, there is no dimming level provided, while the bulb happens to be: "state":false. If you redesign the plugin so that no dimming information is mandatory to be collected while the bulb's state is false then the error should no longer be generated.

While preserving a bulbs last brightness level is important information for when a bulb is to be turned back on after having been turned off, officially when a bulb's state is off or false the current Brightness is 0 or Null.

MoTechnicalities avatar Jan 24 '22 19:01 MoTechnicalities