Multiple notifications

Hi all
Im struggling with understanding notifications I have the below but not all works. I get the alexa notification but not the tts.
Im trying to get a TTS announcement on my phone and the snapshot image and local notification on an alexa device.
Im obviously doing it wrong any advice please.

automation:
  - alias: Notify of events

    trigger:
      platform: mqtt
      topic: frigate/events
    action: 
      - service: notify.alexa_media_kitchen_echo_show
        data_template:
          message: A Person has been Detected at the front door.
          data:
            type: announce
            method: all
    trigger:
      platform: mqtt
      topic: frigate/events
    action:
      - service: notify.mobile_app_sm_n960f
        data_template:
          message: 'A {{trigger.payload_json["after"]["label"]}} was detected.'
          data:
            image: 'https://7k2zezkmoid2mfmuenyj4nzstlyb4qnf.ui.nabu.casa/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg?format=android'
            tag: '{{trigger.payload_json["after"]["id"]}}'
            ttl: 0
            priority: high
            channel: "alarm_stream_max"
    trigger:
      platform: mqtt
      topic: frigate/events
    action:
      - service: notify.mobile_app_sm_n960f
        data_template:
          message: TTS
          title: 'A {{trigger.payload_json["after"]["label"]}} has been detected at the front door.'
          data:
            ttl: 0
            priority: high
            channel: "alarm_stream_max"
1 Like

Does that even pass the config checker? I would be surprised if so.

you only need one trigger section in the automation.

then add all the actions in the action section.

Also data_template isn’t used any more. it’s just data now.

automation:
  - alias: Notify of events
    trigger:
      platform: mqtt
      topic: frigate/events
    action: 
      - service: notify.alexa_media_kitchen_echo_show
        data:
          message: A Person has been Detected at the front door.
          data:
            type: announce
            method: all
      - service: notify.mobile_app_sm_n960f
        data:
          message: 'A {{trigger.payload_json["after"]["label"]}} was detected.'
          data:
            image: 'https://7k2zezkmoid2mfmuenyj4nzstlyb4qnf.ui.nabu.casa/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg?format=android'
            tag: '{{trigger.payload_json["after"]["id"]}}'
            ttl: 0
            priority: high
            channel: "alarm_stream_max"
      - service: notify.mobile_app_sm_n960f
        data:
          message: TTS
          title: 'A {{trigger.payload_json["after"]["label"]}} has been detected at the front door.'
          data:
            ttl: 0
            priority: high
            channel: "alarm_stream_max"

yes it passes and runs 2 of the 3 notications

I don’t think you can send a TTS to the HA mobile apps (but I could be wrong, do you have a reference mentioning that capability?).

There are other threads mentioning options for that.

Introduction | Home Assistant Companion Docs (home-assistant.io)

specifically

automation:
  - alias: "Notify of Motion TTS alarm"
    trigger:
      ...
    action:
      - service: notify.mobile_app_<your_device_id_here>
        data:
          message: TTS
          title: "Motion has been detected"
          data:
            channel: "alarm_stream"

plus that notification is working on my phone. I dont know if its just because its the last one.

Update
TTS now working
also added a delay so I only get 1 notification per minute

  - alias: Notify james mobile TTS on person front door
    trigger:
      platform: mqtt
      topic: frigate/events
    action:
      - service: notify.mobile_app_sm_n960f
        data:
          message: TTS
          title: 'A {{trigger.payload_json["after"]["label"]}} has been detected at the front door.'
          data:
            ttl: 0
            priority: high
            channel: "alarm_stream_max"
      - delay:
          minutes: 1

I have recently installed and started using Frigate. I’ve set up the MQTT notifications too and I’ve also noticed that from a single event I’ll get multiple notifications. In the Frigate docs it shows this:

    # Optional: timeout for highest scoring image before allowing it
    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60

I thought it would hold off on sending any MQTT announcements before picking the image to include but adding this timeout didn’t seem to do anything about the onslaught of notifications I get when a camera gets triggered. Usually, I’ll get 2-4 notifications on the same incident. Is there some way to adjust a “lock-out” for the camera trigger? I’d like to set it to something like 30 seconds to a minute.

Thanks,
-Greg

After running Check Configuration, it may report Configuration Valid but then check Logs where you will see something like this:

YAML file /config/automations/_automations.yaml contains duplicate key “trigger”. Check lines 3 and 13

20:27:25 – (WARNING) util/yaml/loader.py - message first occurred at 20:27:25 and shows up 4 times

That’s what I get when I test my configuration with your malformed automation.

An automation can only have one trigger section and and one action section. Fix your automation (see finity’s suggestion).

For more information, refer to the documentation:

Thankyou all
I have chnaged to the following

- id: '1605123353940847'
  alias: Notify james mobile TTS on person front door
  trigger:
    platform: mqtt
    topic: frigate/events
  action:
  - service: notify.mobile_app_sm_n960f
    data:
      message: TTS
      title: A {{trigger.payload_json["after"]["label"]}} has been detected at the
        front door.
      data:
        ttl: 0
        priority: high
        channel: alarm_stream_max
  - delay:
      minutes: 1

I have also started using the frigate blue print for notifications. That works brilliantly apart from 1 thing. The TTS notification comes through within about 10 seconds the blue print one can be similar or 10 minutes later. Im assuming its because its missing this bit

      data:
        ttl: 0
        priority: high
        channel: alarm_stream_max

But i dont as yet see a way to modify the blueprint, or see the yaml it genertates

What you posted above is an automation, not a blueprint (they’re two different concepts). When you say “blueprint” are you referring to the automation you posted or to a separate blueprint that you have not posted yet?