I’m building an automation that notifies users but lets each person snooze their own alerts for an hour.
What I have so far
i have it setup so the notification goes out with an action item to snooze the notification for 1hr. This all works great and i can get it to work to disable the notification for everyone, but im trying to get it so each user can disable it independent of the other users.
What I need
Each user should be able to snooze only their own, per alert/notification alerts, independent of others.
Why the obvious fix won’t scale
Creating a separate helper (input boolean/toggle) for every user × sensor combo will explode as we add more people and sensors.
Node‑RED solution
I have a solution working using node-red by storying a dynamic var globally in the node runtime env. this me to dynamically create the disable flag based on the user and the event and then set the value to a timestamp. Next time the event happens i can check globally to see if the var exist and is before or after the timestamp.
Looking for ideas
Has anyone achieved user‑level snoozing with pure HA? Any patterns, blueprints, or template tricks would be hugely appreciated!
Came up with a native solution and thought to share here for others looking to do something similar.
For the snooze system i ended up using an input_select to manage snoozed notifications for each person. Here’s how it works:
Setup
Each person has an input_select (e.g., input_select.user_abc_snoozed_notifications). I associate the input_select with the user by adding a custom person attribute pointing to their input_select.
The input_select stores event_ids of snoozed notifications.
Snoozing Events
When a notification is snoozed, its event_id is added to the input_select options using input_select.set_options.
After the snooze duration (e.g., 1 hour or 24 hours), the event_id is removed from the options.
Checking Snooze Status
Before sending a notification, i check if the event_id is in the input_select options. If found, the notification is skipped.
Caveats
Whenever working with the input_select.set_options, you have to get the current list of options and modify it. You can’t just add a new item, otherwise you will override all existing options.
If your Home Assistant restart your tracked event_ids on the input_select will reset.
input_select vs input_text
Ease of Use: Directly manages lists without needing JSON parsing.
Readability: Options are visible in the UI for debugging.
Simplicity: Adding/removing options is straightforward with input_select.set_options.
input_text is limited to 255 characters, including JSON structure, that could be limiting on the number of event_ids that can be stored.
input_select options are stored as attributes. Attributes json is limited to 16kb (here), this means if you average 25‑30 chars per event id, you could fit roughly ~300–500 options. There is no hard limit for options that i can find other then the attributes json data size limit.
Their might be other limiting factors im not aware of that would make an input_text a better option, but for now this works great. I considered using hacs var, but im really trying to stay as native as i can.
I ended up creating several scripts to help manage all this for me:
notify_phone: accepts a person and other payload info, send notification
snooze_notification_listener: listens for the notification action
snooze_notification snoozes a notification, will reset snooze after given time has passed