mylesagray / homebridge-blueair

BlueAir air purifier plugin for homebridge
Apache License 2.0
38 stars 20 forks source link

Model (and serial number) not showing properly in accessory details. #34

Open dsully opened 3 years ago

dsully commented 3 years ago

Serial Number: server-undefined Model: Default-Model

Looks like the calls to

.setCharacteristic(Characteristic.Model, this.appliance.info.compatibility) .setCharacteristic(Characteristic.SerialNumber, hostname + "-" + this.appliance.info.uuid)

Isn't setting these properly.

The firmware version is also showing as "0.5.1", when the BlueAir firmware shows as 1.1.38 (Wifi Firmware) and 10.35 (MCU Firmware)

dsully commented 3 years ago

The API response looks like:

  {
    "uuid": "25055767702XXXX",
    "name": "Front Bedroom Purifier",
    "timezone": "America/Denver",
    "compatibility": "classic_280i",
    "model": "1.0.9",
    "mac": "98D863XXXX",
    "firmware": "1.1.38",
    "mcuFirmware": "1.0.35",
    "wlanDriver": "V10",
    "lastSyncDate": 1598580892,
    "installationDate": 1598563284,
    "lastCalibrationDate": 1598563284,
    "initUsagePeriod": 0,
    "rebootPeriod": 10800,
    "aimSerialNumber": "S2015000XXXX",
    "aimUpdateDate": 1598563284,
    "roomLocation": "kitchen"
  }

Not sure why the "compatibility" field isn't being pulled. "aimSerialNumber" should be used instead of the uuid.

mylesagray commented 3 years ago

Firmware version is based off the version of the homebridge plugin - 0.5.1.

This is actually something I wanted to solve for a while and is listed under #3 - I tried for a few days to get this working, but had no joy with it - the challenge is the plugin is initialised before the API call is received, and for whatever reason the updateValue call wasn't working on those items.

If you have more insight, that would be awesome.