Skip to content

FIX(zone_notification_extended): add support for notify entities - #169

Open
thomasgeens wants to merge 1 commit into
panhans:mainfrom
thomasgeens:fix/zne/support-zone-entities
Open

FIX(zone_notification_extended): add support for notify entities#169
thomasgeens wants to merge 1 commit into
panhans:mainfrom
thomasgeens:fix/zne/support-zone-entities

Conversation

@thomasgeens

@thomasgeens thomasgeens commented Jul 10, 2026

Copy link
Copy Markdown

Route notifications through the modern notify.send_message action with an entity target when the notify service resolves to a notify entity, falling back to the legacy flat service: call inside the choose default otherwise.

Details that make the entity path work:

  • Render notify_service with a folded scalar (>-) and Jinja whitespace control so it produces a clean notify.<name> string; the previous literal block leaked newlines/indentation into the value.
  • Slugify the group input so display-cased names (e.g. "Iedereen") resolve to the real entity id.
  • Detect entities via states.notify | map(attribute='entity_id'); x in states is false for entities whose state is "unknown" - the resting state of an unused notify group.
  • Send only title + message on the entity path; notify entities reject the rich mobile_app payload (extra keys not allowed). The legacy fallback keeps the full payload.
  • Mark all notify steps continue_on_error: true so one unreachable local-push target (e.g. a display without an active websocket) doesn't abort the remaining automation steps.

Route notifications through the modern `notify.send_message` action with an
entity target when the notify service resolves to a notify entity, falling
back to the legacy flat `service:` call inside the choose default otherwise.

Details that make the entity path work:
- Render `notify_service` with a folded scalar (`>-`) and Jinja whitespace
  control so it produces a clean `notify.<name>` string; the previous
  literal block leaked newlines/indentation into the value.
- Slugify the group input so display-cased names (e.g. "Iedereen") resolve
  to the real entity id.
- Detect entities via `states.notify | map(attribute='entity_id')`;
  `x in states` is false for entities whose state is "unknown" — the
  resting state of an unused notify group.
- Send only `title` + `message` on the entity path; notify entities reject
  the rich mobile_app payload (extra keys not allowed). The legacy fallback
  keeps the full payload.
- Mark all notify steps `continue_on_error: true` so one unreachable
  local-push target (e.g. a display without an active websocket) doesn't
  abort the remaining automation steps.
@thomasgeens
thomasgeens marked this pull request as ready for review July 10, 2026 21:17
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.

1 participant