quentinms / homebridge-aranet4

An Homebridge plugin to get data from an Aranet4
Apache License 2.0
36 stars 1 forks source link

Accessories not persisted warning #11

Closed ohmantics closed 2 years ago

ohmantics commented 2 years ago

Describe The Bug: Warning emitted during startup and no values reported

To Reproduce:

  1. Install aranet4 plugin
  2. Increase Bluetooth setup timeout to 30s
  3. Increase device scan timeout to 30s
  4. Warning emitted during startup
  5. Device appears in HomeKit, but all values are 0.

Expected behavior:

No warning and device reports properly

Logs:

[4/18/2022, 8:20:11 PM] Failed to save cached accessories to disk: Converting circular structure to JSON
    --> starting at object with constructor 'Peripheral'
    |     property '_noble' -> object with constructor 'Noble'
    |     property '_peripherals' -> object with constructor 'Object'
    --- property 'f5ddf8329406' closes the circle
[4/18/2022, 8:20:11 PM] Your accessories will not persist between restarts until this issue is resolved.

Plugin Config:

        {
            "name": "Aranet4",
            "co2AlertThreshold": 1400,
            "batteryAlertThreshold": 10,
            "sensorDataRefreshInterval": 300,
            "bluetoothReadyTimeout": 30,
            "bluetoothDeviceSearchTimeout": 30,
            "platform": "Aranet4"
        }
quentinms commented 2 years ago

Thanks for the detailed bug report! I can reproduce on my end, after deleting the existing accessory. I'll have a look.

quentinms commented 2 years ago

@ohmantics I believe the issue is fixed with v0.0.2. Please let me know if it now works for you too.

  1. Device appears in HomeKit, but all values are 0.

This is possibly because the default refresh value is 5m to preserve the battery, so it might stay at 0 for a little while.

You can lower it and data should appear sooner.