Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Config Support]: Shared Cooldown for all Blueprint automations created #348

Open
RyanPieters opened this issue Jan 20, 2025 · 7 comments
Open

Comments

@RyanPieters
Copy link

RyanPieters commented Jan 20, 2025

Describe the problem you are having or the outcome you are trying to achieve.

Hello,

I seem to be having trouble getting two notifications popping off at once. I did some trial and error and it very much seems that the "cooldown" within the UI is shared across all automations that I create.

I had a look in source and it looked like a name could be assigned for each cooldown. I tried that, but alas, I got the same result.

Testing:
I have two cameras and have set up an automation for each of them, notifying a device on a 30 second cooldown.

Running like a lunatic between the cameras, I immediately get the notification for the first, but it seems the second one only arrives 30 seconds later, even though they are two separate cameras on two separate automations.

I hope the above makes sense, and I appreciate any assistance on the matter.

Version

0.12.0.6

Automation config

##Front Yard One
description: ""
alias: Frigate Notifications (0.12.0.6)
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    presence_filter:
      - ""
    camera:
      - camera.front_yard_1
    notify_device: xxx19f46e5d6xxxba8fxxxd41ebfxxxx ##Hidden some chars
    cooldown: 30

##FY2 is duplicated, with only camera being updated.

##Edit: Might also be worth including my full config I ran on v.0.12.0.4a per camera (which worked without issues):
alias: Frigate Notifications - Front Yard 1
description: ""
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    camera:
      - camera.front_yard_1_1
    notify_device: xxx19f46e5d6xxxba8fxxxd41ebfxxxx ##Hidden some chars
    message: "{{ label }} detected - {{ camera_name }}"
    update_sub_label: false
    alert_once: true
    attachment: snapshot.jpg?crop=1
    update_thumbnail: true
    color: "#f44336"
    icon: mdi:cctv
    disable_times:
      - "6"
      - "7"
      - "8"
      - "9"
      - "10"
      - "11"
      - "12"
      - "13"
      - "14"
      - "15"
      - "16"
      - "17"
      - "18"
      - "19"
    notify_group: notify.all_mobile_devices
    zone_filter: false
    cooldown: 180
    button_1: View Snapshot
    url_1: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/snapshot.jpg"
    presence_filter:
      - ""

Frigate Config

Any other information that may be helpful

This had previously worked on v.0.12.0.4a, all of my automations functioned independently and I could get up to 7 notifications at once for all my cameras.

@SgtBatten
Copy link
Owner

This is resolved in the upcoming beta. I'll try to port it over to stable for you

@RyanPieters
Copy link
Author

Much appreciated @SgtBatten 🙏. Will await feedback.

@RyanPieters
Copy link
Author

@SgtBatten, just want to make sure that by upcoming Beta, did you mean a version later than 0.12.0.6a? I've tried this version on the two cameras today and I'm still having the same issue.

However, I did notice that the two automations are triggering simultaneously, even if I'm only detected on the one camera (FY1), which makes no sense to me.

Image

Adding my YAML above for the two as well.

Thanks very much and if there's anything I can do to assist, please let me know 👍

## Front Yard 1 Camera
alias: Frigate Notifications (0.12.0.6a) - FY1 Test
description: ""
use_blueprint:
  path: SgtBatten/Beta.yaml
  input:
    presence_filter:
      - ""
    camera:
      - camera.front_yard_1
    notify_device: Devicexxxxxx
    base_url: HA URL
    cooldown: 30

## Front Yard 2 Camera
alias: Frigate Notifications (0.12.0.6a) - FY2 Test
description: ""
use_blueprint:
  path: SgtBatten/Beta.yaml
  input:
    presence_filter:
      - ""
    camera:
      - camera.front_yard_2
    notify_device: Devicexxxxxx
    base_url: HA URL
    cooldown: 30

@SgtBatten
Copy link
Owner

All the mqtt messages go to the same topic so that's why it triggers twice. I was under the impression conditions would stop the trigger from registering but I guess not which is unfortunate.

If you really must stick with the events topic and use a cooldown then you will need to roll back or edit the blueprint to be single camera logic again where is checks the mqtt message for the camera name during the trigger process. Unfortunately HA doesn't allow the necessary template to filter based on the camera within the trigger now that we have the multi camera setup.

@RyanPieters
Copy link
Author

Thanks for the info @SgtBatten, I'll have a look and see what I can do with regards to the events topic, if all else fails I'll perform the rollback of the blueprint.

@RyanPieters
Copy link
Author

Thanks for the advice, changing/splitting the frigate/events topic to be camera specific allowed me to assign a custom MQTT topic for each Automation.

I have used the Node-RED addon in HA to split the topics:

Image

I'm hoping the above helps others new to HA/Frigate as well 😊.

Thanks again @SgtBatten.

@SgtBatten
Copy link
Owner

Impressive. Thanks for sharing, This is great info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants