hkknx-public icon indicating copy to clipboard operation
hkknx-public copied to clipboard

Configurator app should generate unique accessory names to prevent HMErrorCode 31

Open brutella opened this issue 2 years ago • 7 comments

HomeKit doesn't allow multiple accessories with the same name. Specifically you cannot rename accessories to have the same name. Therefore the Configurator app should use the room name as a prefix for accessory names. This should work because Home app automatically removes the room name from the accessory name when displaying the accessory.

The only downside is that when you rename the room, the room name doesn't match the accessory name prefix anymore.

Any thoughts on this?

brutella avatar Aug 30 '22 07:08 brutella

I have multiple accessories by the name Deckenlicht in different rooms. Works flawlessly. I Never had a Problem with this Setup. Why shouldn't this be possible?

chef76 avatar Aug 30 '22 08:08 chef76

Did you rename those accessories afterwards, or did you set the name on creation? HomeKit doesn't allow renaming accessories to have the same name.

brutella avatar Aug 30 '22 08:08 brutella

O.k. understood. All names were given on creation in the bridge, no renaming afterwards in Homekit.

chef76 avatar Aug 30 '22 08:08 chef76

I have the same setup as @chef76: Multiple items with the same name (e.g., "Decke" or "Rolladen") that were given this name upon creation. I never tried to rename them, but if that is not possible, this seems to be a bug that should be handled somehow. To me, your proposal makes sense in general. However, I think there may be some edge cases. For example, some may already prefix the accessory names with the room names manually. Maybe this should not be handled "magically" by the configurator app, but in HKKNX directly instead: If the given room name is not a prefix of the accessory, add it. This should be more transparent for users hopefully.

mirkolenz avatar Aug 30 '22 08:08 mirkolenz

If the given room name is not a prefix of the accessory, add it.

You mean the name field in hkknx should also contain the room name after saving the name?

brutella avatar Aug 30 '22 09:08 brutella

Yes, exactly. This could be treated as some kind of "auto-correct" that is then also mentioned in the save confirmation banner.

mirkolenz avatar Aug 30 '22 09:08 mirkolenz

I just had another idea regarding this issue: Maybe the automatic renaming should only happen in case a conflict occurs (i.e., the same name is used twice). This gives more freedom to the user.

mirkolenz avatar Aug 30 '22 10:08 mirkolenz

This issue has some interesting developments. I'm running iOS 16.2 and it seems like HomeKit automatically updates the accessory names after changing them in hkknx. There is no need to synchronise the names using the Configurator.app.

You can even use the same name for multiple accessories without any issues. 😳 Can someone verify this?

brutella avatar Feb 24 '23 14:02 brutella

I'm unable to reproduce the issue of name collision in iOS 16.3. HomeKit doesn't seem to complain anymore when naming multiple accessories the same.

brutella avatar Mar 20 '23 11:03 brutella