I am using alerts to alert me on the garage being opened. I created an actionable notification to be able to acknowledge the alert. However, it seems this actionable notification appears even after the alert is fixed, which makes complete sense, however it doesn’t make sense to have a notification that says “Silence alert” after the alert is no longer active. I’m assuming what i have below won’t work as the vscode plugin is already giving me errors. However, i’m curious if anyone has idea on how I can accomplish what i’m saying.
garage_left_open:
name: Garage is open
title: "🚨 Alert"
done_message: "Garage is closed"
message: "Garage left opened"
entity_id: input_boolean.alert_garage_open
state: "on"
repeat: 1
can_acknowledge: true
skip_first: false
notifiers:
- me
data:
push:
sound:
name: "default"
critical: 1
volume: 1.0
actions:
- action: {% if is_state("input_boolean.alert_garage_open", "on") -%} "ALERT_GARAGE_OPEN_ACKNOWLEDGE" {%- endif %}
title: "Silence alert" # The button title
To help you further, I’d like to see your other components of that alert. The configuration for the input_boolean, and for the automation that is triggered when you press the notification. And how is your notifier configured (`“me”)?
If I understand you correctly, your alert is working as it should, just the acknowledge isn’t working, right?
For that you’d need an automation, that gets triggered by your action coming from the notification. And while we’re at it, what should happen, if the alert is going off? Should the notification stay on the phone, or should it get deleted?
The theoretical way would be like this:
input_boolean turns to true
alert is triggered and switches to ‘on’
notification gets send to the phone
you can acknowledge the notification by sending back an action to HA
this action triggers an automation to acknowledge the alert
notification stays as long as the alert is active OR it gets deleted by acknowledging
Anyway, if you post the code of your automation, I can give you a helping hand in setting this up! I have my system running like this, and it works as it should. If I acknowledge the notification, the message goes away, but I still get a new notification when the alert is actually cleared. After five minutes, that notification gets deleted automatically.