nickbreaton / homebridge-modern-forms

Add support for Modern Forms fans to Homekit using Homebridge.
https://npm.im/homebridge-modern-forms
Apache License 2.0
20 stars 5 forks source link

Generate unique serial number #5

Closed JPReding closed 3 years ago

JPReding commented 3 years ago

I appreciate this plugin for homebridge. When attempting to bring this over to Home Assistant via Homekit Controller I get this error:

Platform homekit_controller does not generate unique IDs. ID homekit-Default-SerialNumber-13 already exists

How would I go about generating a unique Serial Number as opposed to "Default-SerialNumber"

nickbreaton commented 3 years ago

Hi @JPReding, would you mind sharing your config.json? From the error message it looks like that error is coming from the homekit_controller platform, but I'm not familiar with that plugin and how that would interact with this plugin.

JPReding commented 3 years ago

Yeah, sorry for the confusion.

homekit_controller isn't a part of homebridge, but it simply reads the data provided by the homebridge plugin.

The ModernForms plugin doesn't create a distinct serial number or uuid and therefore Home Assistant only adds one of my fans and logs an error for my next fan via homekit_controller basically saying it's already added the device (even though I have multiple fans).

I was wondering if this plugin for the ModernForms fan could generate distinct serial numbers (could be anything at random) as opposed to "Default-SerialNumber."

Screen Shot 2020-09-22 at 2 54 45 PM

If it did generate a random SerialNumbers then the error in homekit_controller would resolve as each fan would be seen as a different device.

nickbreaton commented 3 years ago

Thanks for the detailed description! Was super helpful to fix. I've publish version 1.0.8 which uses the client ID returned from the fan as its serial number. As far as I can tell this is its MAC address without colons prepended with MF_, so should be unique.

nickbreaton commented 3 years ago

Please report back if this works for you, and I'll close the issue. Thanks for reporting!

JPReding commented 3 years ago

Wow, thanks for the quick update. This definitely solved the issue for me 👍 Thanks again.