blakeblackshear / frigate

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

Add docs for supporting HomeKit camera source via go2rtc #5321

Open NickM-27 opened 1 year ago

NickM-27 commented 1 year ago

Go2rtc supports the ability to pair HomeKit Secure Video (HKSV) cameras and use them as a source in the config. However, this includes a few caveats:

  1. There is metadata stored in a file which will need to be mapped to the users host so it is not forgotten on container restart
  2. The container will be required to run in host mode
  3. User will need to access the go2rtc frontend to enter the homekit pairing code
consolecwby commented 9 months ago

I have been trying to do this. Currently running both frigate and scrypted. I tried adding cameras through Home assistant but it was to buggy. Would like to add cameras from frigate/go2rtc to HomeKit directly.

NickM-27 commented 9 months ago

this can be done, it is just a bit of a manual process

larivierec commented 8 months ago

I've been trying to add this in so i can properly stream to Home.app

  1. add frigate stream + homekit sections -> https://github.com/larivierec/home-cluster/blob/45e8751e9ef31c2671ccc865023724bbb4caa5b9/kubernetes/apps/home/frigate/app/config/config.yml#L51-L64
  2. use go2rtc ui to add Homekit item? https://github.com/larivierec/home-cluster/commit/7970437796dbacaa736413b091327a65b53949aa#diff-3f4a9d117af608678e0997191e455422c3d25fd093c986448ad5846138f0a9bbR103-R115 (these are internal) and also not working it's throwing -> ERROR: tlv8: unmarshal zero data
  3. add pairing to /config/go2rtc.yaml ? obviously, once step 2 works.

am i missing something?

NickM-27 commented 8 months ago

add pairing to /config/go2rtc.yaml ? obviously, once step 2 works.

no, it should be added to the frigate config under the go2rtc section

halk1982 commented 6 months ago

Hello there, I'm facing the exact same issue. While I added the go2rtc config into the Frigate config file:

image

I'm having this error when trying to pair any camera from Go2RTC to Homekit directly:

image

My setup: HAOS on a Beelink (Intel N100 mini PC) and Frigate as an Home Assistant addon. Go2RTC not as an extra addon in HA, as it's embedded and used from Frigate.

unibeck commented 6 months ago

I get the same error ERROR: tlv8: unmarshal zero data. It appears that all of our IPs are from the docker bridge network, for example mine is 172.30.33.6, and not the host IP.

As NickM mentioned in his OP, we need to run frigate with network_mode host. Though, at least for the home assistant addon, I don't see an option to run with network_mode host.

unibeck commented 6 months ago

^I confirmed this by manually editing the HA addon to use the host network instead. The IP on the web UI now shows the host IP and I can add the camera to HomeKit.

@NickM-27 can we add support to the HA addon for the host network? I don't see a GH issue for it, though I can create on if this is something this repo wants to support. I wouldn't mind taking a stab at it either if given some direction.

NickM-27 commented 6 months ago

frigate uses a lot of ports internally, running as host will require all of those ports to be open (ports are not configurable in host mode) or frigate will conflict with other services for users, causing problems.

At this point the addon not support host mode is on purpose and expected

unibeck commented 6 months ago

Understood. Are there any other options for this use case?

NickM-27 commented 6 months ago

not running in an addon, or spinning up your own addon

halk1982 commented 6 months ago

Thank you very much for your responses @NickM-27 . It looks like a dead end then, at least for my skills set. @unibeck I was thinking to install Scrypted HA Addon and then use the Rebroadcast address to go2rtc, which will continue feeding Frigate for object detection etc. The only challenge with this way is that then I need to use mqtt object detection from Frigate to Scrypted (not sure how complex that can be). Do you think this setup is an overkill ? Right now I used the Generic camera HA integration (with go2rtc links) and notifications in Homekit are missing. If I use what Frigate integration is offering as cameras, live view doesn't work (check issue: https://github.com/blakeblackshear/frigate-hass-integration/issues/402 ). Any ideas/suggestions are more than welcome.

unibeck commented 6 months ago

I don't know about all that, it does seem overkill though.

I previously used Scrypted to get my cameras into HomeKit, which worked alright. Notifications in HomeKit worked fine, though I never implemented my cameras into HA. So sorry, I can't help with that.

I am trying go2rtc and frigate now for better performance and custom AI model support.

halk1982 commented 6 months ago

I don't know about all that, it does seem overkill though.

I previously used Scrypted to get my cameras into HomeKit, which worked alright. Notifications in HomeKit worked fine, though I never implemented my cameras into HA. So sorry, I can't help with that.

I am trying go2rtc and frigate now for better performance and custom AI model support.

Thank you @unibeck

piscinas commented 5 months ago

I have successfully install my cameras on HomeKit. I copied the config code that has paired data to the frigate config. It is possible to add some dummy sensor that it was activated by the detection of camera, that can be passed to HomeKit as a motion sensor? Don’t need to be passed to homeassistant… something that generate the Homeassistant notification will activate that sensor…