fjs21/homebridge-blueair

TypeError: Cannot read properties of undefined (reading 'co2')

Closed this issue · 5 comments

ulte commented

Using v1.1.0
Correctly identifies type "classic_280i" initialized but keeps showing the error at bottom a number of times before HB shuts itself down with

Got SIGTERM, shutting down Homebridge...
[5/11/2022, 5:02:54 PM] [@fjs21/homebridge-blueair] This plugin generated a warning from the characteristic 'Carbon Dioxide Detected': Characteristic not in required or optional characteristic section for service AirPurifier. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
TypeError: Cannot read properties of undefined (reading 'co2')
    at BlueAirPlatformAccessory.updateCarbonDioxideSensor (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/platformAccessory.ts:562:79)
    at BlueAirPlatformAccessory.updateAccessoryCharacteristics (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/platformAccessory.ts:332:10)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at BlueAirPlatformAccessory.handleVOCDensityGet (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/platformAccessory.ts:281:5)
fjs21 commented

That's odd. Does the CO2 reading show up in the BlueAir app?

ulte commented

It's a classic 280i, which based on the app and their site, doesn't show co2 as an explicit sensor. It senses PM1, PM 2.5, PM 10, tVOC, temp, humidity. Can you disable that reading for the 280i?

fjs21 commented

Yes. I'll put that in the next update.

fjs21 commented

What's weird is I have a 280i and I don't have that issue. Regardless, I can catch this error.

ulte commented

I disabled and renabled the plugin and got the following errors - then did it again and got no errors at all. Not sure what response came back from foobot api this time but it seems to be ok now and works in HB/Homekit. Clear to close.

type "classic_280i" initialized.
5/13/2022, 3:09:13 PM] [@fjs21/homebridge-blueair] This plugin generated a warning from the characteristic 'PM2.5 Density': Characteristic not in required or optional characteristic section for service AirPurifier. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
[5/13/2022, 3:09:13 PM] [@fjs21/homebridge-blueair] This plugin generated a warning from the characteristic 'VOC Density': Characteristic not in required or optional characteristic section for service AirPurifier. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
[5/13/2022, 3:09:13 PM] [@fjs21/homebridge-blueair] This plugin generated a warning from the characteristic 'Air Quality': Characteristic not in required or optional characteristic section for service AirPurifier. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
[5/13/2022, 3:09:13 PM] [@fjs21/homebridge-blueair] This plugin generated a warning from the characteristic 'Current Relative Humidity': Characteristic not in required or optional characteristic section for service AirPurifier. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
[5/13/2022, 3:09:13 PM] [@fjs21/homebridge-blueair] This plugin generated a warning from the characteristic 'Carbon Dioxide Detected': Characteristic not in required or optional characteristic section for service AirPurifier. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.