Skip to content

[amazonechocontrol] Reach the voice history without push events - #21514

Open
ML19821 wants to merge 1 commit into
openhab:mainfrom
ML19821:feat/amazonechocontrol-voice-history-polling
Open

[amazonechocontrol] Reach the voice history without push events#21514
ML19821 wants to merge 1 commit into
openhab:mainfrom
ML19821:feat/amazonechocontrol-voice-history-polling

Conversation

@ML19821

@ML19821 ML19821 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

lastVoiceCommand is 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.
  • refreshActivity answers ON while the request runs and OFF when it is done, and is no longer documented as write-only.
  • A record delivered by an explicit refresh is no longer dropped by the startup guard in 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=1 is 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 lastVoiceCommand has 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-by trailer. All changes were built, tested and verified on a production system by the author. Reviewed against wborn/github-review-policy at ca8d3f4d0 (2026-08-19) before submission.

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
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] lastVoiceCommand stays empty on accounts without a working push connection

1 participant