recently I created a notification which reminds me to take a pill every morning and evening and it repeats every five minutes until I take it (means until I set the input_boolean as off via actionable button in notification itself).
That is working fine but I would like to take it a bit further. There are situations I cannot do it within 5/10/15 and so minutes. I do have two actions there. One is to turn on the reminder and the other one is to turn it off which is a part of the repeat section. To make it work since beginning before the repeat section I turn the reminder helper on so “postpone” action is actually doing nothing right now and I want to change it.
I want the notification being send at specific time morning/evening and repeat until I select “taken” from the action part in notification. When I select “postpone” it will pause the automation for let’s say 30 minutes and then runs it again. I am looking for a way to do it without another helper or automation if it is possible. Here is my script and automation itself.
alias: pill
sequence:
- action: notify.mobile_app_telefon
metadata: {}
data:
message: and drink water
title: Take your pill
data:
actions:
- action: taken
title: Taken
icon: sfsymbols:pill
destructive: true
- action: postpone
title: Postpone
icon: sfsymbols:clock
push:
sound: Spolkni prášek.wav
critical: 1
volume: 1
fields: {}
description: ""
icon: mdi:pill-multiple
Any ideas?
And as a bonus is there a way to clear all those previous notifications I did not take action on when I select “taken” or “postopne” - those which are related to this script/automation? Or a way to just repeat the sound without sending new notification?
Great! I didn’t know about this function, thank you.
Seems like it is doing exactly what I want. There is only one thing I cannot handle - the volume of the alert (which was not working in a script neither). I changed that from: critical: 1
to: interruption-level: critical
and the volume is really 100% which is a bit too much I didn’t find any update on this, I tried 0.5/0,5/50% but it is not changing anything. Is it doing something or it is useless?
Anyway here is the final setup for those who might be interested and didn’t hear about alerts yet, just like me. Alert itself is in alerts.yaml included into configuration.yaml (or can be written directly in configuration.yaml)
Alert:
pill:
name: Pill alert
message: and drink some water
title: Take your pill!
data:
actions:
- action: taken
title: Taken
icon: sfsymbols:pill
destructive: true
- action: postpone
title: Postpone
icon: sfsymbols:clock
push:
sound: Spolkni prášek.wav
interruption-level: time-sensitive ##want to use "critical" as it is bypass the muted phone but it is too loud
volume: 10% ##probably useless
tag: your-pill ##this tags the notification for clearing when done with done_message below and as that wanted bonus it does not create new when repeated but update the first one OR clear the previous one and create new - not really sure what is true
done_message: clear_notification ##actual clearing
entity_id: input_boolean.pill_reminder
state: "on"
repeat: 5
can_acknowledge: true
skip_first: false
notifiers:
- mobile_app_telefon