Please help with YAML config for Homekit integration

I’m struggling with a .yaml configuration for the Homekit integration.
Can somebody tell me why the first example is valid, but the second one throws an error “Invalid config for [homekit]: contains duplicate items: [21063] for dictionary value @ data[‘homekit’]”:
Valid code:

homekit:
  - name: "Homekit YAML"
    filter: 
      include_entities:
        - binary_sensor.one
        - binary_sensor.two

Invalid code:

homekit:
  - name: "Homekit YAML"
    filter: 
      include_entities:
        - binary_sensor.one
        - binary_sensor.two
  - name: "TV Accessory"
    mode: accessory
    filter:
      include_entities:
      - media_player.tv

It is most probably a formatting error but I can’t find it.

1 Like

The second bridge you’re creating (TV Accessory) should have a port number specified. Check out the example in the ‘Manual Configuration’ section on HomeKit - Home Assistant

It looks like your error message is referring to the default port 21063.

1 Like

yes, this seems to do it.
It also makes sense that if you’re only using one Homekit integration you may skip the port and hope for an auto-assigned, while having multiple should point to specific ports in the configuration.