Replies: 59 comments 278 replies
-
Hi Nick and thank you for sharing this. Very helpful! A couple questions: This service part:
Do I simply remove the
What does
I assume same thing here? Only change the script part? Since I am not using the |
Beta Was this translation helpful? Give feedback.
-
Sorry, forgot to add the code to this part of my question:
|
Beta Was this translation helpful? Give feedback.
-
Thank you. I was able to get it to work but when I click the notification/snapshot, I receive an error. I assume its trying to take me to the clip as the url is Thank you. |
Beta Was this translation helpful? Give feedback.
-
A release with my PR to Android home assistant just went out, Android now supports the |
Beta Was this translation helpful? Give feedback.
-
@NickM-27 |
Beta Was this translation helpful? Give feedback.
-
"This does not and is not designed to handle stationary objects. If a car is in the driveway a notification will be sent when it is first seen but will not be continually updated" So what you're saying is this will help frigate detect moving objects better? Cuz if so that's exactly what I need on my front porch camera with people walking by alot... |
Beta Was this translation helpful? Give feedback.
-
@blakeblackshear Here is what it currently looks like, the green is the zone I have set for it to detect people and the black is the mask that's just blocking a window right there. One thing I plan on testing is slighting moving the position of the camera more towards the stairs and a little more down to see if it helps, I even raised it to 15fps to see if that will help it detect moving people faster. Overall I'd say it works pretty good it just struggles when a person is walking by sometimes or if there are multiple people on the porch, I hope it gets better when I'm finally able to add a coral to my RPI4. |
Beta Was this translation helpful? Give feedback.
-
Can someone please share notify script for mobile and android tv? |
Beta Was this translation helpful? Give feedback.
-
Thanks for this, great stuff! The trigger works for me, but I'm not sure I have edited all correctly. My test failed with it rejecting the condition that "entered_zones" had not been met, but I was within the zone I had layed out and renamed in your config above
Any idea where I've gone wrong? |
Beta Was this translation helpful? Give feedback.
-
This is a great script. After some debugging with it I realized that this didn't work in all cases for me. The conditions filter it by either While I was debugging this I also found it hard to debug because the trigger was all frigate events that was occurring, make it so it was firing for every frigate event coming in, whether it was applicable or not. I moved the In the frigate trigger:
- platform: mqtt
topic: frigate/events
id: frigate-event
payload: 1/1/1
value_template: >-
{{ iif(value_json["type"] != "end", 1) }}/{{ iif(["front_yard",
"driveway"]|select("in",
value_json["before"]["entered_zones"])|list|length == 0, 1) }}/{{
iif(["front_yard", "driveway"]|select("in",
value_json["after"]["entered_zones"])|list|length > 0, 1) }}
variables:
after_zones: "{{ trigger.payload_json[\"after\"][\"entered_zones\"] }}"
before_zones: "{{ trigger.payload_json[\"before\"][\"entered_zones\"] }}"
camera: "{{ trigger.payload_json[\"after\"][\"camera\"] }}"
cameraLabel: >-
{{ trigger.payload_json["after"]["camera"] | replace("_", " ") | title
}}
id: "{{ trigger.payload_json[\"after\"][\"id\"] }}"
label: "{{ trigger.payload_json[\"after\"][\"label\"] }}" |
Beta Was this translation helpful? Give feedback.
-
Can someone help me understand if this is possible? I would like to get notified when there is a delivery to my house, that would mean if a car stops by in front of my house (a zone in frigate) for some amount of time, I get notified, if a car just only passes through a zone fast I don't want to get a notification. Is this possible to do using some modification of this notification script? I have been trying to find a way, but to no avail. |
Beta Was this translation helpful? Give feedback.
-
Anybody using this with nabu casa? Is it as simple as just replacing the |
Beta Was this translation helpful? Give feedback.
-
Just did the customizations on the notifications as stated on the main post, added a delay at the end so the notifications don't re-trigger, and everything is working perfectly! Many thanks for sharing it! |
Beta Was this translation helpful? Give feedback.
-
@NickM-27 - Just a basic question on this automation. On clicking the Image/Video Frigate notification from the Home Assistant App, will it open inside HomeAssistant App or will it open in a browser? |
Beta Was this translation helpful? Give feedback.
-
Thanks for posting this. I am not a Frigate expert, nor an HA automation expert, so the Blueprints really don't help me understand anything I'm trying to have HA send email alerts for 2 of my 10 cameras. Could this automation be adapted for that? I already have SMTP setup and working, but for the life of me I cannot get images to be inserted inline into the email. I am looking for it to say "$object Detected at $time" and then insert the image below, not as an attachment. I am doing it currently without issue in Blue Iris, and want to replicate the setup. Has anyone done anything similar? Here is an example |
Beta Was this translation helpful? Give feedback.
-
Well, this is precisely why Blueprints are beneficial when starting out with HA! I do understand that attempting to decipher the blueprint code can be overwhelming if that's what you're trying to do. Was your intent to modify it for sending email instead of phone notifications? Others have adapted this blueprint to use Telegram instead of HA Companion notifications, so yes, it's possible it could be adapted to send email. I assume you are trying to use the HA SMTP integration to send email. I've never used this integration, but the doc states that if you use the html option in conjunction with the images option, you have complete control over how images are sent. |
Beta Was this translation helpful? Give feedback.
-
This doesn’t seem to work anymore. |
Beta Was this translation helpful? Give feedback.
-
Hi all was reading this nice topic about notifications with frigate and double take. So I would love to trigger the automation / script when the doorbell is pressed and then check whether it is someone detect by Double Take or it's an unknow person. Is that possible or maybe some one has some good suggestions? |
Beta Was this translation helpful? Give feedback.
-
I can't see another way to do it; Frigate/DoubleTake has to start the
process as that's where the person detection happens.
|
Beta Was this translation helpful? Give feedback.
-
So currently have set this up for automation. Seems to working pretty well. But I can imagine more people will join the double take list.
|
Beta Was this translation helpful? Give feedback.
-
@NickM-27 Is there more information about what specifically the "before" and "after" sections are in the MQTT event data? I've got an automation (thank you btw for your examples and info in this thread; very useful) based on your work, but the one thing I've noticed (maybe just an issue with the newer 0.13+) is that if you want to act on both a label and a zone, there are times where you may have one, the other, but not both until you get to later update events. To overcome this, I used your wait trick and I watch for a "new" event (for the event id), then i wait for updates (for label and zones). Sometimes I've noticed that, at least for "current_zones", a zone may be in the "before", but not in the "after". Before I change my code to look at "before", I was curious about when those two would get updated? |
Beta Was this translation helpful? Give feedback.
-
@NickM-27 got a question regarding my above automation. Other question is that I see in your example that you use the returned sub_label of double take to notify with a persons name. |
Beta Was this translation helpful? Give feedback.
-
I'd like to share an automation I've been using for a few weeks now that seems very reliable and I have found it does a much more accurate notification of the events I'm concerned with (in this case, people coming to my front door) compared to the doorbell app I have from the manufacturer. I took inspiration from a few of the other automations in this thread, most notably the idea to filter MQTT events right at the trigger stage using multiple pieces of the payload together vs relying on conditions (to reduce the number of traces), and also using the repeat and wait actions so that it can watch an event all the way through and use updates until it finds a good candidate for a notification. You may notice that the first condition is redundant since it already tests for a "new" event in the trigger portion, and the second condition watches a door sensor so that I don't get notified if someone has answered (opened) the door as someone is standing there. Finally, for anyone who didn't know, there's a "hidden" action called Stop that I use to break out of the actions once a notification is sent, thus preventing repeated notifications from the same event. alias: Security - Person at front door
description: ""
trigger:
- platform: mqtt
topic: frigate/events
payload: Front_doorbell/new
value_template: "{{ value_json.after.camera }}/{{ value_json.type }}"
variables:
id: >-
{{ trigger.payload_json.after.id if trigger is defined and
trigger.payload_json is defined else '' }}
condition:
- condition: template
value_template: "{{ trigger.payload_json.type == 'new' }}"
alias: Confirm Frigate event is new
- condition: state
entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_opening
state: "off"
action:
- alias: Wait for a Person on the Doorstep
repeat:
sequence:
- alias: Wait for an update to the Frigate event
wait_for_trigger:
- platform: mqtt
topic: frigate/events
payload: "{{ id }}"
value_template: "{{ value_json.after.id }}"
alias: When an update to the Frigate event is received
timeout:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
continue_on_timeout: false
- alias: Confirm Frigate detected zone is Doorstep
condition: template
value_template: >-
{{ 'Doorstep' in (wait.trigger.payload_json.before.current_zones +
wait.trigger.payload_json.after.current_zones) }}
- condition: template
value_template: "{{ wait.trigger.payload_json.after.label == 'person' }}"
alias: Confirm Frigate detected a Person
- condition: template
value_template: "{{ wait.trigger.payload_json.after.has_snapshot == true }}"
alias: Confirm Frigate snapshot is available
- service: notify.mobile_app_phone
metadata: {}
data:
message: Someone is at the front door
title: Front door
data:
channel: Security
group: Doorbell
importance: high
priority: high
ttl: 0
tag: "{{ id }}"
image: /api/frigate/notifications/{{ id }}/snapshot.jpg
notification_icon: mdi:doorbell-video
url: /lovelace/doorbell
clickAction: /lovelace/doorbell
- stop: Notification sent
until:
- alias: Confirm Frigate event is complete
condition: template
value_template: "{{ wait is not defined or wait.trigger.payload_json.type == 'end' }}"
mode: parallel
max: 10
trace:
stored_traces: 20 |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, The aim is to create a critical notification on iphones, and alexa ttd if my son get into the pool. I see the tempates in the previous posts but i don't get how to configure them. I would appreciate any help. Thank you! |
Beta Was this translation helpful? Give feedback.
-
I'm just going for a very simple notification. How can I get the wait for end template to work correctly? I'm not getting anything coming through.
It works without the wait template, but I get spammed with multiple notifications |
Beta Was this translation helpful? Give feedback.
-
I previously had these notifications working but I removed the attached clip due to very high data usage by home assistant when it was present (I discovered it always uses cellular data to send the video clip and it was rapidly eating through my plan data). Ever since then, for some reason the image preview has gone away from the notification. Clicking on the notification itself correctly sends me to the video, but I don't get an image preview on the ios notification and if I long click I just get a broken video link. I've done the following:
I'm running out of things to try and would love suggestions. Below are the excerpts from my automations and scripts. I removed parts I didn't think you'd need for brevity but if you want I can either include everything or include other parts you'd like to see.
|
Beta Was this translation helpful? Give feedback.
-
Does anyone has the telegram version working? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I have adapted the OP code to use Telegram. The notification will send a snapshot (with object detected box) along with a link to the video clip. You can use the send_video bot instead, but send_photo is quicker and of course less data intensive. I haven't incorporated the double-take improvements yet. script.yaml
automation.yaml
|
Beta Was this translation helpful? Give feedback.
-
Intro
I saw there was some interest over on Reddit asking about Frigate notifications without a blueprint. I have implemented this myself and figured I would share so others who are interested can work off of it.
Screenshots
Basic Example
This is the notification when it first goes off and then after the event has ended.
Double-Take Example
This is an example of the double-take face match
Important Notes
script.send_dynamic_notification
is a custom script I wrote in order to send the notification to my mobile devices and my TVs at the same time. If there is a lot of interest I can add this to this post as well, but that will need to be changed before the automation will work.Double-Take
to add face info for any recognized people. If you don't use double-take then you will want to delete everything besides the part betweenelse
andendif
for the title and message.parallel
so that multiple notifications can come through from the same camera. For example, if a car drives up and a person gets out, you will be notified about both.Automation Yaml
Simple Notification Service
Reference the HASS notifications docs for how to customize these.
Beta Was this translation helpful? Give feedback.
All reactions