[amazonechocontrol] Reach the voice history without push events - #21514
Open
ML19821 wants to merge 1 commit into
Open
[amazonechocontrol] Reach the voice history without push events#21514ML19821 wants to merge 1 commit into
ML19821 wants to merge 1 commit into
Conversation
lastVoiceCommand is written only when a push event announces a spoken command. On an account whose push connection no longer delivers those events the channel stays empty for good, because the binding never asks for the voice history on its own. - activityRequestWindow (advanced, default 120 s, the value that was hardcoded) sets how far back a request reaches. - activityPollingInterval (advanced, default 0 = off) requests the voice history on a timer, for accounts without push. A warning names the case where the window is shorter than the interval, which would drop the commands spoken in between. - refreshActivity answers ON while the request runs and OFF when it is done, so a rule can tell the two apart. The channel is no longer documented as write-only. - An explicitly requested record is delivered even when it predates the handler start, which the guard against replayed push events would otherwise drop. Only the newest record per device is delivered, so one press updates the channel once instead of once per record in the window. - maxRecordSize is gone from the request: measured against the live endpoint, 1, 2, 5 and omitting it all return the same fixed page of ten records. Signed-off-by: Martin Littkovsky <2018turtle@proton.me> AI-assisted-by: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lastVoiceCommandis written only from the push stream, so on an account whose push connection is dead the channel stays empty for good.activityRequestWindow(advanced, default 120 s — the value that was hardcoded) sets how far back a request reaches.activityPollingInterval(advanced, default 0 = off) requests the voice history on a timer, for accounts without push. Home Assistant's Alexa integration polls at 60 s; below that I would not go.refreshActivityanswers ON while the request runs and OFF when it is done, and is no longer documented as write-only.EchoHandler. Only the newest record per device is delivered, so one press updates the channel once instead of once per record in the window.maxRecordSize=1is gone: measured against the live endpoint, 1, 2, 5 and omitting it all return the same fixed page of ten records.Tested on openHAB 5.2.1 against two Amazon accounts. One is a tester's with 16 Echo devices and no push connection; his
lastVoiceCommandhas been working again for a day and 18 polls at a 10 s interval all answered 200. On mine, one press with a ten-day window returned nine records across three devices and updated each device's channel exactly once. 179 unit tests pass, static analysis is clean.Fixes: #21513
Transparency: this patch and the comments on this PR were written with AI assistance (Claude); every commit carries an
AI-assisted-bytrailer. All changes were built, tested and verified on a production system by the author. Reviewed against wborn/github-review-policy atca8d3f4d0(2026-08-19) before submission.