H
HASS.Agent2mo ago
Ani

Frigate notification to HASS.Agent

as the title says, I want an automation that sends a notification to my windows pc via HASS.Agent. I've tried changing the notify.device entity in the automation but the Frigate blueprint seems to only work with mobile or any devices with the HA app installed.
8 Replies
Ani
AniOP2mo ago
the action seems like it should work
action:
- action: notify.my_pc
metadata: {}
data:
message: Motion Detected
title: Front Door
image: >-
https://[public HA link]]/api/frigate/notifications/{{trigger.payload_json["after"]["data"]["detections"][0]}}/thumbnail.jpg
action:
- action: notify.my_pc
metadata: {}
data:
message: Motion Detected
title: Front Door
image: >-
https://[public HA link]]/api/frigate/notifications/{{trigger.payload_json["after"]["data"]["detections"][0]}}/thumbnail.jpg
but i get Error rendering data template: UndefinedError: 'trigger' is undefined and I'm not sure how the trigger should be laid out I'm also not sure if the automation would only work when the actual event occurs and I can't just have it fetch the most recent image if I run the action manually
barrelltitor
barrelltitor2mo ago
whats your full auttomation or whats your trigger first thing that comes to mind is to check the docu if there's actually a payload_json[after][data][detections][0] if it says trigger is undefined its probably in another variable can you send me the blueprint too maybe? a link to it would be good, i can see if there's any relevant documentation
Ani
AniOP2mo ago
I managed to get the notification to pop up with this automation but there was no image - I may need to adjust the link:
alias: PC Notif Test
trigger:
- platform: mqtt
topic: frigate/events
condition:
- condition: template
value_template: "{{ trigger.payload_json['after']['label'] == 'person' }}"
action:
- data:
title: Frigate Person Detection
message: >
"Frigate detected a person on the {{
trigger.payload_json['after']['camera'] }}."
data:
image: >-
https://[Link]/api/events/{{
trigger.payload_json['after']['id'] }}/snapshot.jpg
action: notify.my_pc
alias: PC Notif Test
trigger:
- platform: mqtt
topic: frigate/events
condition:
- condition: template
value_template: "{{ trigger.payload_json['after']['label'] == 'person' }}"
action:
- data:
title: Frigate Person Detection
message: >
"Frigate detected a person on the {{
trigger.payload_json['after']['camera'] }}."
data:
image: >-
https://[Link]/api/events/{{
trigger.payload_json['after']['id'] }}/snapshot.jpg
action: notify.my_pc
Ani
AniOP2mo ago
this was without the blueprint entirely, but this is the one i was going to try and alter https://community.home-assistant.io/t/frigate-mobile-app-notifications-2-0/559732
Home Assistant Community
Frigate Mobile App Notifications 2.0
Preamble In 2022, a home assistant release caused issues with the original blueprint. It seems @hunterjm has not visited that thread in some time. I have updated the blueprint and added dozens of new features. I am continuing to do so and the mods have split the thread here to make things simpler. Thank you very much Hunterjm for the foundationa...
barrelltitor
barrelltitor2mo ago
Yeah trigger undefined was definitely a problem, but if it works now you just need to play around with the data I don't have ffrigate myself so idk there,e if you can give me the trigger object i can help figure it out, and an example link If you need help with that in the first place ofc
Ani
AniOP2mo ago
yeah it's just a matter of getting the image to appear
Ani
AniOP2mo ago
right now it's just this
No description
Ani
AniOP2mo ago
so i think i need to mess with the variables looks like the link is correct as https://[link]/api/frigate/notifications/[event id]/snapshot.jpg i just need to get the event id to replace it as a variable
Want results from more Discord servers?
Add your server