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
42 stars 1 forks source link

HomeKit bridge has a limit of 149 accessories #12

Open DouweM opened 1 year ago

DouweM commented 1 year ago

Especially if you have a lot of other Homebridge sensors as well, it's likely that you'll (eventually) run into the per-bridge accessory limit of 149, like if you have 5 APs and 30 devices that have ever been been on your network, since sensors are not removed when a device disconnects, unless it's for a show-as-owner device (smartphones by default) and the owner's name could not be derived from the (host)name -- these show as Guest: <device name>.

Homebridge supports Child Bridges, which help because we can actually get to 149 sensors for just this plugin, but I haven't yet looked into whether one plugin can use multiple child bridges. I suppose you could install this plugin multiple times with a different child bridge each, with each taking care of a predictable subset of APs and/of devices, based on configured rules or automatic distribution over N instances if each instance knows its own ID in the range 1..N.

Another option is to not eagerly create sensors for every AP for each device that connects, but only as they actually join APs. This would make it harder to move all the sensors to their appropriate room in the Home app, as this would now have to be done again each time the device roams to an AP it hadn't connected to before, instead of all at once.

DouweM commented 1 year ago

To help with this, I implemented the "other option" as a lazy setting in v1.2.0.