Skip to content

fix: action call data takes precedence over scenario and delivery data#70

Open
lollox80 wants to merge 3 commits intorhizomatics:mainfrom
lollox80:fix/notification-delivery-override
Open

fix: action call data takes precedence over scenario and delivery data#70
lollox80 wants to merge 3 commits intorhizomatics:mainfrom
lollox80:fix/notification-delivery-override

Conversation

@lollox80
Copy link
Copy Markdown
Contributor

@lollox80 lollox80 commented Mar 27, 2026

Summary

Fixes two bugs in notification delivery override handling and corrects
the priority order of envelope_data construction.

Problems

Bug 1 — override enabled:true ignored when scenario disables delivery

If a scenario disabled a delivery via enabled: false, an explicit
enabled: true in the action call had no effect. The delivery was
silently skipped.

Bug 2 — person_id in delivery target override not resolved

When a per-delivery target override used person.* references, they
were not expanded to mobile_app_* device targets. The delivery
was sent to no targets.

Bug 3 — scenario data overrides action call data

envelope_data was built with scenario customizations applied last,
meaning scenario-level keys (e.g. volume: 0.0, message_template)
silently overrode explicit values passed by the caller. For example,
passing volume: 0.5 in a delivery override had no effect when
late_night scenario set volume: 0.0.

Fix

Priority order (lowest → highest):

Fix

Priority order (lowest → highest):
delivery.data → scenario.data → action_call.data → target.data

  • Bug 1: override_enable_deliveries now excluded from all_disabled
  • Bug 2: resolve_indirect_targets now applied to override target
  • Bug 3: Scenario customizations applied before action call data

Testing

Tested on Home Assistant OS 17.1 / Core 2026.3

  • Verified: explicit enabled: true overrides scenario enabled: false
  • Verified: person.lorenzo resolves to all mobile_app_* devices
  • Verified: volume: 0.5 in action call overrides volume: 0.0 from late_night scenario

- envelope_data now built in correct priority order:
  delivery.data < scenario.data < action_call.data < target.data
- action call overrides (volume, message_template, etc.) now correctly
  override scenario-level data (e.g. late_night volume=0 whisper)
- ATTR_CHANNEL_MESSAGE added to const.py and imports
- ATTR_SPOKEN_MESSAGE removed (obsolete, replaced by channel_message)
@lollox80 lollox80 force-pushed the fix/notification-delivery-override branch from 9929501 to 6d9d495 Compare March 27, 2026 22:50
ATTR_SPOKEN_MESSAGE was removed from imports when ATTR_CHANNEL_MESSAGE
was added, but INTERNAL_DATA_KEYS still references it. Add both imports.
@lollox80 lollox80 force-pushed the fix/notification-delivery-override branch from 1e3db91 to 11b0a5c Compare March 27, 2026 23:45
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