You can also remove the healthcheck
entry too. It is not necessary.
Hmmā¦ Removing those health check entries didnāt do it. But I did add the version to the top like so which works:
version: "3"
services:
frigate:
container_name: frigate
...
Now I guess I need a MQTT server, correct?
I think itās a single vs double quote issue.
- "{{ trigger.payload_json['after']['label'] == 'person' }}"
- "{{ 'oprit' in trigger.payload_json['after']['entered_zones'] }}"
has anyone using node-red refactored notifications based on teh new API endpoints? Up until now, Iāve been triggering off of the sensor.camera_person
sensor > 0. When triggered, Iād simply use the snapshot
service to grab a pic of the mqtt camera stream and stick it in the www folder before sending the notification. Iām thinking thereās now a more elegant way to do this using the https://your.public.hass.address.com/api/frigate/notifications/
endpoint?
Iām thinking I should now start listening to frigate mqtt events instead that way i can grab the JSON data? Iāll start poking around tonight.
EDIT: ok that was easy
That was the whole point of the refactored MQTT topic and the notification API. No need to save snapshots anymore. I wanted to make it so simple YAML automations could be used instead.
Think I got something here. I couldnāt get an image through to an ios notifcation using the data.data.image
method in your examples, but I find data.attachment.url
works great. Here it is in node-red:
{
"title": "SECURITY NOTIFICATION",
"message": "Person detected at the {{payload.after.camera}}",
"data": {
"attachment": {
"url": "https://my_url.com/api/frigate/notifications/{{payload.after.id}}.jpg",
"content-type": "jpeg"
}
}
}
It seems like on detection generates a lot of events on the bus though, right? Not every event is generating a thumb is it?
It publishes an update for the event when a better representation of the detected object is available. It is looking at size, age, and score to determine what is better. The endpoint doesnāt actually fetch a real āfileā from disk. When the event is in progress, it creates it on the fly from the in-memory frame. Once the event is over, it pulls it from the database. So no, its not generating a bunch of thumbnails.
That reminds me that I need to make sure I push an update if entered zones change.
I think that is nice! Does it follow HA region and formatting? MDY VS DMY, 12hr vs 24hr time, etc)
I was thinking about what other information would be useful and had two thoughts.
- Duration would be good.
- Some type of object id, or a way to identify which object is in the video. Since multiple objects in frame will trigger individual recordings, a way to distinguish between the recordings could be handy.
I think we are going to get outside the bounds of what is reasonable to show in the media browser names. I donāt get to control line breaks for formatting at all. I could look at adding some info as an overlay on the thumbnail too.
Just putting my hand up here as another person who does not use Home Assistant but has been using frigate successfully, in my case via node red and MQTT. It would be good if these use cases could continue to be supported.
The new beta looks to be addressing several things I had been looking for (especially detection with low res stream and recording clips with high res stream) but it would be good if MQTT support could continue independent of the HA integration so we can access outside HA. For example, having clips or at least their paths published to MQTT.
Iām using the mqtt node to listen for events from 0.8.0 and it works great. I parse the json event data and return it as an object that can be easily managed. I posted a screen shot a few posts back.
Agreed, only if thereās a good way to present it, those things may be useful. Time will tell as the feature is released and gets real-world use.
Trying to use the latest version but my docker run command resulted in below logs error:
* Starting nginx nginx
...done.
frigate.app ERROR : database is locked
Any idea what causes this issue?
I havenāt run across that yet, but it is referring to the sqlite database at /media/frigate/clips/frigate.db
. This happens on startup?
I had this problem too when trying to move my clips folder to a samba share. Iām assuming it has something to do with permissions on the share. Whatās strange is that frigate was able to create the two database files in the clips folder. It just wasnāt happy about it for some reason.
I need to spend more time poking around. In the meantime, I just went back to writing to the local drive.
Planning on giving 0.8.0 beta a try later today. Two of my cameras are pretty cheap - they donāt have a low-res subfeed and lack the ability to change the framerate. Should I expected degraded performance? Any suggestions to get the most out of it?
Yes, you are right, might be an idea to update the notification example in github.
Iāve also a kind of de-bounce condition (60seconds) as it was otherwise sending out multiple messages for a single event.
- alias: "when a person enters oprit"
trigger:
platform: mqtt
topic: frigate/events
condition:
- "{{ trigger.payload_json['after']['label'] == 'person' }}"
- "{{ 'oprit' in trigger.payload_json['after']['entered_zones'] }}"
- "{{ ( as_timestamp(now()) - as_timestamp(state_attr('automation.when_a_person_enters_oprit', 'last_triggered')) |int(0) ) > 60 }}"
action:
- service: notify.telegram_YJB
data:
message: "A {{trigger.payload_json['after']['label']}} has entered the oprit."
data:
photo:
- url: "https://<valid_internet_domain_name>/api/frigate/notifications/{{trigger.payload_json['after']['id']}}.jpg"
caption: "A {{trigger.payload_json['after']['label']}} has entered the oprit."
Thanks again!
Iām using a basic wyze 2 with the defang hacks firmware. It has no substream and things are working fine at 10fps. Iā using all roles but recording.
I think youāll be fine.