Frigate Mobile App Notifications 2.0

That all makes sense. I’m just wondering how it works in light off the PR which seems to be directly addressing this situation (the desire to intentionally stop a looping run). Is there something about the way the silence process works in this BP that avoids the stop of the previous run?

Not a big deal, just more wondering for the understanding.

Quick follow up for anyone interested in making the a custom action for TTS or similar more consistent…

I was able take my existing “custom action auto” and copy it into the “custom action loop” since it already had an input_boolean that disabled itself for 60 seconds as part of the action. That boolean was there to avoid the speaker from playing too many messages. I’d turned down the cooldown period as the camera picked up vehicles on the road and was missing vehicles in the driveway.

NOTE - it’s now in both the “auto” and “loop” sections and only triggers a TTS once because of the boolean.

For testing purposes I added a message sent to my phone of “loop” or “not loop”. As it turns out, this was the solution. Now my TTS to the house speakers is triggered either by the “auto” or “loop” part of the blueprint, but only once within 60 seconds.

Thanks for walking me through that Sgt!

Here's the YAML for anyone interested.
alias: Frigate TTS - Front Gate
description: ""
use_blueprint:
  path: SgtBatten/Beta.yaml
  input:
    camera: camera.frigate_lorex_01_gate
    notify_device: 9be781ad60f411e59df2cbe2c4690a11
    update_thumbnail: false
    channel: frigate
    video: >-
      {{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4
    sticky: false
    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:
          - delay:
              hours: 0
              minutes: 0
              seconds: 0
              milliseconds: 500
          - 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: {}
          - service: notify.mobile_app_x
            metadata: {}
            data:
              message: Not loop
        enabled: true
    message: >-
      A {{ label }} {{ 'is loitering' if loitering else 'was detected' }} in the
      driveway.
    alert_once: true
    debug: false
    custom_action_auto_multi:
      - repeat:
          sequence: []
          until:
            - condition: template
              value_template: >-
                - '{{ 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
                }}'
        enabled: false
      - if:
          - condition: state
            entity_id: input_boolean.notifications_sonos
            state: "on"
          - condition: state
            entity_id: input_boolean.frigate_notifications_sonos
            state: "on"
        then:
          - delay:
              hours: 0
              minutes: 0
              seconds: 0
              milliseconds: 500
          - 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: {}
          - service: notify.mobile_app_x
            metadata: {}
            data:
              message: Loop
trace:
  stored_traces: 10

1 Like

Sorry it took a little longer, was busy with something else. Here’s my config:

alias: Kamera Eingang
description: ""
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    camera: camera.eingang
    notify_device: 9b7d87e3a8c0eaf9688d4d4a0f36f351
    base_url: https://xxx.ui.nabu.casa
    critical: "{{'true' if is_state('sun.sun', 'above_horizon') else 'false' }}"
    alert_once: true
    attachment: thumbnail.jpg
    update_thumbnail: true
    title: 📸 Kamera Eingang 📹
    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'}}
    message: "{{label}} wurde am {{camera_name}} erkannt!"
    cooldown: 120
    button_1: Clip anzeigen
    button_2: Snapshot anzeigen
    button_3: Stumm
    url_3: silence-{{ camera }}
    notify_group: alle_handys
    silence_timer: 60
    sound: none
    android_auto: true
    update_sub_label: false
    labels:
      - person
      - car
    disable_times: []
    channel: surveillance

Thanks!

Your attachment is set to none

You are sending critical notifications based on the sun being above the horizon. Critical will override the channel

In truth, I have no idea. I inherited this blueprint.

You got me thinking…

And, sure enough, there’s something special about the silence sequence tucked in the data.

action:
  - choose:
      - alias: "Silence New Object Notifications"
        conditions:
          - condition: trigger
            id: silence
        sequence:
          - service: automation.turn_off
            target:
              entity_id: "{{ this.entity_id }}"
            data:
              stop_actions: false
          - delay:
              minutes: !input silence_timer
          - service: automation.turn_on
            target:
              entity_id: "{{ this.entity_id }}"

Ahh there you go. So it has an override.

Yeah, I had to wrap my mind around why this worked (as intended) and yet they say the .turn_off call normally stops runs.

Thanks a bunch, I must have been blind all the way. I looked at least 4 times and always skipped this line. :man_facepalming:

Hi Experts,
Sorry I am new here.
I cannot add the blueprint to my HA.
After I click preview it show “Timeout”
Is there some issue with the link?
I have tried the org post and can import the blueprint

Could you please take a look on this issue?

Thanks

I copy the code to github gists and can link now. Thanks

Experiencing a delay in receiving the notification on beta compared to the stable channel so will be switching back. Using with latest beta of Frigate.

Yeah I’ve got to work out what’s causing this. I see it too.

Not that the current stable is the previous beta. So you’ll need to manually grab an older file

Appreciate your continuing work on the blueprint. I grabbed the stable a few days ago before the switch I believe, so have a working version currently.

I have a question for the custom button on the beta, which is a promising addition but I can’t figure out how to incorporate the below app intent (Open tinycam pro and display a stream).

      - action: URI
        title: View Live
        uri: >-
          intent:#Intent;action=android.intent.action.MAIN;component=com.alexvas.dvr.pro/com.alexvas.dvr.activity.LiveViewActivity;S.com.alexvas.dvr.intent.extra.shortcut.NAME=CAMERA_NAME;end

Ideally I’d like to bring this into my stable version but my experience with HA YAML is limited.

Anyone keen to test the new frigate 0.14 review method of alerting can follow this pull request.

Frigate 0.14 by SgtBatten · Pull Request #216 · SgtBatten/HA_blueprints (github.com)

Hello and congratulations, I am completely ignorant on the subject but I wanted to know if there is a way to get notifications only when the degree of detection exceeds a certain veracity typical after 75%. It should be top_score. Thanks

All of a sudden, getting ERR_INVALID_RESPONSE on all snapshots/clips and not sure where to start to debug this, on mobile as well as pc chrome browser.

Any help appreciated.

Frigate 0.14.0-859682c
Frigate Notification 0.12.0.4g
Frigate Integration 5.2.0

Thanks!

Just to update, I have tried…
Uninstall and reinstall frigate integration
Used IP and FQDN
Deleted and readded frigate server
Updated frigate server to latest beta

I tried the Frigate Notifications (0.12.0.4a) with pretty much all the default settings but it doesn’t seem to be working at all. It never gets triggered and when I run the automation no notification is delivered to my phone.

I’m new to looking at the traces but it appears that it takes the far right path which goes straight to the bottom or end. Any suggestions on what I can look for/adjust to get going in the right direction?

Only on stable. Search this thread, there are examples of using top score