Yes you could create a summary entity which gets used in the state filter, or you could use the custom filter in the beta and essentially do the same thing by creating a summary template.
This is my custom action. I think you might have a similar use case.
Both input booleans are helpers that I created.
The first one ānotifications_sonosā is a switch on the dashboard that can get hit if weāre having company over or I just get annoyed it notifications. Other automations like the washing machine automation use that as a condition.
The second input boolean that gets turned off than on is because I wanted to limit the amount of notifications that would come over the audio. The cooldown and the silence feature of the blueprint donāt quite do an absolute limit like this switch does.
custom_action_auto:
- if:
- condition: state
entity_id: input_boolean.notifications_sonos
state: "on"
- condition: state
entity_id: input_boolean.frigate_notifications_sonos
state: "on"
then:
- service: chime_tts.say
data:
chime_path: whistle
offset: 500
tts_speed: 80
tts_pitch: 0
announce: true
cache: true
tts_platform: tts.piper
message: >-
A {{ label }} {{ 'is loitering' if loitering else 'was detected'
}} on the Gate camera.
target:
entity_id:
- media_player.sonos_upstairs
- service: input_boolean.turn_off
target:
entity_id:
- input_boolean.frigate_notifications_sonos
data: {}
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- service: input_boolean.turn_on
target:
entity_id:
- input_boolean.frigate_notifications_sonos
data: {}
Hi everyone,
years ago i had the notification working, on family iphones everything in YAML.
I quit using it and now after years obviously nothing works anymore.
I did try to use the blueprint but it doesnāt work, no notifications.
I would like to create an automation if a person is detected inside the pool with ios notifications with attachment and alexas tts across the house.
Do you have any suggestion on how to create an automation like this?
Thank you!!!
Have you tried to download the 2.0 blueprint and play around with it?
Quick question about the āchooseā step on custom actions.
The notification played over the speaker once, then 5 mins later it didnāt play. Iāve noticed this behavior in the past. Trace line runs right past this step. What is happening at this step that Iām missing?
BP YAML
alias: Frigate TTS - Front Gate
description: ""
use_blueprint:
path: SgtBatten/Beta.yaml
input:
camera: camera.frigate_lorex_01_gate
notify_device: 9be781ad60f411e59df2cbe2c4690a11
update_thumbnail: true
channel: frigate
video: >-
{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4
sticky: true
tap_action: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/snapshot.jpg"
icon: >-
mdi:{{'account-outline' if label == 'Person' else 'dog' if label == 'Dog'
else 'cat' if label == 'Cat' else 'car' if label == 'Car' else
'home-assistant'}}
zone_filter: true
labels:
- person
- car
button_3: Silence New
url_2: >-
{{base_url}}/api/camera_proxy_stream/camera.{{trigger.payload_json['after']['camera']
| lower | replace('-','_')}}?token={{state_attr( 'camera.' ~ camera,
'access_token')}}
button_2: View Stream
tv: false
cooldown: 1
attachment: snapshot.jpg
zones:
- gate_driveway_entrace
- gate_driveway
- gate_flower_cart
custom_action_auto:
- if:
- condition: state
entity_id: input_boolean.notifications_sonos
state: "on"
- condition: state
entity_id: input_boolean.frigate_notifications_sonos
state: "on"
then:
- service: chime_tts.say
data:
chime_path: whistle
offset: 500
tts_speed: 80
tts_pitch: 0
announce: true
cache: true
tts_platform: tts.piper
message: >-
A {{ label }} {{ 'is loitering' if loitering else 'was detected'
}} on the Gate camera.
target:
entity_id:
- media_player.sonos_upstairs
- service: input_boolean.turn_off
target:
entity_id:
- input_boolean.frigate_notifications_sonos
data: {}
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- service: input_boolean.turn_on
target:
entity_id:
- input_boolean.frigate_notifications_sonos
data: {}
message: >-
A {{ label }} {{ 'is loitering' if loitering else 'was detected' }} on the
Gate camera.
And maybe separate question, is this supposed to have true
in it as a stop gap for when no filter is present?
yes a lot, and the trace is not clear.
Moreover i tried everything but the notification doesnāt work
I think youāre going to have to share more about your configuration if you want anything more than really broad suggestions.
I.e. The blueprint yaml
And to your request about an example for a notification with someone in the pool, w/TTS, take a look at the blueprint yaml I posted a couple comments up.
Iām using zones in the frigate configuration that are observed by this blueprint. Thereās a custom action at the end which handles the TTS part. Iām using Sonos through Chime TTS, but Iād imagine you can use it with another TTS platform.
Yes, until i implement a toggle it needs to be true for the automation to work.
currently it is subject to all the filter tests, same as the main notification. Your second condition failed, thatās the one about zones.
Thank you!
Iāll dive into it further.
Do i need to configure the TV in a notify group, for the notification on a Sony TV to work?
It does not need to be in a group. You use the same field but you can just enter the name of the tv that the android/fore tv integration uses
Will the phones receive snapshots instead of thumbnails?
Notifications are set to have snapshot, Not thumbnails.
So if I add the TV to the notify_all_devices group, it should work?
Or is it better to create a new seperate automation for the TV, as a work around for the snapshots/thumbnails displaying on the mobile app?
If you use a group then you need to choose which one gets images using the tv toggle. I recommend two automations.
Do you mind holding my hand here? Maybe Iāll figure it out as I write thisā¦
Hereās the conditions from the custom auto action. Youāve seen them, so I doubt theyāre adding anything for you.
yaml
alias: Custom Action Auto
choose:
- conditions:
- '{{ custom_action_auto |length > 0 }}'
- >-
{{ not zone_only or (not zone_multi and zones|select('in',
enteredzones)|list|length > 0) or (zone_multi and enteredzones|length >
0 and zones |reject('in', enteredzones) |list |length == 0) }}
- '{{ not initial_home }}'
- '{{ not state_only or states(input_entity) in states_filter }}'
And the conditions yaml for the built in notification:
alias: Notify on new object
choose:
- conditions:
- >-
{{ not zone_only or (not zone_multi and zones|select('in',
enteredzones)|list|length > 0) or (zone_multi and enteredzones|length >
0 and zones |reject('in', enteredzones) |list |length == 0) }}
- '{{ not initial_home }}'
- '{{ not state_only or states(input_entity) in states_filter }}'
- '{{ custom_filter }}'
With a couple differences they look the same, and more importantly the point of failure is that 2nd condition on the custom action which they both have.
I canāt figure out why I get a notification through the built in process on my phone, but only sometimes on the custom action. They have the same filters and zones.
I have yet to enable debug and additional traces as I havenāt had a chunk of time to dedicate to triggering this. Iām also thinking logging all the MQTT messages might help too.
Are there any other differences between how the two are triggered, i.e. maybe the phone is getting pinged on an update when frigate improves itās event details vs. custom action is not?
Itās almost certainly because the zone condition isnt met when the automation first gets triggered. The custom action auto only gets attempted once at the beginning where as the notification conditions get checked many times in the loop. I suspect the first part of the automation skips the notification just like it skips the custom action.
I was wondering if thatās the case.
So for the same event a built-in notification might get triggered for the first time during one of the repeat cycles?
Correct.
In theory if you used the custom action auto loop also and had it swap a Boolean between true and false you could use that to only have it work once but in the loop. But more complex but doable
Thanks for all the help, Iāve got these working almost perfectly now
Does anyone have any suggestions on the correct way to also have the alert send an email with the image attached and in the email (Not just linked to the URL)
I already have SMTP setup and working, but Iām at a loss as to how to get it done in the same automation as the mobile notifications