fjs21 / homebridge-blueair

BlueAir air purifier plugin for homebridge
https://www.npmjs.com/package/@fjs21/homebridge-blueair
Apache License 2.0
50 stars 6 forks source link

'Brightness': characteristic was supplied illegal value #22

Closed ztheged closed 2 years ago

ztheged commented 2 years ago

Hi, Thanks for the awesome plugin! I'm getting a warning every 4-5 seconds from the plugin saying:

This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 2500 exceeded maximum of 100. See https://homebridge.io/w/JtMGR for more info.

I have 2 480i units and 1 280i configured.

The LED setting in the blueair app seems to influence this warning, if I turn off the LEDs completely it stops posting. If I set them to 25% brightness it shows 625 in the warning instead of 2500. I'm guessing its a scaling issue of 2500/100? Is there any known fix for this? Thanks

jonato1 commented 2 years ago

It looks like the brightness value is being multiplied by 25 here: https://github.com/fjs21/homebridge-blueair/blob/master/src/platformAccessory.ts#L515

So if the brightness is 25%, then it would be 25*25 = 625 which seems to match with what you're seeing in the logs. It would also explain why 100% brightness is showing 2500.

I don't have a Classic, but it sounds like pending confirmation that the brightness values return 0 to 100, removing that multiplication should fix the excessive warnings.

fjs21 commented 2 years ago

Maybe they changed the API on this. It used to go from 0-4 hence the scaling. I'll take a look on my Classic 280i and report back.

fjs21 commented 2 years ago

Should be fixed in v1.0.8