homebridge: New accessory names not showing up correctly on iOS 16

Analysis

When a new accessory with multiple sub-accessories is added via HomeBridge on iOS 16, the sub-accessories are shown with the parent accessory’s name. If you edit the accessory and clear the default name, the suggested name (in grey text) is the correct accessory name for that sub accessory.

Expected Behavior

The sub-accessory’s suggested name would also be set as that accessory’s default name.

Steps To Reproduce

  1. Install HB latest and pair to a device running iOS 16
  2. Install the SonosSoSimple plugin
  3. Connect the SonosSoSimple plugin to a speaker system (Note: Steps 2 and 3 can be done with any plugin that shows a composite accessory, one that allows you to “show accessories as separate tiles”)
  4. Observe the new accessories added
  5. Tap the tile in HomeKit to expand the accessory
  6. Tap any of the sub-tiles to expand one of the sub-accessories
  7. Scroll down in the sub-accessory to view sub-accessory settings The sub-accessory name will be the same as that of the parent accessory
  8. Clear the name of the sub-accessory by tapping the ‘x’ _The suggested name for the sub-accessory (in gray) will be the correct name

Logs

No logs are applicable to this issue.

Configuration

{
            "soundbarsOnly": true,
            "roomNameAsName": false,
            "volume": "none",
            "platform": "SonosSoSimplePlatform"
        },

Environment

  • OS: Synology DSM 7.1
  • Software: 1.5.0 (HAP v0.10.2)
  • Node: 16.16.0
  • npm: 8.11.0

Process Supervisor

hb-service

Additional Context

Installed via hb-syno-spk latest (3.0.9) but observed on prior versions too

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I found out if you add the following to the accessory, its name will show up correctly:

  service.addOptionalCharacteristic(Characteristic.ConfiguredName);
  service.setCharacteristic(Characteristic.ConfiguredName, accessoryName);

kind regards,

If you’d like to see a robust example of how to address naming challenges, and naming synchronization, take a look at HBUP, which is one of my own plugins: https://github.com/hjdhjd/homebridge-unifi-protect/blob/main/src/protect-device.ts

Look at the accessoryName getter/setter at the end of the file. You can also take a closer look at how you can approach service creation and removal earlier in the file, including dealing with naming.

Enjoy.

Thanks so much @carlosgamezvillegas, I added this fix to my Tesla accessory which previously required manually renaming quite a lot of services!