Splitting Homekit configuration

I’m trying to tidy up configuration files and want to put homekit stuff on its own, like I did for some of the light domain configurations.

But for the life of me can’t figure out the right syntax to make it work. Basically every time I try I end up with default parameters under homekit:

Here is what I tried :

    homekit:
    homekit filters: !include homekit_filters.yaml

with homekit_filters.yaml as :

 - filter:
     include_domains:
       - light
       - switch
       - input_boolean
[...]

Here is some output from the configuration parser, as you can see, it pretty much ignores the included file

bash-5.1# python -m homeassistant --script check_config --info homekit -c /config
Testing configuration at /config
Successful config (partial)
  homekit:
    - auto_start: True
      entity_config: ?
      filter: ?
        exclude_domains: ?
        exclude_entities: ?
        exclude_entity_globs: ?
        include_domains: ?
        include_entities: ?
        include_entity_globs: ?
      mode: bridge
      name: Home Assistant Bridge
      port: 21063
      safe_mode: False

have you tried this:

configuration.yaml:

  homekit: !include_dir_merge_list homekit/

then in the homekit/ directory put homekit_filters.yaml along with your other home config.

But I’m pretty sure you can’t !include any sub-keys from under the homekit: key

so you can’t do:

homekit:
    - auto_start: True
      entity_config: ?
      filter: !include homekit_filters.yaml
        exclude_domains: ?
        exclude_entities: ?
        exclude_entity_globs: ?
        include_domains: ?
        include_entities: ?
        include_entity_globs: ?
      mode: bridge
      name: Home Assistant Bridge
      port: 21063
      safe_mode: False

which it seems like you are trying to do.

Thank you.

I didn’t try directory include yet, I wanted to have a full understanding first.

I do have the dash sign that starts the declaration of the whole HomeKit instance under homekit: so I don’t think I’m doing what you described, even though my include is poorly named, it’s not just filters in the but the whole declaration which happens to have only filters.

For the records here is how I fixed it. I was wrong trying to add a tagged reference below homekit, the right way to include in in this context was :

homekit: !include homekit.yaml

I think that’s what @finity meant but since my post was misleading that I was trying to include filters only I didn’t understand.