Now that it is working, I received an error message, I’m not sure if I’m the cause or not but I thought I would mention it.
I found it, but I basically have no idea what you’re referring to with regards to how the template created would be tied to the beta automation blueprint, and what all is involved in creating such a template. If you could provide anything else with regards to what you mean by creating the template, if that’s different than an automation, and how you would correlate the two (any documentation, even), that would be helpful.
That isn’t an error message, just a display limitation when templating.
There is a field named custom filter in the beta. It accepts templates.
You can make a template with any combination of criteria and use it in this field. Here is an example of a time filter I just took from the critical notifications dropdown.
It results in a string not a Boolean.
{{'false' if now().hour in [8,9,10,11,12,13,14,15,16,17,18] else 'true'}}
You could modify this and add additional criteria for presence.
{{'true' if now().hour in [7,8,9,10,11,12,13,14,15,16,17,18,19] and states('group.xxxxxx', 'home') else 'false'}}
Now, I can’t remember the exact formatting for templating a state of an entity, but you should use the template editor in the developer tools of home assistant to tweak and fine tune it to your liking.
By the way, how have you made a filter for the group being not away anyway? Surely you are halfway there.
Earlier this afternoon I updated HA to the new version. At some point I stopped getting notifications from the cameras. I’ve rebooted HA and Frigate, it appears Frigate and MQTT are still connected and working.
I did notice an error message at the bottom of the log page for Frigate.
I’m not sure if the new Frigate or HA version has anything to do with the loss of camera notifications.
Hi @SgtBatten, thanks for that! Yes, I have a group setup that changes from “home” to “away” and that works well. The below logic I think should do the trick covering my two scenarios:
{{'true' if now().hour in [23,24,1,2,3,4,5,6] or is_state('group.persons', 'away') else 'false'}}
Does this entire bit reside in the field of “Custom Filter (Optional - Advanced)”? Also, if it evaluates as the string ‘true’, does that mean that the notification will be sent? Thanks for all of your help so far1
I am using your latest stable release. I tried using initial_entered_zones in my template like so:
message: >-
A {{ label }} {{ 'is loitering' if loitering else 'was detected' }} on the
{{ camera_name }} camera{{ ' in the ' + initial_entered_zones if
initial_entered_zones else '.'}}
But I got an error: Error: TypeError: can only concatenate str (not "Wrapper") to str
I traced a few events and I’m not getting entered_zones passing in the json most of the time:
trigger:
id: frigate-event
idx: '1'
alias: null
platform: mqtt
topic: frigate/events
payload: >-
{"before": {"id": "1706802969.175169-3jl2cn", "camera": "front_porch",
"frame_time": 1706802969.175169, "snapshot": null, "label": "car",
"sub_label": null, "top_score": 0.0, "false_positive": true, "start_time":
1706802969.175169, "end_time": null, "score": 0.74609375, "box": [51, 340,
146, 409], "area": 6555, "ratio": 1.3768115942028984, "region": [0, 233,
320, 553], "stationary": false, "motionless_count": 0, "position_changes":
0, "current_zones": [], "entered_zones": [], "has_clip": false,
"has_snapshot": false, "attributes": {}, "current_attributes": []}, "after":
{"id": "1706802969.175169-3jl2cn", "camera": "front_porch", "frame_time":
1706802969.41153, "snapshot": {"frame_time": 1706802969.41153, "box": [77,
324, 167, 388], "area": 5760, "region": [0, 197, 320, 517], "score":
0.7265625, "attributes": []}, "label": "car", "sub_label": null,
"top_score": 0.736328125, "false_positive": false, "start_time":
1706802969.175169, "end_time": null, "score": 0.7265625, "box": [77, 324,
167, 388], "area": 5760, "ratio": 1.40625, "region": [0, 197, 320, 517],
"stationary": false, "motionless_count": 0, "position_changes": 1,
"current_zones": [], "entered_zones": [], "has_clip": false, "has_snapshot":
false, "attributes": {}, "current_attributes": []}, "type": "new"}
Although there are zones for all events in Frigate itself. I am also using the latest frigate release and have my integration up to date.
Yes to both.
That json would be from earlier in the event, before a zone was entered. Later messages would have a zone.
I have the Blueprint notification working for both Android and iOS. Thank you, it’s great.
I’d like to call a script to perform some other actions when the notification is triggered: Send TTS message to a local smart speaker, and turn on some lights. I am doing this with my own simpler notification that I created from scratch. Is there a way to call to a script to perform other/additional actions?
It’s not perfect but the beta contains custom action options
I’ll take a look … thanks
Is this a non-blocking call mechanism? The TTS routine takes a few seconds to complete and I wouldn’t want to break something timing-related in your code.
Looks perfect … giving it a try
I can’t seem to get action buttons to work on iOS. It just comes up as an alert, when clicked, it opens the external URL to the camera. In the Beta, after clicking it, it brings you to a video that won’t play (play button with a line through it). Works great on android, except in the beta, no image or video preview. Any ideas why the action buttons aren’t working in iOS? This is my main issue. The android thing was just a heads up. I apologize in advance if someone already brought this up, This is a very long post…
My custom action works sometimes. I didn’t apply any conditions on this action. Why are they present in the trace? Why would conditions be required downstream of the decision to notify, other than the check for the existence of custom action which doesn’t seem to be needed if there is nothing present?
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 }}'
sequence:
- service: chime_tts.say
data:
chime_path: bells
delay: 700
message: Person detected on front porch
tts_platform: tts.piper
tts_playback_speed: 100
volume_level: 1
cache: true
announce: true
target:
device_id: 5ee58c347fd86dda99e9d12179b1cd7e
This is my code
custom_action_auto:
- service: chime_tts.say
data:
chime_path: bells
delay: 700
message: Person detected on front porch
tts_platform: tts.piper
tts_playback_speed: 100
volume_level: 1
cache: true
announce: true
target:
device_id: 5ee58c347fd86dda99e9d12179b1cd7e
I don’t understand what this logic is testing at this point
- >-
{{ 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 }}'
I had the same question. In iOS you have long-press the alert to show the Action Buttons
In Android before this latest beta the alert opened with the buttons. I preferred that. Now you need to press the little dropdown arrow to open the alert
It isn’t downstream. It’s independent so the same checks are made in case it is filtered out.
That’s awesome, here’s hoping that it works. By the way, you added so many awesome features to this new beta, they look great! I also appreciate your tireless effort with replying to everyone here!
Question:
I’m seeing these Traces for the first time and I’m trying to decode why the notifications stopped yesterday. I’m guessing the problem is with the section with the orange circle with a “2” in it?
There is also a part with a broken line to the right, I guess there is something wrong there as well?
The conditions weren’t met. It never tried to send any notification.
The square box symbol above the three parallel branches in both the top (initial) and bottom (loop) sections will show you the conditions