blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
16.14k stars 1.52k forks source link

[Support]: go2rtc HomeKit module pairing list writeback to config.yml #9016

Open civita opened 6 months ago

civita commented 6 months ago

Describe the problem you are having

I am using HomeKit module from go2rtc and am able to pair cameras and view them in Apple Home app. However, it works until Frigate restarts.

In go2rtc logs, it shows the following error after restarting Frigate: ERR github.com/AlexxIT/go2rtc/internal/homekit/homekit.go:179 > error="hap: PairVerify from: 10.8.0.86:49347, with unknown client_id: ..."

It looks like go2rtc will append client_id to config.yml after successful pairing. However, the file go2rtc uses in Frigate instance is located in /dev/shm/go2rtc.yaml which is a tmpfs filesystem and will be re-generated from Frigate's config.yml after restart.

The workaround I am using is looking at the go2rtc.yaml (directly or via :1984), finding client_id, and manually add it into config.yml in Frigate:

go2rtc:
  streams:
    camer_1:
      # ...
  homekit:
    camera_1:
      # the following two lines are manually added
      pairings:
       - client_id=...

I would like to know if there's better way to do that. Thanks.

Version

0.13.0-C35C7DA

Frigate config file

go2rtc:
  streams:
    camer_1:
      # ...
  homekit:
    camera_1:
      # the following two lines are manually added
      pairings:
       - client_id=...

Relevant log output

ERR github.com/AlexxIT/go2rtc/internal/homekit/homekit.go:179 > error="hap: PairVerify from: 10.8.0.86:49347, with unknown client_id: ..."

FFprobe output from your camera

N/A

Frigate stats

No response

Operating system

Debian

Install method

Docker CLI

Coral version

USB

Network connection

Wired

Camera make and model

N/A

Any other information that may be helpful

No response

NickM-27 commented 6 months ago

I would like to know if there's better way to do that. Thanks.

this is the best way until frigate natively supports saving this data

AlexxIT commented 6 months ago

go2rtc supports multiple configs. And it will use first config as main config. So main config may be placed in the /config/go2rtc.yaml and second config may be placed to frigate.yaml

skrashevich commented 6 months ago

go2rtc supports multiple configs. And it will use first config as main config. So main config may be placed in the /config/go2rtc.yaml and second config may be placed to frigate.yaml

And what happens if the camera name will changed through the frigate configuration?

AlexxIT commented 6 months ago

Anyway homekit section should be added manually to main config. If user has streams section in the frigate, he should sync names manually in two configs.

kidhasmoxy commented 5 months ago

@civita - are you running host networking in your compose? I'm using the addon for HomeAssistant and can't get the pairing to complete unless I run the go2rtc addon directly. Trying to see if I can modify the frigate addon to work properly with homekit pairing.

civita commented 4 months ago

Hi @kidhasmoxy, sorry for the late reply. I am running Frigate docker version with privileged mode. If it's a pairing problem not sure if it's due to mDNS port used by multiple apps.

AlexxIT commented 4 months ago

I don't have problems with mDNS on server with go2rtc and some other software, that also using mDNS