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

Unhandled rejection TypeError: Cannot read properties of undefined (reading 'computed_dev_id') #23

Open yzeng1314 opened 11 months ago

yzeng1314 commented 11 months ago

Describe The Bug: Every time an device status changes, it will throw this error.

Logs:

Unhandled rejection TypeError: Cannot read properties of undefined (reading 'computed_dev_id')
    at Client.get fingerprint (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:87:34)
    at Client.<anonymous> (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/typescript-memoize/src/memoize-decorator.ts:123:36)
    at /volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/client_type.ts:53:56
    at /volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/client_filter.ts:10:42
    at Array.some (<anonymous>)
    at ClientType.matchesClient (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/client_filter.ts:10:29)
    at /volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:120:56
    at Array.find (<anonymous>)
    at Client.get type [as type] (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:120:38)
    at Client.get config (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:130:23)
    at Client.<anonymous> (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/typescript-memoize/src/memoize-decorator.ts:123:36)
    at Client.get displayName [as displayName] (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:168:14)
    at Client.accessoryUUIDKey (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/client.ts:175:24)
    at Client.accessoryUUID (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/accessory_subject.ts:14:53)
    at ClientTypeAccessoryHandler.get uuid [as uuid] (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/accessory_handler.ts:124:26)
    at ClientTypeAccessoryHandler.get valid [as valid] (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/accessory_handler.ts:158:23)
    at /volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/platform.ts:349:21
    at Map.forEach (<anonymous>)
    at UnifiOccupancyPlatform.removeInvalidAccessories (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/platform.ts:347:22)
    at UnifiOccupancyPlatform.refreshAccessories (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/platform.ts:314:10)
    at /volume1/homebridge/node_modules/homebridge-unifi-occupancy/src/platform.ts:284:24
    at tryCatcher (/volume1/homebridge/node_modules/homebridge-unifi-occupancy/node_modules/bluebird/js/release/util.js:16:23)
yzeng1314 commented 11 months ago

when i check the output from https://<ip>/proxy/network/v2/api/site/default/clients/active, i do see a few of my devices doesn't have full fingerprint object, i.e. missing computed_dev_id field etc.

DouweM commented 10 months ago

@yzeng1314 What version of UnifiOS are you running? Is fingerprinting enabled?

yzeng1314 commented 10 months ago

@DouweM It is on UniFi OS 3.1.16 and yes, fingerprinting is enabled. Most of my devices are showing fingerprint just fine via the API