go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

HomeKit: Unable to add accessory. Accessory unreachable

Open idjul opened this issue 1 year ago • 32 comments

Hi, i have an issue when i try to add my camera to HomeKit : Unable to add accessory. Accessory unreachable

streams:
  salon: 
    - rtsp://admin:[email protected]:554/live1.sdp
    - ffmpeg:salon#audio=opus
homekit:
  salon:
    pin: 58543600
    name: Salon

I don't think i did something wrong, i can see the camera when i try to add it in HomeKit, and there's nothing in the logs.

Also tried to add the camera to the homekit integration and there's an error:

An unhandled error occurred while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently: M2: Accessory did not send public key

idjul avatar Jan 11 '24 20:01 idjul

Try downgrading to 1.8.2.

All versions after 1.8.2 have the same behaviour for me. Even cameras that are already paired and work with 1.8.2.

Something may have been changed after 1.8.2. In the log (debug/trace) there are no hints or messages at all.

Maybe @AlexxIT can help here.

Until then I have to stay with 1.8.2.

Chrischi- avatar Jan 20 '24 12:01 Chrischi-

Show screenshot with this error

AlexxIT avatar Jan 21 '24 04:01 AlexxIT

Try downgrading to 1.8.2.

All versions after 1.8.2 have the same behaviour for me. Even cameras that are already paired and work with 1.8.2.

Something may have been changed after 1.8.2. In the log (debug/trace) there are no hints or messages at all.

Maybe @AlexxIT can help here.

Until then I have to stay with 1.8.2.

@Chrischi- Latest version installed outside HA works well, the issue is inside HA, and we can't downgrade within HA.

@AlexxIT There's no logs related to homekit, nothing. Screenshot of the failure to pair the camera to HomeKit:

IMG_84C798188093-1

idjul avatar Jan 21 '24 08:01 idjul

Same issue here, using go2rtc with Frigate in a docker container. I've also degraded to 1.8.2 as suggested here and this does work.

MercianWhitey avatar Jan 26 '24 17:01 MercianWhitey

@MercianWhitey you need to run frigate in host networking mode

NickM-27 avatar Jan 26 '24 17:01 NickM-27

I do have my docker network mode set to host. Without this, HomeKit doesn't even see the camera on the network. As I said, I have it working with 1.8.2 just not the latest.

Thanks

MercianWhitey avatar Jan 26 '24 17:01 MercianWhitey

Same issue here when running v1.8.5 inside Home Assistant.

cms365 avatar Apr 01 '24 12:04 cms365

I have the same problem with 1.9.0 and aqara camera

SashaBusinaro avatar Apr 30 '24 22:04 SashaBusinaro

I noticed that the problem occurs only when configuring the stream as an import from homeassistant, but it works correctly when importing as homekit.

streams: aqara-camera: - homekit://192.168.* (Works) - hass:Aqara-Camera (Does not work)

SashaBusinaro avatar May 01 '24 09:05 SashaBusinaro

~I'm not sure if my setup is correct, but this is the error in Home Assistant when I try to pair it to Homekit Device:~

2024-05-05 09:47:37.145 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.py", line 491, in async_step_pair
    self.finish_pairing = await discovery.async_start_pairing(self.hkid)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohomekit/controller/ip/discovery.py", line 69, in async_start_pairing
    request, expected = state_machine.send(response)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohomekit/protocol/__init__.py", line 135, in perform_pair_setup_part1
    raise InvalidError("M2: Accessory did not send public key")
aiohomekit.exceptions.InvalidError: M2: Accessory did not send public key

Update

I was setting up the camera back to Home Assistant via Homekit Device which makes no sense. I was confused. I was able to downgrade to 1.8.2 and complete setup/import on the Home App. It worked just perfectly.

adifelice-godaddy avatar May 05 '24 14:05 adifelice-godaddy

If Hass can't pair some HomeKit device - it's Hass problem. You should create your issue there.

If your trying to add go2rtc homekit camera to Hass - this is make no sense and not supported.

AlexxIT avatar May 05 '24 14:05 AlexxIT

If Hass can't pair some HomeKit device - it's Hass problem. You should create your issue there.

If your trying to add go2rtc homekit camera to Hass - this is make no sense and not supported.

Yes. I was adding the same camera again in HA Homekit, which made no sense. Adding it to Home App worked. I added an update.

adifelice-godaddy avatar May 05 '24 15:05 adifelice-godaddy

Hi it's not a HASS issue. As the same issue exists when just using it as a homekit proxy. My HASS is on another box then my Go2RTC (HA yellow) and my GO2RTC is on my NAS box that also runs my Frigate for resources as well as the USB being only USB2 and giving issues with my coral.

I've connected my Aqara doorbell via homekit to GO2RTC. not to HASS

image

I've done re-exposed it as a homekit device and i can see the device on all my phones, HASS and so on.

image

However i cannot add the device anywhere:

image

The camera stream works totally fine via the Frigate Custom integration. But i was hoping with re-exposing the camera i would get the the other entities part of the doorbell back to HASS. Ooh ye, also look as what IP the exposed Proxied camera is seen... GO2RTC is running in docker with Host network.

piwi3910 avatar May 15 '24 11:05 piwi3910

I'm having the same issues with an Aqara doorbell. Stream works great in HA but can't get it to pair back to HomeKit, get the same M2 didn't send public key message. In the log I see this, 100% possible that it's a problem with my config:

[app] read config error=yaml: unmarshal errors: line 11: cannot unmarshal !!str front_door into struct { Pin string "json:"pin""; Name string "json:"name""; DeviceID string "json:"device_id""; DevicePrivate string "json:"device_private""; Pairings []string "json:"pairings"" } line 13: cannot unmarshal !!str FrontDoor into struct { Pin string "json:"pin""; Name string "json:"name""; DeviceID string "json:"device_id""; DevicePrivate string "json:"device_private""; Pairings []string "json:"pairings"" } line 14: cannot unmarshal !!int 17362463 into struct { Pin string "json:"pin""; Name string "json:"name""; DeviceID string "json:"device_id""; DevicePrivate string "json:"device_private""; Pairings []string "json:"pairings"" } line 15: cannot unmarshal !!str front_door into struct { Pin string "json:"pin""; Name string "json:"name""; DeviceID string "json:"device_id""; DevicePrivate string "json:"device_private""; Pairings []string "json:"pairings"" }

SteampowerJake avatar May 17 '24 01:05 SteampowerJake

yaml: unmarshal errors means you have the wrong config format.

AlexxIT avatar May 18 '24 13:05 AlexxIT

Figured, thank you!

SteampowerJake avatar May 28 '24 16:05 SteampowerJake

any update on this? same M2 error for me also

ddoottaann81 avatar Jun 02 '24 19:06 ddoottaann81