Multiple HomeKit instances on same HA - how to?

Did an internet search on this but didn’t found an answer.

Trying to have 2 HomeKit instances running on the same Home Assistant. One includes some admin functionality, not meant for all users.

I duplicated the existing config, removed some stuff, added different names and ports for both.

Tried these variants:

homekit:
  name: HA1
  port: 51827
.
.
  name: HA2
  port: 51828
.
.
homekit:
- name: HA1
  port: 51827
.
.
- name: HA2
  port: 51828
.
.
homekit:
  name: HA1
  port: 51827
.
.
 
homekit:
 name: HA2
  port: 51828
.
.

Either invalid config or only the last ‘name block’ becomes a working HomeKit instance.

Anyone who has an idea?

Still nothing?

Any luck on this? I just learned the hard way that HomeKit doesn’t let different users have independent favorites, which prevents it from being useful for anyone but myself.

No luck.

I just invited a person to my Homekit via Apple and do understand what you mean with favourites now. It is disappointing. I guess you cannot pair the existing Homekit with multiple devices? That would at least solve the favourites problem, but still not give the ability to show/hide specific entities.

Same situation, would love multiple homekit instances on the same HA. Can a single homekit device talk to two different homekit hubs simultaneously. My user case it different user groups with different permissions. Might have to wait until Apple implement user permissions in Home

Did anyone work out how to do this? I have a client with HA/Homekit who wants some in their house to not be able to access the lights/blinds in their room, so was thinking 2 different HomeKit hubs (with different apple ids) to do this. Or does anyone else know of a way you can limit who has access to what in Homekit?

Can do in HA with the locked down PIN number based cards, but once you punch through to Homekit, all bets are off.

Thanks all!

I’ve yet to try it, but there it is: https://www.home-assistant.io/blog/2020/05/20/release-110/

It appears to only work via adding integrations via the web. Haven’t figured out how to multiple via YAML yet, which is problematic as the web doesn’t appear to have all the features of configuring YAML, like tying a motion sensor to a camera.

Here is what I use on one of my installs:

homekit:
- port: 55724
  name: AXTEST
  entity_config:
    camera.8th_street_facing_laurence:
       support_audio: True
       video_codec: copy
    camera.backyard:
       support_audio: True
       video_codec: h264_omx
    camera.gate:
       support_audio: True
       video_codec: copy
    camera.north:
       support_audio: True
       video_codec: copy
  filter:
    include_domains:
      - camera
      - climate
      - water_heater
      - cover
    include_entities:
      - light.nick_office_lights
      - sensor.ups_battery_runtime_2
      - sensor.ups_battery_runtime_1
      - climate.heater
- port: 55604
  name: ZXNICE
  filter:
    include_domains:
      - light
      - switch
      - lock
1 Like

This does work.

Very cool. I didn’t know you could do this. Just curious - Are you arbitrarily picking the ports? Is there some recommended range to use?

I usually pick ports in the 55XXX range since I know they generally won’t conflict with anything else.

Is it possible to configure two Homekit instances via the web UI ? I m getting this log:

The local port 51828 is in use

So my two Homekit instances are working on the same port ? But there isn´t a option to change the port

Greets

@gidadavid Yes, you can configure multiple HomeKit instances in the UI. However, I don’t think it will allow you to choose a port. I ended up dropping all of my UI-configured instances and put everything in configuration.yaml. You have much more control over it that way.

1 Like

Check .storage/core.config_entries. You can manually change the port in there. Make a backup first

homekit tolerates the port being changed so we could probably add support for checking all the config entries and port availability and then choose the next available port instead of erroring.

I opened a PR to improve the way we pick ports to avoid a situation where the same port is chosen for a second config entry

You can absolutely have as many HomeKit instances on different ports as your system will handle. I have 8 running right now in my HomeKit and I specified each and every port.

In my configuration.yaml:

# HomeKit
homekit: !include homekit.yaml

In my homekit.yaml:

##########################################
# FULL HOMEKIT
##########################################
- name: Full HomeKit
  auto_start: false
  port: 56328
  filter:
    include_entities:
      ... the entities

##########################################
# FAMILY SHARED HOMEKIT
##########################################
- name: Shared House
  auto_start: false
  port: 56322
  filter:
    include_entities:
      ... the entities

##########################################
# SPECIAL SENSORS
##########################################
- name: Special Sensors
  auto_start: false
  port: 56327
  filter:
    include_entities:
     ... the entities

Just rinse and repeat.

4 Likes

So I finally split out my cameras as suggested and it is working great… I also can finally get them to stream to my Apple Watch which never worked before.
I do have a question about them though, one of my cameras is a doorbell which supports 2-way audio. Previously I had the speaker and a microphone to talk back, but since the it never worked consistently to stream I never really looked into it but I know on a couple occasions no audio was sent. Now that I split out my cameras and made sure my NVR was using H264 on that stream (not H264H, which may have been my main issue)… I only have the speaker to listen and no microphone for talk back.
Does 2-way audio work for anyone else though Homekit or am I wasting my time trying to figure out how to get the mic back?

2 way audio is not implemented.