Skip to content

[amazonechocontrol] Handle PUSH_DND_STATE_CHANGE push messages - #21516

Open
ML19821 wants to merge 1 commit into
openhab:mainfrom
ML19821:fix/amazonechocontrol-dnd-state-push
Open

[amazonechocontrol] Handle PUSH_DND_STATE_CHANGE push messages#21516
ML19821 wants to merge 1 commit into
openhab:mainfrom
ML19821:fix/amazonechocontrol-dnd-state-push

Conversation

@ML19821

@ML19821 ML19821 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Toggling do-not-disturb on a device sends PUSH_DND_STATE_CHANGE over the push stream. That command is not in the switch which routes the per-device pushes, so every toggle lands in the unknown-command branch and logs a WARN (#21339). The doNotDisturb channel only catches up on the next data refresh, up to an hour later.

The event is a well-formed per-device message, so it is now routed like the other per-device pushes and updates the channel directly.

I cannot verify this on my own installation: all my Alexa devices are Sonos-based and Amazon sends no push events for those. @clinique, who reported it, has been running a test build since 26 August. That build carries this change unchanged; it was built before three unrelated notification-poll changes landed in main. What would confirm it:

  • Link a Switch item to doNotDisturb on one Echo, then toggle do-not-disturb on the device or in the Alexa app — not from openHAB.
  • The item should follow within a second or two. That timing is the evidence: coming from the data refresh it would take up to an hour.
  • Detected unknown command from activity stream: PUSH_DND_STATE_CHANGE should be gone from the log.
  • A counter-check in the other direction: sending ON and OFF from openHAB must still work. The command path is untouched, and this patch only adds the state side.

Two unit tests cover the channel update in both directions. Full bundle suite green (170 tests), static analysis clean.

Fixes #21339

Transparency: this patch and the comments on this PR were written with AI assistance (Claude); every commit carries an AI-assisted-by trailer. All changes were built and tested by the author; the push path itself is the part that needs a second installation to confirm. Reviewed against wborn/github-review-policy at ca8d3f4d0 (2026-08-19) before submission.

Toggling do-not-disturb on a device made every such push land in the
unknown-command branch and log a WARN (openhab#21339). The event is a
documented, well-formed per-device message, so it is now routed like
the other per-device pushes and updates the doNotDisturb channel
directly instead of waiting for the next poll.

Signed-off-by: Martin Littkovsky <2018turtle@proton.me>
AI-assisted-by: Claude Code
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.

[amazonechocontrol] New Warning message

1 participant