Frigate works with any source that ffmpeg accepts as an input. If you can get your DIY cameras to send raw yuv420p frames, then you could even avoid the overhead to decode the jpeg data.
Hello people, helllo @blakeblackshear
since I upgraded my supervisor to latest version: supervisor-2021.02.0 I cannot save any configuration . It gets empty right after starting the addon.
Get this in logs:
21-02-02 13:26:50 WARNING (MainThread) [supervisor.addons.options] Unknown options detectors
21-02-02 13:26:50 WARNING (MainThread) [supervisor.addons.options] Unknown options mqtt
21-02-02 13:26:50 WARNING (MainThread) [supervisor.addons.options] Unknown options ffmpeg
21-02-02 13:26:50 WARNING (MainThread) [supervisor.addons.options] Unknown options cameras
21-02-02 13:26:55 WARNING (MainThread) [supervisor.addons.options] Unknown options detectors
21-02-02 13:26:55 WARNING (MainThread) [supervisor.addons.options] Unknown options mqtt
21-02-02 13:26:55 WARNING (MainThread) [supervisor.addons.options] Unknown options ffmpeg
21-02-02 13:26:55 WARNING (MainThread) [supervisor.addons.options] Unknown options cameras
21-02-02 13:26:55 WARNING (MainThread) [supervisor.addons.options] Unknown options detectors
21-02-02 13:26:55 WARNING (MainThread) [supervisor.addons.options] Unknown options mqtt
21-02-02 13:26:55 WARNING (MainThread) [supervisor.addons.options] Unknown options ffmpeg
21-02-02 13:26:55 WARNING (MainThread) [supervisor.addons.options] Unknown options cameras
very strange but also manually putting my confg parameters as json format manually into options.json wonāt work
I have this in chrome console:
:8123/api/hassio/addons/ccab4aaf_frigate-beta/options:1 Failed to load resource: the server responded with a status of 400 (Bad Request)```
And this:
chunk.97b95a62afbc18471344.js:3350 Uncaught (in promise) TypeError: Cannot read property 'find' of null
at HTMLElement.value (chunk.97b95a62afbc18471344.js:3350)
at HTMLElement.performUpdate (entrypoint.cf81f6d9.js:35547)
at HTMLElement._enqueueUpdate (entrypoint.cf81f6d9.js:35547)
Coral USB is hard to get nowdays. Is there a way a coral dev board can be utilised?
usinf pcie on an intel nuc works goood What computer are u using Intel nuc?
Shows āin stockā:
Just a thoughtā¦
Is it possible to get a notification with url to the recorded clip instead of the image?
Would be great if we could utilize notifications with actionsā¦
First, @blakeblackshear - what a fantastic solution. Thank you for making this.
I had been using DOODS before which has also been excellent. This however does a few additional things for me,
- it provides a consistent solution for any camera, where before I had a mix of camera IVS and DOODS, and different cameras have different quirks.
- simplifies my network setup, instead of routing the cameras from one vlan to another, I can use this to bridge, or just a single route.
Pretty excited.
my learning experience so far is:
donāt use the beta integration in home assistant, the beta has a version of 1.8, the non-beta has a version of 1.6. However if you look in the release notes you will find that 1.6 includes 0.8.1, where as 1.8 beta includes up to 0.8.0 beta 3 IIRC.
What I just canāt figure out and please help me if you can, how to information from frigate for my phones notifications (using companion-app if relevant).
- what/where are the images so that I can send them in a mobile_push notification?
What I can see is:
- live feed camera
via RTMP i assume - person camera
last detected I assume, rather than best? - but donāt use camera.snapshot as the author has indicated there are better ways shown in the docs - /media/frigate/clips/*.jpg
would need to know the date stamp, and suffix, and wouldnāt be latest/best?
- Triggers
I can see two ways to trigger the notification, using the binary_sensor provided by frigate (binary_sensor.cctv1_person_detected) - works
and as per docs frigate/events - works tooā¦
but I donāt see this frigate/events in MQTT Explorer?
image: 'https://your.public.hass.address.com/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg?format=android'
I just canāt wrap my brain around what is happening here.
I only port forward 8123, so should i include the port here? but shoudnāt the port be 5000?
what does api/frigate ? is that how hassio knows how to reroute from 8123 to 5000?
should it not be api/ccab4aaf-frigate?
neither works so canāt figure out the trees to bark up.
Other than that though, documentation is impressive.
Could you please share how you do this? Iāve really tried, but didnāt get it to work.
I was wonder why my whole configuration got deleted. I had updated the supervisor as well.
Canāt account for why I was not seeing events in MQTT Explorer, but now that I am, Iāve got and understood the event ID.
and basically the documentation is exactly correct, although if you are not using nabu-casa remote access (although I do pay, iāve continued to use port forwarding) then you do need to add your port number
'https://your.public.hass.address.com:port/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg?format=android'
Your notifications should be triggered by frigate/events mqtt events. If you donāt see any check your frigate configuration.
Once you have events generated from frigate, you can use them to send notifications and use the url you already found as thumbnail (https://your.public.hass.address.com/api/frigate/notifications/{{trigger.payload_json[āafterā][āidā]}}/thumbnail.jpg) - just add 8123 if that is what you already do to access home assistant.
There are some good documentation and examples on how to do that. If you cannot figure out, Iām sure we can help more here.
Here is for example how I send notifications from node-red based on frigate events:
[{"id":"eec41e88.e842f","type":"mqtt in","z":"bef6acf9.1756b","name":"","topic":"frigate/events","qos":"2","datatype":"auto","broker":"bdd9ee83.2f784","x":130,"y":3260,"wires":[["843e50f6.3bb82"]]},{"id":"843e50f6.3bb82","type":"json","z":"bef6acf9.1756b","name":"","property":"payload","action":"","pretty":false,"x":290,"y":3260,"wires":[["873201dc.09c3f"]],"info":"Convert JSON Strings to Objects"},{"id":"873201dc.09c3f","type":"rbe","z":"bef6acf9.1756b","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload.after.id","x":430,"y":3260,"wires":[["81c7f306.157f2"]],"info":"Block any Messages that have duplicate After ID. Cuts down on multiple mqtt messages for the same notification"},{"id":"81c7f306.157f2","type":"api-call-service","z":"bef6acf9.1756b","name":"notify MyMobile","server":"57ce5691.fd6e48","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_christophe_s_iphone","entityId":"","data":"{\"data\":{\"attachment\":{\"url\":\"https://your.public.hass.address.com/api/frigate/notifications/{{payload.after.id}}/thumbnail.jpg\",\"content-type\":\"jpeg\"},\"action_data\":{\"camera\":\"{{payload.after.camera}}\"}},\"message\":\"Check Cameras if they look suspicious\",\"title\":\"Person Detected on {{payload.after.camera}} camera\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":600,"y":3260,"wires":[[]],"info":"Change the following:\nService- to be your mobile in Home Assistant\n\nDATA- url in attachment to be your Homeassistant public url. \n \nInfo:\nFor Android users you may need to add the following after the url:-\n?format=android\n\nI.E.\nhttps://your.public.hass.address.com/api/frigate/notifications/{{payload.after.id}}.jpg?format=android\n\n\n\n{{payload.after.camera}} = Name of Camera\n"},{"id":"bdd9ee83.2f784","type":"mqtt-broker","name":"mqtt.128l.org","broker":"mqtt.128l.org","port":"1883","clientid":"nodered","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"checkIn/nodered","birthQos":"0","birthPayload":"Connected","closeTopic":"checkIn/nodered","closeQos":"0","closePayload":"Disconnecting","willTopic":"checkIn/nodered","willQos":"0","willPayload":"Unexpected"},{"id":"57ce5691.fd6e48","type":"server","name":"Home Assistant","addon":true}]
Thanks Christophe.
my problem was that I knew I needed a port number, but I thought this would have to be 5000, not 8123.
Then after that I was not sure where api/frigate was coming from, and thought that should be :5000/api. it was a slipperly slope from there, and I just kept changing other things, and questioning everything else.
I went the wrong way for sure.
:8123/api/frigate does work. Although, Iāve consumed my 300 notification quota today, so i wonāt get to find out till tomorrowā¦ rotten luck!
So we can almost surely say itās supervisor related ā¦I guess then @blakeblackshear might have a look at it .
Does it save your config or does it get deleted as well ?
Hey,
fantastic project, fantastic implementation, fantastic configuration, just works and with very nice UI. Just become a sponsor!
Some personal notes:
- itās not clear that, by default, only persons are detected (i added ādogā)
- home assistant integration can create sensors automatically? (like zigbee2mqtt)
- it can, in the future, be used to detect āthatā person (after a training) like Facebox?
- I want to buy a Coral, but is out of stock anywhere and Iām in Europe: any solution?
Thank you!
Bye
Sure, I created this before the Hass integration had the motion detection binary sensors in it so I used the MQTT feed and looked for the frigate/events. From the MQTT json that I extracted the camera/object, use a rbe node to only notify every 120s, then create a message and send it to the notify service (which goes to the mobile app on my phone).
From memory I think used the snapshot as I like the larger image in the notification (as opposed to a thumbnail).
It might be easier now to use the binary sensors created by the integration now as the trigger.
Hereās my node-red flow:
[{"id":"29869516.5fd16a","type":"mqtt in","z":"bef73b42.780ab","name":"Frigate","topic":"frigate/events","qos":"2","datatype":"json","broker":"79112772.4344a","x":110,"y":120,"wires":[["e875f4e8.29c888"]]},{"id":"7c98e476.2824cc","type":"template","z":"bef73b42.780ab","name":"Android msg","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n\t\"data\": {\n\t\t\"title\": \"{{ucase_area}}\",\n\t\t\"message\": \"{{ucase_object}} in the {{ucase_area}} area at {{timestamp}}\",\n\t\t\"data\": {\n \"group\": \"Presence\",\n \"sticky\": \"true\",\n \"clickAction\": \"/lovelace-presence/{{lcase_area}}\",\n \"image\": \"https://<nabu casa url>/api/frigate/notifications/{{file_id}}/snapshot.jpg\",\n \"data\": {\n \"ttl\": \"0\",\n \"priority\": \"high\"\n }\n }\n\t}\n}","output":"str","x":1090,"y":160,"wires":[["889286bd.1fad4"]]},{"id":"c018b224.e08ba","type":"function","z":"bef73b42.780ab","name":"Get Camera/Object","func":"var object = msg.payload.after.label;\nvar camera = msg.payload.after.camera;\n\nmsg.ucase_area = camera.charAt(0).toUpperCase() + camera.slice(1);\nmsg.lcase_area = camera;\nmsg.ucase_object = object.charAt(0).toUpperCase() + object.slice(1);\nmsg.file_id = msg.payload.after.id;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":100,"wires":[["bab29f89.2c64c"]]},{"id":"889286bd.1fad4","type":"api-call-service","z":"bef73b42.780ab","name":"Notify","server":"5aed66e0.84bcc8","version":1,"service_domain":"notify","service":"mobile_app_mi_6","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1250,"y":160,"wires":[[]]},{"id":"bab29f89.2c64c","type":"function","z":"bef73b42.780ab","name":"Camera?","func":"switch (msg.payload.after.camera) {\ncase \"driveway\":\n //msg.payload = 'option one';\n return [msg,null,null,null];\n\ncase \"frontyard\":\n //msg.payload = 'option two';\n return [null,msg,null,null];\n\ncase \"pool\":\n //msg.payload = 'option three';\n return [null,null,msg,null];\n\ncase \"backyard\":\n //msg.payload = 'option three';\n return [null,null,null,msg];\n\n}","outputs":4,"noerr":0,"initialize":"","finalize":"","x":500,"y":160,"wires":[["864f9c5a.c32ca8"],["c107ec14.bb20e8"],["b4b89ee2.0acee"],["11a069fd.7ad266"]]},{"id":"864f9c5a.c32ca8","type":"rbe","z":"bef73b42.780ab","name":"120s","func":"deadband","gap":"120","start":"","inout":"out","property":"payload.after.start_time","x":670,"y":100,"wires":[["f7f5ea27.55988"]]},{"id":"11a069fd.7ad266","type":"rbe","z":"bef73b42.780ab","name":"120s","func":"deadband","gap":"120","start":"","inout":"out","property":"payload.after.start_time","x":670,"y":220,"wires":[["f7f5ea27.55988"]]},{"id":"c107ec14.bb20e8","type":"rbe","z":"bef73b42.780ab","name":"120s","func":"deadband","gap":"120","start":"","inout":"out","property":"payload.after.start_time","x":670,"y":140,"wires":[["f7f5ea27.55988"]]},{"id":"b4b89ee2.0acee","type":"rbe","z":"bef73b42.780ab","name":"120s","func":"deadband","gap":"120","start":"","inout":"out","property":"payload.after.start_time","x":670,"y":180,"wires":[["f7f5ea27.55988"]]},{"id":"f7f5ea27.55988","type":"moment","z":"bef73b42.780ab","name":"","topic":"","input":"","inputType":"date","inTz":"Australia/Adelaide","adjAmount":0,"adjType":"days","adjDir":"add","format":"llll","locale":"C","output":"timestamp","outputType":"msg","outTz":"Australia/Adelaide","x":880,"y":160,"wires":[["7c98e476.2824cc"]]},{"id":"e875f4e8.29c888","type":"rbe","z":"bef73b42.780ab","name":"end time?","func":"deadband","gap":"0","start":"","inout":"in","property":"payload.after.end_time","x":200,"y":180,"wires":[["c018b224.e08ba"]]},{"id":"79112772.4344a","type":"mqtt-broker","name":"Hassio","broker":"mqtt.home.local","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"5aed66e0.84bcc8","type":"server","name":"Home Assistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
Does this mean if I have a group of 4 individuals approach the camera I should expect to see 4 snapshots, 1 for each individual? If that is supposed to be happening it isnāt for me. I get a single snapshot with what appears to be the highest confidence detection.
Fantastic project! Thanks @blakeblackshear
I have one wyze cam v2 with RTSP firmware currently in Frigate, got the decoding working through nvidia acceleration, using the following config.
cameras:
driveway:
ffmpeg:
inputs:
- path: rtsp://url
roles:
- detect
- rtmp
input_args:
- -c:v
- h264_cuvid
width: 1920
height: 1080
fps: 10
nvidia-smi
shows one ffmpeg
process.
wyze only supports a 1080p rtsp stream at 10fps. from the documentation, it appears like Frigate converts the stream to 300x300 by default. How do I use nvidia acceleration for this purpose? Should I specify something in output_args
in the section shown below? If so, what ffmpeg
argument to use? Any help is appreciated.
ffmpeg:
hwaccel_args: []
# Optional: global input args (default: shown below)
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
# Optional: global output args
output_args:
# Optional: output args for detect streams (default: shown below)
detect: -f rawvideo -pix_fmt yuv420p
Yes if your M.2 slot has two lanes.