DouweM / homebridge-unifi-occupancy

Homebridge plugin that adds HomeKit occupancy sensors for selected devices (and people) on your UniFi network to the iOS Home app: quickly see who's where and automate accordingly.
Apache License 2.0
41 stars 1 forks source link

ERROR: Failed to load network devices TypeError: Cannot read properties of undefined (reading 'filter') #24

Open TristanMW opened 10 months ago

TristanMW commented 10 months ago

Describe Your Problem: I am receiving the following error when I strat p homebridge:

ERROR: Failed to load network devices TypeError: Cannot read properties of undefined (reading 'filter')

Logs:

[12/11/2023, 18:00:27] [UnifiOccupancy] ERROR: Failed to load network devices TypeError: Cannot read properties of undefined (reading 'filter')
    at /var/lib/homebridge/node_modules/homebridge-unifi-occupancy/src/platform.ts:230:12
    at tryCatcher (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (node:internal/timers:476:21)
Unhandled rejection TypeError: Cannot read properties of undefined (reading 'filter')
    at /var/lib/homebridge/node_modules/homebridge-unifi-occupancy/src/platform.ts:230:12
    at tryCatcher (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/var/lib/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (node:internal/timers:476:21)```

**Plugin Config:**

```{
            "unifi": {
                "controller": "https://192.168.*.*",
                "username": "***",
                "password": "***",
                "site": "default",
                "secure": false,
                "unifios": true
            },
            "interval": 180,
            "showAsOwner": "smartphone",
            "deviceType": {
                "smartphone": {
                    "enabled": true,
                    "homeAccessory": false,
                    "roomCatchallAccessory": false,
                    "homeCatchallAccessory": false,
                    "lazy": false
                },
                "smart_watch": {
                    "enabled": true,
                    "homeAccessory": false,
                    "roomCatchallAccessory": false,
                    "homeCatchallAccessory": false,
                    "lazy": false
                },
                "laptop": {
                    "enabled": false,
                    "homeAccessory": false,
                    "roomCatchallAccessory": false,
                    "homeCatchallAccessory": false,
                    "lazy": false
                },
                "tablet": {
                    "enabled": false,
                    "homeAccessory": false,
                    "roomCatchallAccessory": false,
                    "homeCatchallAccessory": false,
                    "lazy": false
                },
                "ereader": {
                    "enabled": false,
                    "homeAccessory": false,
                    "roomCatchallAccessory": false,
                    "homeCatchallAccessory": false,
                    "lazy": false
                },
                "game_console": {
                    "enabled": false,
                    "homeAccessory": false,
                    "roomCatchallAccessory": false,
                    "homeCatchallAccessory": false,
                    "lazy": false
                },
                "handheld": {
                    "enabled": false,
                    "homeAccessory": false,
                    "roomCatchallAccessory": false,
                    "homeCatchallAccessory": false,
                    "lazy": false
                },
                "other": {
                    "enabled": false,
                    "homeAccessory": false,
                    "lazy": true
                },
                "wired": {
                    "enabled": false
                }
            },
            "clientRules": [
                {
                    "roomAccessory": true,
                    "homeAccessory": false,
                    "roomCatchallAccessory": false,
                    "homeCatchallAccessory": false,
                    "lazy": true
                }
            ],
            "server": {
                "enabled": true,
                "port": 8582,
                "username": "***",
                "password": "***"
            },
            "platform": "UnifiOccupancy"
        }

Environment: Raspberry Pi 4 running raspbian lite 64bit

TristanMW commented 10 months ago

To add, the controller is a cloud key

shinzan111 commented 1 month ago

I have the same issue and for me this plugin does cause more issues than help for anything …  Will remove it … thanks anyway