AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
4.14k stars 332 forks source link

HomeKit: Unable to add accessory. Accessory unreachable #874

Open idjul opened 7 months ago

idjul commented 7 months ago

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

streams:
  salon: 
    - rtsp://admin:password@192.168.1.50: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

Chrischi- commented 7 months ago

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.

AlexxIT commented 7 months ago

Show screenshot with this error

idjul commented 7 months ago

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

MercianWhitey commented 7 months ago

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.

NickM-27 commented 7 months ago

@MercianWhitey you need to run frigate in host networking mode

MercianWhitey commented 7 months ago

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

cms365 commented 4 months ago

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

SashaBusinaro commented 4 months ago

I have the same problem with 1.9.0 and aqara camera

SashaBusinaro commented 3 months ago

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:

adifelice-godaddy commented 3 months ago

~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.

AlexxIT commented 3 months ago

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.

adifelice-godaddy commented 3 months ago

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.

piwi3910 commented 3 months ago

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.

SteampowerJake commented 3 months ago

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\"" }

AlexxIT commented 3 months ago

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

SteampowerJake commented 3 months ago

Figured, thank you!

ddoottaann81 commented 2 months ago

any update on this? same M2 error for me also