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

Can't seem to get it to work with a UDM Pro SE #13

Closed NOTaMango closed 1 year ago

NOTaMango commented 1 year ago

Describe Your Problem: Unable to get it to connect and poll a UDM PRO SE running Network 7.4.145 and Unifi OS 3.0.18

Logs:

Unhandled rejection TypeError: Cannot read properties of undefined (reading 'map')
    at ClientRule.get clientTests [as clientTests] (/homebridge/node_modules/homebridge-unifi-occupancy/src/client_rule.ts:25:47)
    at ClientRule.matchesClient (/homebridge/node_modules/homebridge-unifi-occupancy/src/client_filter.ts:14:17)
    at /homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:129:66
    at Array.find (<anonymous>)
    at Client.get rule [as rule] (/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:129:48)
    at Client.get config [as config] (/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:138:14)
    at Client.get shouldShowAsOwner [as shouldShowAsOwner] (/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:145:17)
    at Client.get displayName [as displayName] (/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:157:14)
    at Client.accessoryUUIDKey (/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:192:24)
    at Client.accessoryUUID (/homebridge/node_modules/homebridge-unifi-occupancy/src/accessory_subject.ts:26:53)
    at UnifiOccupancyPlatform.ensureAccessory (/homebridge/node_modules/homebridge-unifi-occupancy/src/platform.ts:268:26)
    at UnifiOccupancyPlatform.ensureAccessories (/homebridge/node_modules/homebridge-unifi-occupancy/src/platform.ts:259:10)
    at /homebridge/node_modules/homebridge-unifi-occupancy/src/platform.ts:252:16
    at tryCatcher (/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/async.js:15:14)

Plugin Config:

 "unifi": {
                "controller": "https://192.168.69.1/network",
                "username": "***",
                "password": "***",
                "site": "default",
                "secure": false
            },
            "interval": 66,
            "showAsOwner": "smartphone",
            "deviceType": {

Screenshots:

Environment:

DouweM commented 1 year ago

@NOTaMango Thanks for the report! I think you've found a bug that happens when you have clientRules defined without namePatterns. I've fixed that in v1.2.3, does the plugin work when you update?

NOTaMango commented 1 year ago

Yes! Now it seems to be loading in! Thank you! <3