Improve Alexa debug logging by jbouwh · Pull Request #184241 · home-assistant/core · GitHub
Skip to content

Improve Alexa debug logging - #184241

Merged
chemelli74 merged 4 commits into
home-assistant:devfrom
jbouwh:alexa-improve-debug-logging
Oct 4, 2026
Merged

chemelli74 merged 4 commits into
home-assistant:devfrom
jbouwh:alexa-improve-debug-logging

Conversation

@jbouwh

@jbouwh jbouwh commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

<!-0000-
You are amazing! Thanks for contributing to our project!
Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
-->

Proposed change

Improves the debug logging of the Alexa integration to make it easier to troubleshoot Smart Home requests and proactive state reporting:

  • The "Received Alexa Smart Home request" log line now includes the entity ID the directive targets.
  • Every action called by an Alexa directive handler is logged with the directive (namespace and name), the action and the action data. The alarm code (PIN) is redacted.
  • When proactive mode is enabled, whether an entity is exposed or filtered by config is logged once per entity (and again only if its exposure changes), instead of logging every state change of a filtered entity.
  • A malformed request with a non-string endpointId (for example an integer) no longer crashes with an HTTP 500, but returns a NO_SUCH_ENDPOINT Alexa error response.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

🤖 Generated with Claude Code

Log the exposure decision once per entity, log every action call with
the triggering directive and redacted data, and include the entity ID
in the received request log line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@home-assistant

home-assistant Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

@chemelli74 chemelli74 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx !

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Exposure messages are suppressed when debug logging is enabled after ordinary state changes populate the cache.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Improves Alexa Smart Home troubleshooting through more informative debug logs.

Changes:

  • Adds target entity IDs to incoming request logs.
  • Logs directive-triggered actions with alarm PIN redaction.
  • Deduplicates proactive exposure messages per entity.
File Description
homeassistant/​components/​alexa/​state_report.py Caches exposure decisions to reduce repeated logs.
homeassistant/​components/​alexa/​smart_home.py Includes target entity IDs in request logs.
homeassistant/​components/​alexa/​handlers.py Centralizes action logging and PIN redaction.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread homeassistant/components/alexa/state_report.py Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 4, 2026 17:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 4, 2026 18:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 4, 2026 18:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chemelli74 chemelli74 added this to the 2026.10.0 milestone Oct 4, 2026
@chemelli74
chemelli74 merged commit 950fb34 into home-assistant:dev Oct 4, 2026
54 checks passed
raman325 added a commit to raman325/home-assistant that referenced this pull request Oct 5, 2026
* upstream/dev: (4246 commits)
  Log when Google Generative AI STT returns no text (home-assistant#180389)
  Bump pylamarzocco to 2.5.1 (home-assistant#184247)
  Add event status to remote_calendar (home-assistant#183849)
  Return HTTP 403 for MCP permission failures (home-assistant#184253)
  Split user flow init and data submission in rainmachine config flow tests (home-assistant#184164)
  Bump uiprotect to 23.0.0 (home-assistant#184233)
  Bump aioaxlevpp to 0.2.0 (home-assistant#184246)
  Improve Alexa debug logging (home-assistant#184241)
  Split user flow init and data submission in tomorrowio config flow tests (home-assistant#184176)
  Fix stale Nibe Heat Pump values at the end of polling (home-assistant#184222)
  Handle unsupported devices for the my-PV integration (home-assistant#183920)
  Keep Teslemetry energy history unavailable while the stream is down (home-assistant#184224)
  Bump radios to 2.0.1 (home-assistant#184205)
  bosch_shc: bump boschshcpy to 0.6.15 (home-assistant#184220)
  Split user flow init and data submission in recollect_waste config flow tests (home-assistant#184169)
  Use a radio list for the Teslemetry local vehicle subentry (home-assistant#184171)
  Split user flow init and data submission in watttime config flow tests (home-assistant#184173)
  Always disconnect Teslemetry Bluetooth after a failed pairing step (home-assistant#184190)
  Do not send a sound to a LaMetric device without audio (home-assistant#184196)
  Bump uiprotect to 20.2.1 (home-assistant#184208)
  ...
frenck pushed a commit that referenced this pull request Oct 5, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@jbouwh
jbouwh deleted the alexa-improve-debug-logging branch October 5, 2026 18:07
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants