Frigate Mobile App Notifications 2.0

I havent tried it - is there a way?

I don think there is, which is why I asked, because I suspect you cant view webpages on the watch and therefore the action buttons won’t load anything.

I don’t get a notification to run.
There is simply nothing. There is only one device (Android-Smartphone) that should receive notification.
As a test, I try to get notifications from at least one camera without success.

alias: Notification
description: ""
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    camera: camera.front
    notify_device: *** (my ID-Device)

Tried it with and without camera. So only “front” or camera.front
Tried it with base_url: (internal IP of my HA)

Running HomeAssistant on my Rpi 4 with Frigate, Frigate Integration and so on. All newest stable version.

If the traces don’t show any triggers at all then you need to look at the prerequisite items like your MQTT setup.

No, the notifications work. But strangely, there are no notifications when you click on “Run” under Automations. Thank goodness for your notification. The built-in one from HA is far too complicated.

Thanks for work.

It is normal that this can’t be run manually so that’s okay.

Hello,
I would like to send the snapshot to my google home device.

To do it I need to know, in some way what the ID is.
value: '{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg'
so that I could use an action like this

action:
  - service: media_player.volume_set
    data:
      volume_level: 0.64
    target:
      entity_id: media_player.cucina
  - service: media_player.play_media
    data:
      media_content_id: >-
        https://{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg
      media_content_type: image/jpeg
    target:
      entity_id: media_player.cucina

but I need to know how to get the id.
Thanks for your support

The notification is to an Amazon FireTV stick or to an android TV?

do you mind to share your script?

From Mqtt messages the same way this blueprint does.

I decided to use Google Chromecast since it’s unused device on my TV and won’t interrupt any playback that might be occurring on the TV, that way I can pause my android TV and resume after the automation is done playing the video/image on the TV.

The script starts by saving the state/input of my TV displaying the live video for 15 seconds, then displays the latest person still snapshot from frigate. Rather than using the specific event and querying frigate for the image, I use the mqtt entity it exposes in HomeAssistant. In my case that’s the doorbell_person entity which contains an attribute that has the HomeAssistant url path, I use this as the source to pass to the media_player service which plays on my TV and Google nest. Finally the automation changes the TV state/input back if necessary and resumes playback if it was playing before, it waits until my occupancy sensor detects someone to resume playback in case we are still at the door attending to whoever came by. It’s also important to only run this custom action in the blueprint if it hasn’t triggered in the last X minutes matching your cooldown period configured in the blueprint. If you use zones/object filters in the blueprint you need to run the custom action on both initial and in the loop (still with the conditions to check last time it ran)

The frigate mqtt entities for your zones/objects should display on the default dashboard so you can see what it would be using. If you want to use clips instead of snapshots or live video then I think you’ll have to use the frigate API using mqtt event data. In my case it was just easier to use the existing frigate entities in HomeAssistant.

Here’s the automation, if you or anyone else has any improvements please post back :wink:

For implementing in the Blueprint it’s important to trigger it via a script that just acts as a wrapper for calling the automation so that it runs in the background and doesn’t block the blueprint from continuing else you’re notifications won’t run until this automation completes.

The automation will need to be adjusted based on your devices, since mine involve my TV, Chromecast, Nest screen, and Android TV box/remote.

alias: Trigger Show Doorbell Automation
sequence:
  - service: automation.trigger
    data:
      skip_condition: false
    target:
      entity_id: automation.show_doorbell_camera
mode: single
alias: Show Doorbell Camera
description: ""
trigger: []
condition: []
action:
  - alias: Save state
    variables:
      roku_input: |
        {{ states('sensor.65_tcl_roku_tv_active_app_id') }}
      roku_remote_state: |
        {{ states('remote.65_tcl_roku_tv') }}
      fibe_state: |
        {{ states('media_player.fibetv') }}
  - if:
      - condition: state
        entity_id: remote.65_tcl_roku_tv
        state: "off"
    then:
      - delay:
          hours: 0
          minutes: 0
          seconds: 3
          milliseconds: 0
      - service: remote.turn_on
        data: {}
        target:
          entity_id: remote.65_tcl_roku_tv
    alias: Turn TV on if its off
  - alias: Pause Bell if playing
    if:
      - condition: state
        entity_id: media_player.fibetv
        state: playing
    then:
      - service: remote.send_command
        data:
          num_repeats: 1
          delay_secs: 0.4
          hold_secs: 0
          command: MEDIA_PAUSE
        target:
          entity_id: remote.fibetv
  - if:
      - condition: time
        after: "22:00:00"
        before: "10:00:00"
    then:
      - service: media_player.play_media
        data:
          media_content_type: image/jpeg
          media_content_id: http://192.168.2.100:5001/api/doorbell
        target:
          entity_id:
            - media_player.chrome_alone
    else:
      - service: media_player.play_media
        data:
          media_content_type: image/jpeg
          media_content_id: http://192.168.2.100:5001/api/doorbell
        target:
          entity_id:
            - media_player.kitchen_display
            - media_player.chrome_alone
    alias: Cast to both kitchen/tv if it's between 9 am and 10 pm
    enabled: true
  - delay:
      hours: 0
      minutes: 0
      seconds: 12
      milliseconds: 0
    enabled: true
  - alias: Cast IMAGE to both kitchen/tv if it's between 9 am and 10 pm
    if:
      - condition: time
        after: "22:00:00"
        before: "10:00:00"
    then:
      - service: media_player.play_media
        data:
          media_content_id: >
            {{ "http://192.168.2.100:8123" +
            state_attr("camera.doorbell_person", "entity_picture") }}
          media_content_type: image/jpeg
          entity_id:
            - media_player.chrome_alone
    else:
      - service: media_player.play_media
        data:
          media_content_id: >
            {{ "http://192.168.2.100:8123" +
            state_attr("camera.doorbell_person", "entity_picture") }}
          media_content_type: image/jpeg
          entity_id:
            - media_player.kitchen_display
            - media_player.chrome_alone
  - delay:
      hours: 0
      minutes: 0
      seconds: 15
      milliseconds: 0
  - service: media_player.turn_off
    data: {}
    target:
      entity_id:
        - media_player.kitchen_display
        - media_player.chrome_alone
  - if:
      - condition: template
        value_template: >-
          {{ roku_input != states("sensor.65_tcl_roku_tv_active_app_id") and
          roku_input != "unknown" }}
      - condition: template
        value_template: >-
          {{ ["off", "standby"] | contains(roku_remote_state | lower) == False 
          }}
    then:
      - service: media_player.select_source
        data:
          source: "{{ roku_input }}"
        target:
          entity_id: media_player.65_tcl_roku_tv
      - delay:
          hours: 0
          minutes: 0
          seconds: 4
          milliseconds: 0
  - if:
      - condition: template
        value_template: "{{ [\"off\", \"standby\"] | contains(roku_remote_state | lower)  }}"
    then:
      - service: remote.turn_off
        data: {}
        target:
          entity_id: remote.65_tcl_roku_tv
  - alias: Play Bell if it was paused
    if:
      - condition: template
        value_template: "{{ fibe_state == \"playing\" }}"
    then:
      - wait_template: "{{ states(\"binary_sensor.front_door_contact\") == \"off\" }}"
        continue_on_timeout: true
      - wait_template: "{{ states(\"binary_sensor.living_room_occupancy_presence\") == \"on\" }}"
        continue_on_timeout: true
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
          milliseconds: 0
      - service: remote.send_command
        data:
          num_repeats: 1
          delay_secs: 0.4
          hold_secs: 0
          command: MEDIA_PLAY
        target:
          entity_id: remote.fibetv
mode: single

Hello, I am having trouble with the camera select.
My Frigate config has a single camera named ‘garage’ but the blueprint says no cameras found. I have frigate up and running with screenshots and recordings working. What might be the issue?

The quickest solution for you is to edit it in yaml mode and add camera: camera.garage

But the reason is due to not having the frigate have integration configured.

Thank you for the quick reply, and sorry for double-posting! Will try editing the yaml now :slight_smile:

I did that in Line 686 but when I try to edit the blueprint it still says camera entity missing…

You should add it to the automation not the blueprint.

…really learning a lot today. I managed to install the HACS integration now and was able to select my camera. Thank you, again for your help, it seems to work now :smiley:

1 Like

Thanks ctml.
below what I was used so far on my google home device but now I will study your YML to see if I could use my Sony TV

alias: Alert from Frigate Piazzale
description: Light and Video Alert from Frigate Piazzale
trigger:
  - platform: state
    entity_id:
      - binary_sensor.zone_1_person_occupancy
    from: "off"
    to: "on"
condition: []
action:
  - service: tts.cloud_say
    data:
      cache: false
      entity_id: media_player.cucina
      message: >-
        Attenzione, un intruso nel piazzale. Ripeto, un intruso è stato
        avvistato nel piazzale
  - wait_template: "{{ is_state('media_player.cucina','idle') }}"
    continue_on_timeout: true
  - service: media_player.volume_set
    data:
      volume_level: 0.7
    target:
      entity_id: media_player.cucina
  - service: media_player.play_media
    data:
      media_content_id: >
        {{ "hassio" + state_attr("camera.piazzale_1_person",
        "entity_picture") }}
      media_content_type: image/jpeg
    target:
      entity_id: media_player.cucina
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - service: tts.cloud_say
    data:
      cache: false
      entity_id: media_player.cucina
      message: Ripeto, un intruso era stato avvistato nel piazzale
  - wait_template: "{{ is_state('media_player.cucina','idle') }}"
    continue_on_timeout: true
  - service: media_player.turn_off
    data: {}
    target:
      entity_id: media_player.cucina
  - service: tts.clear_cache
    data: {}
mode: single

Sound it is a binary sensor, can be used in any automation, I have crying sound enabled in frigate and an automation to send an announcement to nest hubs and work pretty well.

It doesn’t really trigger well for me. I created an MQTT sensor for the sound level, when it exceeds 3000 then I get alerted there is a sound in the room and turns on the videostream.

@ctml I suppose fibetv is your TV and kitchen_display is Google Nest and 65_tcl_roku_tv is another TV you want to use only during the day, but
what chrome_alone is.
Thanks