Skip to content

Tag snooze matches the automation or script that sent the notification - #270

Merged
jeyrb merged 3 commits into
rhizomatics:mainfrom
lollox80:feat/snooze-tag-sender
Oct 7, 2026
Merged

jeyrb merged 3 commits into
rhizomatics:mainfrom
lollox80:feat/snooze-tag-sender

Conversation

@lollox80

@lollox80 lollox80 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

A TAG snooze now also matches the automation or script that sent the notification, by its entity_id, object_id, friendly name or alias, the same way it already matches the entity_id in the data or the camera.

Why

I wanted to pause one noisy notification for an hour, e.g. a thermostat going offline and back online every few minutes. The tag snooze already does this, but only for calls that pass entity_id in their data. In my archive that is 7 of the last 100 notifications. All 100 came from an automation or script, and the sender was identifiable in every case. With this change, pause garage closed for an hour works for any notification raised by automation.garage_closed (by voice, AI tool, supernotify.snooze with scope: tag, or a mobile action), with nothing added to the notify call.

How

  • HomeAssistantAPI.sender_entity_ids(context): the automation.* / script.* states whose context is the call's context or its parent. An automation writes its state with the context of the run it starts, and that run's actions carry the same context. A script started by an automation has it as parent, so both count.
  • Notification.snooze_tags() adds the senders. They are looked up only when a tag snooze is active (Snoozer.has_tag_snooze()), and once per notification, because a later run of the same automation changes the context its state carries.
  • Docs (usage/snoozing.md) and CHANGELOG under Unreleased.

No new config, no change for anyone without a tag snooze.

Tests

  • test_tag_snooze_matches_the_sending_automation: snoozed by the automation's entity_id; another automation's notification and one without context still go out.
  • test_tag_snooze_matches_a_script_started_by_an_automation: the script's run has the automation as parent; snoozed by the script's friendly name; both are senders.
  • Both fail on main.

CI replica: py3.14 / HA 2026.9.3: 2345 passed, coverage 97%; ruff, format, codespell, mypy clean on both lanes. py3.13 / HA 2026.2.3: 2305 passed; the same 3 missing-action tests fail as on main at 3628dda (the lane issue #266 addresses).

Related to the tag design in #254: this gives every automation-raised notification a tag without a new top-level key.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DUP2qytcsLgRptSv1oR6TY

The sender is the automation or script whose state carries the call's
context (or its parent, for a script started by an automation). Looked up
only while a tag snooze is active, once per notification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DUP2qytcsLgRptSv1oR6TY
lollox80 added a commit to lollox80/supernotify-cards that referenced this pull request Oct 7, 2026
archive 0.40.0: pause_sender: true offers the sender (from the logbook) next to
the entity, so almost every notification can be paused. Needs SuperNotify with
rhizomatics/supernotify#270 (off by default). Fix: a pause made during a read
of the pauses showed as not made until the next read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DUP2qytcsLgRptSv1oR6TY
@jeyrb
jeyrb merged commit 8fd7470 into rhizomatics:main Oct 7, 2026
10 of 11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants