From f6aaf8e36f88566459f96de04a099f39a969587f Mon Sep 17 00:00:00 2001
From: blakeblackshear
Date: Sun, 5 Sep 2021 16:15:33 +0000
Subject: [PATCH] deploy: d35b09b18fb2fa5c9945f965fde9668e16e78c84
---
064d4f6f.79105b8c.js | 1 -
064d4f6f.b39936e3.js | 1 +
404.html | 4 ++--
configuration/advanced/index.html | 4 ++--
configuration/cameras/index.html | 4 ++--
configuration/detectors/index.html | 4 ++--
configuration/false_positives/index.html | 4 ++--
configuration/index/index.html | 4 ++--
configuration/nvdec/index.html | 4 ++--
configuration/objects/index.html | 4 ++--
configuration/optimizing/index.html | 4 ++--
contributing/index.html | 4 ++--
hardware/index.html | 4 ++--
how-it-works/index.html | 4 ++--
index.html | 4 ++--
installation/index.html | 4 ++--
mdx/index.html | 4 ++--
...in.35eb7541.js => runtime~main.85a22073.js | 2 +-
search/index.html | 4 ++--
troubleshooting/index.html | 4 ++--
usage/api/index.html | 4 ++--
usage/home-assistant/index.html | 19 ++++++++++++-------
usage/howtos/index.html | 4 ++--
usage/mqtt/index.html | 4 ++--
usage/web/index.html | 4 ++--
25 files changed, 56 insertions(+), 51 deletions(-)
delete mode 100644 064d4f6f.79105b8c.js
create mode 100644 064d4f6f.b39936e3.js
rename runtime~main.35eb7541.js => runtime~main.85a22073.js (98%)
diff --git a/064d4f6f.79105b8c.js b/064d4f6f.79105b8c.js
deleted file mode 100644
index fa91461b8..000000000
--- a/064d4f6f.79105b8c.js
+++ /dev/null
@@ -1 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{64:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return o})),a.d(t,"metadata",(function(){return s})),a.d(t,"toc",(function(){return l})),a.d(t,"default",(function(){return b}));var n=a(3),i=a(7),r=(a(0),a(99)),o={id:"home-assistant",title:"Integration with Home Assistant",sidebar_label:"Home Assistant"},s={unversionedId:"usage/home-assistant",id:"usage/home-assistant",isDocsHomePage:!1,title:"Integration with Home Assistant",description:"The best way to integrate with Home Assistant is to use the official integration.",source:"@site/docs/usage/home-assistant.md",slug:"/usage/home-assistant",permalink:"/frigate/usage/home-assistant",editUrl:"https://github.com/blakeblackshear/frigate/edit/master/docs/docs/usage/home-assistant.md",version:"current",sidebar_label:"Home Assistant",sidebar:"docs",previous:{title:"Advanced",permalink:"/frigate/configuration/advanced"},next:{title:"Web Interface",permalink:"/frigate/usage/web"}},l=[{value:"Installation",id:"installation",children:[]},{value:"Configuration",id:"configuration",children:[]},{value:"Options",id:"options",children:[]},{value:"Entities Provided",id:"entities-provided",children:[]},{value:"Media Browser Support",id:"media-browser-support",children:[]},{value:"API",id:"api",children:[{value:"Notifications",id:"notifications",children:[]}]},{value:"RTMP stream",id:"rtmp-stream",children:[]},{value:"Multiple Instance Support",id:"multiple-instance-support",children:[{value:"Requirements for Multiple Instances",id:"requirements-for-multiple-instances",children:[]}]},{value:"FAQ",id:"faq",children:[{value:"If I am detecting multiple objects, how do I assign the correct binary_sensor to the camera in HomeKit?",id:"if-i-am-detecting-multiple-objects-how-do-i-assign-the-correct-binary_sensor-to-the-camera-in-homekit",children:[]}]}],c={toc:l};function b(e){var t=e.components,a=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(n.a)({},c,a,{components:t,mdxType:"MDXLayout"}),Object(r.b)("p",null,"The best way to integrate with Home Assistant is to use the ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://github.com/blakeblackshear/frigate-hass-integration"}),"official integration"),"."),Object(r.b)("h2",{id:"installation"},"Installation"),Object(r.b)("p",null,"Available via HACS as a ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://hacs.xyz/docs/faq/custom_repositories"}),"custom repository"),". To install:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Add the custom repository:")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"Home Assistant > HACS > Integrations > [...] > Custom Repositories\n")),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Key"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Value"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Repository URL"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("a",Object(n.a)({parentName:"td"},{href:"https://github.com/blakeblackshear/frigate-hass-integration"}),"https://github.com/blakeblackshear/frigate-hass-integration"))),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Category"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Integration")))),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Use ",Object(r.b)("a",Object(n.a)({parentName:"li"},{href:"https://hacs.xyz/"}),"HACS")," to install the integration:")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),'Home Assistant > HACS > Integrations > "Explore & Add Integrations" > Frigate\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Restart Home Assistant."),Object(r.b)("li",{parentName:"ul"},"Then add/configure the integration:")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"Home Assistant > Configuration > Integrations > Add Integration > Frigate\n")),Object(r.b)("p",null,"Note: You will also need\n",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.home-assistant.io/integrations/media_source/"}),"media_source")," enabled\nin your Home Assistant configuration for the Media Browser to appear."),Object(r.b)("h2",{id:"configuration"},"Configuration"),Object(r.b)("p",null,"When configuring the integration, you will be asked for the following parameters:"),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Variable"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"URL"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"The ",Object(r.b)("inlineCode",{parentName:"td"},"URL")," of your frigate instance, the URL you use to access Frigate in the browser. This may look like ",Object(r.b)("inlineCode",{parentName:"td"},"http://:5000/"),". If you are using HassOS with the addon, the URL should be ",Object(r.b)("inlineCode",{parentName:"td"},"http://ccab4aaf-frigate:5000")," (or ",Object(r.b)("inlineCode",{parentName:"td"},"http://ccab4aaf-frigate-beta:5000")," if your are using the beta version of the addon). Live streams required port 1935, see ",Object(r.b)("a",Object(n.a)({parentName:"td"},{href:"#streams"}),"RTMP streams"))))),Object(r.b)("a",{name:"options"}),Object(r.b)("h2",{id:"options"},"Options"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"Home Assistant > Configuration > Integrations > Frigate > Options\n")),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Option"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"RTMP URL Template"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"A ",Object(r.b)("a",Object(n.a)({parentName:"td"},{href:"https://jinja.palletsprojects.com/"}),"jinja2")," template that is used to override the standard RTMP stream URL (e.g. for use with reverse proxies). This option is only shown to users who have ",Object(r.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.home-assistant.io/blog/2019/07/17/release-96/#advanced-mode"}),"advanced mode")," enabled. See ",Object(r.b)("a",Object(n.a)({parentName:"td"},{href:"#streams"}),"RTMP streams")," below.")))),Object(r.b)("h2",{id:"entities-provided"},"Entities Provided"),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Platform"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("inlineCode",{parentName:"td"},"camera")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Live camera stream (requires RTMP), camera for image of the last detected object.")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("inlineCode",{parentName:"td"},"sensor")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"States to monitor Frigate performance, object counts for all zones and cameras.")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("inlineCode",{parentName:"td"},"switch")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Switch entities to toggle detection, clips and snapshots.")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("inlineCode",{parentName:"td"},"binary_sensor")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),'A "motion" binary sensor entity per camera/zone/object.')))),Object(r.b)("h2",{id:"media-browser-support"},"Media Browser Support"),Object(r.b)("p",null,"The integration provides:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Rich UI with thumbnails for browsing event clips"),Object(r.b)("li",{parentName:"ul"},"Rich UI for browsing 24/7 recordings by month, day, camera, time")),Object(r.b)("p",null,'This is accessible via "Media Browser" on the left menu panel in Home Assistant.'),Object(r.b)("a",{name:"api"}),Object(r.b)("h2",{id:"api"},"API"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Notification API with public facing endpoints for images in notifications")),Object(r.b)("h3",{id:"notifications"},"Notifications"),Object(r.b)("p",null,"Frigate publishes event information in the form of a change feed via MQTT. This\nallows lots of customization for notifications to meet your needs. Event changes\nare published with ",Object(r.b)("inlineCode",{parentName:"p"},"before")," and ",Object(r.b)("inlineCode",{parentName:"p"},"after")," information as shown\n",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"#frigateevents"}),"here"),". Note that some people may not want to expose frigate to\nthe web, so you can leverage the HA API that frigate custom_integration ties\ninto (which is exposed to the web, and thus can be used for mobile notifications\netc):"),Object(r.b)("p",null,"To load an image taken by frigate from Home Assistants API see below:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"https://HA_URL/api/frigate/notifications//thumbnail.jpg\n")),Object(r.b)("p",null,"To load a video clip taken by frigate from Home Assistants API :"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"https://HA_URL/api/frigate/notifications///clip.mp4\n")),Object(r.b)("p",null,'Here is a simple example of a notification automation of events which will update the existing notification for each change. This means the image you see in the notification will update as frigate finds a "better" image.'),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),'automation:\n - alias: Notify of events\n trigger:\n platform: mqtt\n topic: frigate/events\n action:\n - service: notify.mobile_app_pixel_3\n data_template:\n message: \'A {{trigger.payload_json["after"]["label"]}} was detected.\'\n data:\n image: \'https://your.public.hass.address.com/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg?format=android\'\n tag: \'{{trigger.payload_json["after"]["id"]}}\'\n when: \'{{trigger.payload_json["after"]["start_time"]|int}}\'\n')),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),"automation:\n - alias: When a person enters a zone named yard\n trigger:\n platform: mqtt\n topic: frigate/events\n condition:\n - \"{{ trigger.payload_json['after']['label'] == 'person' }}\"\n - \"{{ 'yard' in trigger.payload_json['after']['entered_zones'] }}\"\n action:\n - service: notify.mobile_app_pixel_3\n data_template:\n message: \"A {{trigger.payload_json['after']['label']}} has entered the yard.\"\n data:\n image: \"https://url.com/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/thumbnail.jpg\"\n tag: \"{{trigger.payload_json['after']['id']}}\"\n when: '{{trigger.payload_json[\"after\"][\"start_time\"]|int}}'\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),"- alias: When a person leaves a zone named yard\n trigger:\n platform: mqtt\n topic: frigate/events\n condition:\n - \"{{ trigger.payload_json['after']['label'] == 'person' }}\"\n - \"{{ 'yard' in trigger.payload_json['before']['current_zones'] }}\"\n - \"{{ not 'yard' in trigger.payload_json['after']['current_zones'] }}\"\n action:\n - service: notify.mobile_app_pixel_3\n data_template:\n message: \"A {{trigger.payload_json['after']['label']}} has left the yard.\"\n data:\n image: \"https://url.com/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/thumbnail.jpg\"\n tag: \"{{trigger.payload_json['after']['id']}}\"\n when: '{{trigger.payload_json[\"after\"][\"start_time\"]|int}}'\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),"- alias: Notify for dogs in the front with a high top score\n trigger:\n platform: mqtt\n topic: frigate/events\n condition:\n - \"{{ trigger.payload_json['after']['label'] == 'dog' }}\"\n - \"{{ trigger.payload_json['after']['camera'] == 'front' }}\"\n - \"{{ trigger.payload_json['after']['top_score'] > 0.98 }}\"\n action:\n - service: notify.mobile_app_pixel_3\n data_template:\n message: \"High confidence dog detection.\"\n data:\n image: \"https://url.com/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/thumbnail.jpg\"\n tag: \"{{trigger.payload_json['after']['id']}}\"\n when: '{{trigger.payload_json[\"after\"][\"start_time\"]|int}}'\n")),Object(r.b)("p",null,"If you are using telegram, you can fetch the image directly from Frigate:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),'automation:\n - alias: Notify of events\n trigger:\n platform: mqtt\n topic: frigate/events\n action:\n - service: notify.telegram_full\n data_template:\n message: \'A {{trigger.payload_json["after"]["label"]}} was detected.\'\n data:\n photo:\n # this url should work for addon users\n - url: \'http://ccab4aaf-frigate:5000/api/events/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg\'\n caption: \'A {{trigger.payload_json["after"]["label"]}} was detected on {{ trigger.payload_json["after"]["camera"] }} camera\'\n')),Object(r.b)("a",{name:"streams"}),Object(r.b)("h2",{id:"rtmp-stream"},"RTMP stream"),Object(r.b)("p",null,"In order for the live streams to function they need to be accessible on the RTMP\nport (default: ",Object(r.b)("inlineCode",{parentName:"p"},"1935"),") at ",Object(r.b)("inlineCode",{parentName:"p"},":1935"),". Home Assistant will directly\nconnect to that streaming port when the live camera is viewed."),Object(r.b)("h4",{id:"rtmp-url-template"},"RTMP URL Template"),Object(r.b)("p",null,"For advanced usecases, this behavior can be changed with the ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"#options"}),"RTMP URL\ntemplate")," option. When set, this string will override the default stream\naddress that is derived from the default behavior described above. This option supports\n",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://jinja.palletsprojects.com/"}),"jinja2 templates")," and has the ",Object(r.b)("inlineCode",{parentName:"p"},"camera")," dict\nvariables from ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://blakeblackshear.github.io/frigate/usage/api#apiconfig"}),"Frigate API"),"\navailable for the template. Note that no Home Assistant state is available to the\ntemplate, only the camera dict from Frigate."),Object(r.b)("p",null,"This is potentially useful when Frigate is behind a reverse proxy, and/or when\nthe default stream port is otherwise not accessible to Home Assistant (e.g.\nfirewall rules)."),Object(r.b)("h6",{id:"rtmp-url-template-examples"},"RTMP URL Template Examples"),Object(r.b)("p",null,"Use a different port number:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"rtmp://:2000/live/front_door\n")),Object(r.b)("p",null,"Use the camera name in the stream URL:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"rtmp://:2000/live/{{ name }}\n")),Object(r.b)("p",null,"Use the camera name in the stream URL, converting it to lowercase first:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"rtmp://:2000/live/{{ name|lower }}\n")),Object(r.b)("h2",{id:"multiple-instance-support"},"Multiple Instance Support"),Object(r.b)("p",null,"The Frigate integration seamlessly supports the use of multiple Frigate servers."),Object(r.b)("h3",{id:"requirements-for-multiple-instances"},"Requirements for Multiple Instances"),Object(r.b)("p",null,"In order for multiple Frigate instances to function correctly, the\n",Object(r.b)("inlineCode",{parentName:"p"},"topic_prefix")," and ",Object(r.b)("inlineCode",{parentName:"p"},"client_id")," parameters must be set differently per server.\nSee ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://blakeblackshear.github.io/frigate/configuration/index#mqtt"}),"MQTT\nconfiguration"),"\nfor how to set these."),Object(r.b)("h4",{id:"api-urls"},"API URLs"),Object(r.b)("p",null,"When multiple Frigate instances are configured, ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"#api"}),"API")," URLs should include an\nidentifier to tell Home Assistant which Frigate instance to refer to. The\nidentifier used is the MQTT ",Object(r.b)("inlineCode",{parentName:"p"},"client_id")," paremeter included in the configuration,\nand is used like so:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"https://HA_URL/api/frigate//notifications//thumbnail.jpg\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"https://HA_URL/api/frigate//clips/front_door-1624599978.427826-976jaa.mp4\n")),Object(r.b)("h4",{id:"default-treatment"},"Default Treatment"),Object(r.b)("p",null,"When a single Frigate instance is configured, the ",Object(r.b)("inlineCode",{parentName:"p"},"client-id")," parameter need not\nbe specified in URLs/identifiers -- that single instance is assumed. When\nmultiple Frigate instances are configured, the user ",Object(r.b)("strong",{parentName:"p"},"must")," explicitly specify\nwhich server they are referring to."),Object(r.b)("h2",{id:"faq"},"FAQ"),Object(r.b)("h3",{id:"if-i-am-detecting-multiple-objects-how-do-i-assign-the-correct-binary_sensor-to-the-camera-in-homekit"},"If I am detecting multiple objects, how do I assign the correct ",Object(r.b)("inlineCode",{parentName:"h3"},"binary_sensor")," to the camera in HomeKit?"),Object(r.b)("p",null,"The ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.home-assistant.io/integrations/homekit/"}),"HomeKit integration")," randomly links one of the binary sensors (motion sensor entities) grouped with the camera device in Home Assistant. You can specify a ",Object(r.b)("inlineCode",{parentName:"p"},"linked_motion_sensor")," in the Home Assistant ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.home-assistant.io/integrations/homekit/#linked_motion_sensor"}),"HomeKit configuration")," for each camera."))}b.isMDXComponent=!0},99:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return u}));var n=a(0),i=a.n(n);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function s(e){for(var t=1;t=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var c=i.a.createContext({}),b=function(e){var t=i.a.useContext(c),a=t;return e&&(a="function"==typeof e?e(t):s(s({},t),e)),a},p=function(e){var t=b(e.components);return i.a.createElement(c.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=i.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,r=e.originalType,o=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),p=b(a),d=n,u=p["".concat(o,".").concat(d)]||p[d]||m[d]||r;return a?i.a.createElement(u,s(s({ref:t},c),{},{components:a})):i.a.createElement(u,s({ref:t},c))}));function u(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=a.length,o=new Array(r);o[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:n,o[1]=s;for(var c=2;cbinary_sensor to the camera in HomeKit?",id:"if-i-am-detecting-multiple-objects-how-do-i-assign-the-correct-binary_sensor-to-the-camera-in-homekit",children:[]}]}],c={toc:l};function b(e){var t=e.components,a=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(n.a)({},c,a,{components:t,mdxType:"MDXLayout"}),Object(r.b)("p",null,"The best way to integrate with Home Assistant is to use the ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://github.com/blakeblackshear/frigate-hass-integration"}),"official integration"),"."),Object(r.b)("h2",{id:"installation"},"Installation"),Object(r.b)("h3",{id:"preparation"},"Preparation"),Object(r.b)("p",null,"The Frigate integration requires the ",Object(r.b)("inlineCode",{parentName:"p"},"mqtt")," integration to be installed and\nmanually configured first."),Object(r.b)("p",null,"See the ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.home-assistant.io/integrations/mqtt/"}),"MQTT integration\ndocumentation")," for more\ndetails."),Object(r.b)("h3",{id:"integration-installation"},"Integration installation"),Object(r.b)("p",null,"Available via HACS as a default repository. To install:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Use ",Object(r.b)("a",Object(n.a)({parentName:"li"},{href:"https://hacs.xyz/"}),"HACS")," to install the integration:")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),'Home Assistant > HACS > Integrations > "Explore & Add Integrations" > Frigate\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Restart Home Assistant."),Object(r.b)("li",{parentName:"ul"},"Then add/configure the integration:")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"Home Assistant > Configuration > Integrations > Add Integration > Frigate\n")),Object(r.b)("p",null,"Note: You will also need\n",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.home-assistant.io/integrations/media_source/"}),"media_source")," enabled\nin your Home Assistant configuration for the Media Browser to appear."),Object(r.b)("h3",{id:"optional-lovelace-card-installation"},"(Optional) Lovelace Card Installation"),Object(r.b)("p",null,"To install the optional companion Lovelace card, please see the ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://github.com/dermotduffy/frigate-hass-card"}),"separate\ninstallation instructions")," for\nthat card."),Object(r.b)("h2",{id:"configuration"},"Configuration"),Object(r.b)("p",null,"When configuring the integration, you will be asked for the following parameters:"),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Variable"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"URL"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"The ",Object(r.b)("inlineCode",{parentName:"td"},"URL")," of your frigate instance, the URL you use to access Frigate in the browser. This may look like ",Object(r.b)("inlineCode",{parentName:"td"},"http://:5000/"),". If you are using HassOS with the addon, the URL should be ",Object(r.b)("inlineCode",{parentName:"td"},"http://ccab4aaf-frigate:5000")," (or ",Object(r.b)("inlineCode",{parentName:"td"},"http://ccab4aaf-frigate-beta:5000")," if your are using the beta version of the addon). Live streams required port 1935, see ",Object(r.b)("a",Object(n.a)({parentName:"td"},{href:"#streams"}),"RTMP streams"))))),Object(r.b)("a",{name:"options"}),Object(r.b)("h2",{id:"options"},"Options"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"Home Assistant > Configuration > Integrations > Frigate > Options\n")),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Option"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"RTMP URL Template"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"A ",Object(r.b)("a",Object(n.a)({parentName:"td"},{href:"https://jinja.palletsprojects.com/"}),"jinja2")," template that is used to override the standard RTMP stream URL (e.g. for use with reverse proxies). This option is only shown to users who have ",Object(r.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.home-assistant.io/blog/2019/07/17/release-96/#advanced-mode"}),"advanced mode")," enabled. See ",Object(r.b)("a",Object(n.a)({parentName:"td"},{href:"#streams"}),"RTMP streams")," below.")))),Object(r.b)("h2",{id:"entities-provided"},"Entities Provided"),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Platform"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("inlineCode",{parentName:"td"},"camera")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Live camera stream (requires RTMP), camera for image of the last detected object.")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("inlineCode",{parentName:"td"},"sensor")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"States to monitor Frigate performance, object counts for all zones and cameras.")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("inlineCode",{parentName:"td"},"switch")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Switch entities to toggle detection, clips and snapshots.")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("inlineCode",{parentName:"td"},"binary_sensor")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),'A "motion" binary sensor entity per camera/zone/object.')))),Object(r.b)("h2",{id:"media-browser-support"},"Media Browser Support"),Object(r.b)("p",null,"The integration provides:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Rich UI with thumbnails for browsing event clips"),Object(r.b)("li",{parentName:"ul"},"Rich UI for browsing 24/7 recordings by month, day, camera, time")),Object(r.b)("p",null,'This is accessible via "Media Browser" on the left menu panel in Home Assistant.'),Object(r.b)("a",{name:"api"}),Object(r.b)("h2",{id:"api"},"API"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Notification API with public facing endpoints for images in notifications")),Object(r.b)("h3",{id:"notifications"},"Notifications"),Object(r.b)("p",null,"Frigate publishes event information in the form of a change feed via MQTT. This\nallows lots of customization for notifications to meet your needs. Event changes\nare published with ",Object(r.b)("inlineCode",{parentName:"p"},"before")," and ",Object(r.b)("inlineCode",{parentName:"p"},"after")," information as shown\n",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"#frigateevents"}),"here"),". Note that some people may not want to expose frigate to\nthe web, so you can leverage the HA API that frigate custom_integration ties\ninto (which is exposed to the web, and thus can be used for mobile notifications\netc):"),Object(r.b)("p",null,"To load an image taken by frigate from Home Assistants API see below:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"https://HA_URL/api/frigate/notifications//thumbnail.jpg\n")),Object(r.b)("p",null,"To load a video clip taken by frigate from Home Assistants API :"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"https://HA_URL/api/frigate/notifications///clip.mp4\n")),Object(r.b)("p",null,'Here is a simple example of a notification automation of events which will update the existing notification for each change. This means the image you see in the notification will update as frigate finds a "better" image.'),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),'automation:\n - alias: Notify of events\n trigger:\n platform: mqtt\n topic: frigate/events\n action:\n - service: notify.mobile_app_pixel_3\n data_template:\n message: \'A {{trigger.payload_json["after"]["label"]}} was detected.\'\n data:\n image: \'https://your.public.hass.address.com/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg?format=android\'\n tag: \'{{trigger.payload_json["after"]["id"]}}\'\n when: \'{{trigger.payload_json["after"]["start_time"]|int}}\'\n')),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),"automation:\n - alias: When a person enters a zone named yard\n trigger:\n platform: mqtt\n topic: frigate/events\n condition:\n - \"{{ trigger.payload_json['after']['label'] == 'person' }}\"\n - \"{{ 'yard' in trigger.payload_json['after']['entered_zones'] }}\"\n action:\n - service: notify.mobile_app_pixel_3\n data_template:\n message: \"A {{trigger.payload_json['after']['label']}} has entered the yard.\"\n data:\n image: \"https://url.com/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/thumbnail.jpg\"\n tag: \"{{trigger.payload_json['after']['id']}}\"\n when: '{{trigger.payload_json[\"after\"][\"start_time\"]|int}}'\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),"- alias: When a person leaves a zone named yard\n trigger:\n platform: mqtt\n topic: frigate/events\n condition:\n - \"{{ trigger.payload_json['after']['label'] == 'person' }}\"\n - \"{{ 'yard' in trigger.payload_json['before']['current_zones'] }}\"\n - \"{{ not 'yard' in trigger.payload_json['after']['current_zones'] }}\"\n action:\n - service: notify.mobile_app_pixel_3\n data_template:\n message: \"A {{trigger.payload_json['after']['label']}} has left the yard.\"\n data:\n image: \"https://url.com/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/thumbnail.jpg\"\n tag: \"{{trigger.payload_json['after']['id']}}\"\n when: '{{trigger.payload_json[\"after\"][\"start_time\"]|int}}'\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),"- alias: Notify for dogs in the front with a high top score\n trigger:\n platform: mqtt\n topic: frigate/events\n condition:\n - \"{{ trigger.payload_json['after']['label'] == 'dog' }}\"\n - \"{{ trigger.payload_json['after']['camera'] == 'front' }}\"\n - \"{{ trigger.payload_json['after']['top_score'] > 0.98 }}\"\n action:\n - service: notify.mobile_app_pixel_3\n data_template:\n message: \"High confidence dog detection.\"\n data:\n image: \"https://url.com/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/thumbnail.jpg\"\n tag: \"{{trigger.payload_json['after']['id']}}\"\n when: '{{trigger.payload_json[\"after\"][\"start_time\"]|int}}'\n")),Object(r.b)("p",null,"If you are using telegram, you can fetch the image directly from Frigate:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),'automation:\n - alias: Notify of events\n trigger:\n platform: mqtt\n topic: frigate/events\n action:\n - service: notify.telegram_full\n data_template:\n message: \'A {{trigger.payload_json["after"]["label"]}} was detected.\'\n data:\n photo:\n # this url should work for addon users\n - url: \'http://ccab4aaf-frigate:5000/api/events/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg\'\n caption: \'A {{trigger.payload_json["after"]["label"]}} was detected on {{ trigger.payload_json["after"]["camera"] }} camera\'\n')),Object(r.b)("a",{name:"streams"}),Object(r.b)("h2",{id:"rtmp-stream"},"RTMP stream"),Object(r.b)("p",null,"In order for the live streams to function they need to be accessible on the RTMP\nport (default: ",Object(r.b)("inlineCode",{parentName:"p"},"1935"),") at ",Object(r.b)("inlineCode",{parentName:"p"},":1935"),". Home Assistant will directly\nconnect to that streaming port when the live camera is viewed."),Object(r.b)("h4",{id:"rtmp-url-template"},"RTMP URL Template"),Object(r.b)("p",null,"For advanced usecases, this behavior can be changed with the ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"#options"}),"RTMP URL\ntemplate")," option. When set, this string will override the default stream\naddress that is derived from the default behavior described above. This option supports\n",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://jinja.palletsprojects.com/"}),"jinja2 templates")," and has the ",Object(r.b)("inlineCode",{parentName:"p"},"camera")," dict\nvariables from ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://blakeblackshear.github.io/frigate/usage/api#apiconfig"}),"Frigate API"),"\navailable for the template. Note that no Home Assistant state is available to the\ntemplate, only the camera dict from Frigate."),Object(r.b)("p",null,"This is potentially useful when Frigate is behind a reverse proxy, and/or when\nthe default stream port is otherwise not accessible to Home Assistant (e.g.\nfirewall rules)."),Object(r.b)("h6",{id:"rtmp-url-template-examples"},"RTMP URL Template Examples"),Object(r.b)("p",null,"Use a different port number:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"rtmp://:2000/live/front_door\n")),Object(r.b)("p",null,"Use the camera name in the stream URL:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"rtmp://:2000/live/{{ name }}\n")),Object(r.b)("p",null,"Use the camera name in the stream URL, converting it to lowercase first:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"rtmp://:2000/live/{{ name|lower }}\n")),Object(r.b)("h2",{id:"multiple-instance-support"},"Multiple Instance Support"),Object(r.b)("p",null,"The Frigate integration seamlessly supports the use of multiple Frigate servers."),Object(r.b)("h3",{id:"requirements-for-multiple-instances"},"Requirements for Multiple Instances"),Object(r.b)("p",null,"In order for multiple Frigate instances to function correctly, the\n",Object(r.b)("inlineCode",{parentName:"p"},"topic_prefix")," and ",Object(r.b)("inlineCode",{parentName:"p"},"client_id")," parameters must be set differently per server.\nSee ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://blakeblackshear.github.io/frigate/configuration/index#mqtt"}),"MQTT\nconfiguration"),"\nfor how to set these."),Object(r.b)("h4",{id:"api-urls"},"API URLs"),Object(r.b)("p",null,"When multiple Frigate instances are configured, ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"#api"}),"API")," URLs should include an\nidentifier to tell Home Assistant which Frigate instance to refer to. The\nidentifier used is the MQTT ",Object(r.b)("inlineCode",{parentName:"p"},"client_id")," paremeter included in the configuration,\nand is used like so:"),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"https://HA_URL/api/frigate//notifications//thumbnail.jpg\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(n.a)({parentName:"pre"},{}),"https://HA_URL/api/frigate//clips/front_door-1624599978.427826-976jaa.mp4\n")),Object(r.b)("h4",{id:"default-treatment"},"Default Treatment"),Object(r.b)("p",null,"When a single Frigate instance is configured, the ",Object(r.b)("inlineCode",{parentName:"p"},"client-id")," parameter need not\nbe specified in URLs/identifiers -- that single instance is assumed. When\nmultiple Frigate instances are configured, the user ",Object(r.b)("strong",{parentName:"p"},"must")," explicitly specify\nwhich server they are referring to."),Object(r.b)("h2",{id:"faq"},"FAQ"),Object(r.b)("h3",{id:"if-i-am-detecting-multiple-objects-how-do-i-assign-the-correct-binary_sensor-to-the-camera-in-homekit"},"If I am detecting multiple objects, how do I assign the correct ",Object(r.b)("inlineCode",{parentName:"h3"},"binary_sensor")," to the camera in HomeKit?"),Object(r.b)("p",null,"The ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.home-assistant.io/integrations/homekit/"}),"HomeKit integration")," randomly links one of the binary sensors (motion sensor entities) grouped with the camera device in Home Assistant. You can specify a ",Object(r.b)("inlineCode",{parentName:"p"},"linked_motion_sensor")," in the Home Assistant ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.home-assistant.io/integrations/homekit/#linked_motion_sensor"}),"HomeKit configuration")," for each camera."))}b.isMDXComponent=!0},99:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return u}));var n=a(0),i=a.n(n);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function s(e){for(var t=1;t=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var c=i.a.createContext({}),b=function(e){var t=i.a.useContext(c),a=t;return e&&(a="function"==typeof e?e(t):s(s({},t),e)),a},p=function(e){var t=b(e.components);return i.a.createElement(c.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},m=i.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,r=e.originalType,o=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),p=b(a),m=n,u=p["".concat(o,".").concat(m)]||p[m]||d[m]||r;return a?i.a.createElement(u,s(s({ref:t},c),{},{components:a})):i.a.createElement(u,s({ref:t},c))}));function u(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=a.length,o=new Array(r);o[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:n,o[1]=s;for(var c=2;cPage Not Found | Frigate
-
+
@@ -20,7 +20,7 @@
Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
Event and clip information is managed in a sqlite database at /media/frigate/clips/frigate.db. If that database is deleted, clips will be orphaned and will need to be cleaned up manually. They also won't show up in the Media Browser within Home Assistant.
If you are storing your clips on a network share (SMB, NFS, etc), you may get a database is locked error message on startup. You can customize the location of the database in the config if necessary.
This may need to be in a custom location if network storage is used for clips.
The input and output parameters need to be adjusted for MJPEG cameras
input_args:
--avoid_negative_ts
- make_zero
--fflags
- nobuffer
--flags
- low_delay
--strict
- experimental
--fflags
- +genpts+discardcorrupt
--r
-"3"# <---- adjust depending on your desired frame rate from the mjpeg image
--use_wallclock_as_timestamps
-"1"
Note that mjpeg cameras require encoding the video into h264 for clips, recording, and rtmp roles. This will use significantly more CPU than if the cameras supported h264 feeds directly.
The default config will look for a USB Coral device. If you do not have a Coral, you will need to configure a CPU detector. If you have PCI or multiple Coral devices, you need to configure your detector devices in the config file. When using multiple detectors, they run in dedicated processes, but pull from a common queue of requested detections across all cameras.
Tune your object filters to adjust false positives: min_area, max_area, min_score, threshold.
For object filters in your configuration, any single detection below min_score will be ignored as a false positive. threshold is based on the median of the history of scores (padded to 3 values) for a tracked object. Consider the following frames when min_score is set to 0.6 and threshold is set to 0.85:
Frame
Current Score
Score History
Computed Score
Detected Object
1
0.7
0.0, 0, 0.7
0.0
No
2
0.55
0.0, 0.7, 0.0
0.0
No
3
0.85
0.7, 0.0, 0.85
0.7
No
4
0.90
0.7, 0.85, 0.95, 0.90
0.875
Yes
5
0.88
0.7, 0.85, 0.95, 0.90, 0.88
0.88
Yes
6
0.95
0.7, 0.85, 0.95, 0.90, 0.88, 0.95
0.89
Yes
In frame 2, the score is below the min_score value, so frigate ignores it and it becomes a 0.0. The computed score is the median of the score history (padding to at least 3 values), and only when that computed score crosses the threshold is the object marked as a true positive. That happens in frame 4 in the example.
For HassOS installations, the default location for the config file is /config/frigate.yml.
For all other installations, the default location for the config file is '/config/config.yml'. This can be overridden with the CONFIG_FILE environment variable. Camera specific ffmpeg parameters are documented here.
It is recommended to start with a minimal configuration and add to it:
Each of your cameras must be configured. The following is the minimum required to register a camera in Frigate. Check the camera configuration page for a complete list of options.
Can be overridden at the camera level. 24/7 recordings can be enabled and are stored at /media/frigate/recordings. The folder structure for the recordings is YYYY-MM/DD/HH/<camera_name>/MM.SS.mp4. These recordings are written directly from your camera stream without re-encoding and are available in Home Assistant's media browser. Each camera supports a configurable retention policy in the config.
caution
Previous versions of frigate included -vsync drop in input parameters. This is not compatible with FFmpeg's segment feature and must be removed from your input parameters if you have overrides set.
This setting, for example, allows Frigate to consume my 10-15fps camera streams on
my relatively low powered Haswell machine with relatively low cpu usage.
The labelmap can be customized to your needs. A common reason to do this is to combine multiple object types that are easily confused when you don't need to be as granular such as car/truck. You must retain the same number of labels, but you can change the names. To change:
-
+
diff --git a/configuration/optimizing/index.html b/configuration/optimizing/index.html
index 4e468e5ef..32becff3c 100644
--- a/configuration/optimizing/index.html
+++ b/configuration/optimizing/index.html
@@ -8,7 +8,7 @@
Optimizing performance | Frigate
-
+
@@ -26,7 +26,7 @@ Ensure you increase the allocated RAM for your GPU to at least 128 (raspi-config
NOTICE: If you are using the addon, ensure you turn off Protection mode for hardware acceleration.
AMD/ATI GPUs (Radeon HD 2000 and newer GPUs) via libva-mesa-driver (https://trac.ffmpeg.org/wiki/Hardware/QuickSync)
Note: You also need to set LIBVA_DRIVER_NAME=radeonsi as an environment variable on the container.
ffmpeg:
hwaccel_args:
--hwaccel
- vaapi
--hwaccel_device
- /dev/dri/renderD128
Nvidia GPU based decoding via NVDEC is supported, but requires special configuration. See the nvidia NVDEC documentation for more details.
This repository holds the Home Assistant Addon, for use with Home Assistant OS and compatible installations. It is the piece that allows you to run Frigate from your Home Assistant Supervisor tab.
This repository holds the custom integration that allows your Home Assistant installation to automatically create entities for your Frigate instance, whether you run that with the addon or in a separate Docker instance.
The Web UI requires an instance of Frigate to interact with for all of its data. You can either run an instance locally (recommended) or attach to a separate instance accessible on your network.
To run the local instance, follow the core development instructions.
If you won't be making any changes to the Frigate HTTP API, you can attach the web development server to any Frigate instance on your network. Skip this step and go to 3a.
3a. Run the development server against a non-local instance#
To run the development server against a non-local instance, you will need to provide an environment variable, SNOWPACK_PUBLIC_API_HOST that tells the web application how to connect to the Frigate API:
cd web && SNOWPACK_PUBLIC_API_HOST=http://<ip-address-to-your-frigate-instance>:5000 npm run start
Ensure lint passes. This command will ensure basic conformance to styles, applying as many automatic fixes as possible, including Prettier formatting.
npm run lint
Add to unit tests and ensure they pass. As much as possible, you should strive to increase test coverage whenever making changes. This will help ensure features do not accidentally become broken in the future.
npm run test
Test in different browsers. Firefox, Chrome, and Safari all have different quirks that make them unique targets to interact with.
Cameras that output H.264 video and AAC audio will offer the most compatibility with all features of Frigate and Home Assistant. It is also helpful if your camera supports multiple substreams to allow different resolutions to be used for detection, streaming, clips, and recordings without re-encoding.
Many people have powerful enough NAS devices or home servers to also run docker. There is a Unraid Community App.
To install make sure you have the community app plugin here. Then search for "Frigate" in the apps section within Unraid - you can see the online store here
A complete and local NVR designed for Home Assistant with AI object detection. Uses OpenCV and Tensorflow to perform realtime object detection locally for IP cameras.
Use of a Google Coral Accelerator is optional, but highly recommended. The Coral will outperform even the best CPUs and can process 100+ FPS with very little overhead.
Frigate is a Docker container that can be run on any Docker host including as a HassOS Addon. See instructions below for installing the HassOS addon.
For Home Assistant users, there is also a custom component (aka integration). This custom component adds tighter integration with Home Assistant by automatically setting up camera entities, sensors, media browser for clips and recordings, and a public API to simplify notifications.
Note that HassOS Addons and custom components are different things. If you are already running Frigate with Docker directly, you do not need the Addon since the Addon would run another instance of Frigate.
The default shm-size of 64m is fine for setups with 3 or less 1080p cameras. If frigate is exiting with "Bus error" messages, it could be because you have too many high resolution cameras and you need to specify a higher shm size.
You can calculate the necessary shm-size for each camera with the following formula:
The shm size cannot be set per container for Home Assistant Addons. You must set default-shm-size in /etc/docker/daemon.json to increase the default shm size. This will increase the shm size for all of your docker containers. This may or may not cause issues with your setup. https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file
For ideal performance, Frigate needs access to underlying hardware for the Coral and GPU devices for ffmpeg decoding. Running Frigate in a VM on top of Proxmox, ESXi, Virtualbox, etc. is not recommended. The virtualization layer typically introduces a sizable amount of overhead for communication with Coral devices.
How can I get sound or audio in my clips and recordings?#
By default, Frigate removes audio from clips and recordings to reduce the likelihood of failing for invalid data. If you would like to include audio, you need to override the output args to remove -an for where you want to include audio. The recommended audio codec is aac. Not all audio codecs are supported by RTMP, so you may need to re-encode your audio with -c:a aac. The default ffmpeg args are shown here.
My mjpeg stream or snapshots look green and crazy#
This almost always means that the width/height defined for your camera are not correct. Double check the resolution with vlc or another player. Also make sure you don't have the width and height values backwards.
I have clips and snapshots in my clips folder, but I can't view them in the Web UI.#
This is usually caused one of two things:
The permissions on the parent folder don't have execute and nginx returns a 403 error you can see in the browser logs
In this case, try mounting a volume to /media/frigate inside the container instead of /media/frigate/clips.
Your cameras do not send h264 encoded video and the mp4 files are not playable in the browser
"[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5639eeb6e140] moov atom not found"#
These messages in the logs are expected in certain situations. Frigate checks the integrity of the video cache before assembling clips. Occasionally these cached files will be invalid and cleaned up automatically.
If you see repeated "On connect called" messages in your config, check for another instance of frigate. This happens when multiple frigate containers are trying to connect to mqtt with the same client_id.
An mjpeg stream for debugging. Keep in mind the mjpeg endpoint is for debugging only and will put additional load on the system when in use.
Accepts the following query string parameters:
param
Type
Description
fps
int
Frame rate
h
int
Height in pixels
bbox
int
Show bounding boxes for detected objects (0 or 1)
timestamp
int
Print the timestamp in the upper left (0 or 1)
zones
int
Draw the zones on the image (0 or 1)
mask
int
Overlay the mask on the image (0 or 1)
motion
int
Draw blue boxes for areas with detected motion (0 or 1)
regions
int
Draw green boxes for areas where object detection was run (0 or 1)
You can access a higher resolution mjpeg stream by appending h=height-in-pixels to the endpoint. For example http://localhost:5000/api/back?h=1080. You can also increase the FPS by appending fps=frame-rate to the URL such as http://localhost:5000/api/back?fps=10 or both with ?fps=10&h=1000.
Returns a thumbnail for the event id optimized for notifications. Works while the event is in progress and after completion. Passing ?format=android will convert the thumbnail to 2:1 aspect ratio.
Returns the snapshot image for the event id. Works while the event is in progress and after completion.
Accepts the following query string parameters, but they are only applied when an event is in progress. After the event is completed, the saved snapshot is returned from disk without modification:
When configuring the integration, you will be asked for the following parameters:
Variable
Description
URL
The URL of your frigate instance, the URL you use to access Frigate in the browser. This may look like http://<host>:5000/. If you are using HassOS with the addon, the URL should be http://ccab4aaf-frigate:5000 (or http://ccab4aaf-frigate-beta:5000 if your are using the beta version of the addon). Live streams required port 1935, see RTMP streams
Home Assistant > Configuration > Integrations > Frigate > Options
Option
Description
RTMP URL Template
A jinja2 template that is used to override the standard RTMP stream URL (e.g. for use with reverse proxies). This option is only shown to users who have advanced mode enabled. See RTMP streams below.
When configuring the integration, you will be asked for the following parameters:
Variable
Description
URL
The URL of your frigate instance, the URL you use to access Frigate in the browser. This may look like http://<host>:5000/. If you are using HassOS with the addon, the URL should be http://ccab4aaf-frigate:5000 (or http://ccab4aaf-frigate-beta:5000 if your are using the beta version of the addon). Live streams required port 1935, see RTMP streams
Home Assistant > Configuration > Integrations > Frigate > Options
Option
Description
RTMP URL Template
A jinja2 template that is used to override the standard RTMP stream URL (e.g. for use with reverse proxies). This option is only shown to users who have advanced mode enabled. See RTMP streams below.
Frigate publishes event information in the form of a change feed via MQTT. This
allows lots of customization for notifications to meet your needs. Event changes
are published with before and after information as shown
here. Note that some people may not want to expose frigate to
@@ -48,9 +53,9 @@ identifier used is the MQTT client_id paremeter included in the con
and is used like so:
When a single Frigate instance is configured, the client-id parameter need not
be specified in URLs/identifiers -- that single instance is assumed. When
multiple Frigate instances are configured, the user must explicitly specify
-which server they are referring to.
If I am detecting multiple objects, how do I assign the correct binary_sensor to the camera in HomeKit?#
The HomeKit integration randomly links one of the binary sensors (motion sensor entities) grouped with the camera device in Home Assistant. You can specify a linked_motion_sensor in the Home Assistant HomeKit configuration for each camera.
If I am detecting multiple objects, how do I assign the correct binary_sensor to the camera in HomeKit?#
The HomeKit integration randomly links one of the binary sensors (motion sensor entities) grouped with the camera device in Home Assistant. You can specify a linked_motion_sensor in the Home Assistant HomeKit configuration for each camera.