Skip to content

fix(gateway): suppress ERROR logs on startup discovery status request NACKs (#406) - #407

Merged
xtimmy86x merged 1 commit into
OpenWebNet-HA:v2-phase1-architecturefrom
GreenGrassBlueOcean:fix/issue-406-status-request-nack-logging
Sep 18, 2026
Merged

xtimmy86x merged 1 commit into
OpenWebNet-HA:v2-phase1-architecturefrom
GreenGrassBlueOcean:fix/issue-406-status-request-nack-logging

Conversation

@GreenGrassBlueOcean

@GreenGrassBlueOcean GreenGrassBlueOcean commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves #406. Follows up on feedback from @TheDarkWizard in #402 and coordinates with upstream OWNd fix OpenWebNet-HA/OWNd#44.

Root Cause

During startup discovery (initial_discovery()), general status requests (*#2*0##, *#4*0##, *#16*0##) probe the SCS bus for optional or unconfigured subsystems. When subsystems are not installed (e.g., no audio matrix, or standalone thermostats with no central heating unit 0), the gateway returns NACK (*#*0##).

Prior to OWNd 2.0.0b9, intermediate retries on status requests were logged at ERROR before concluding cleanly at DEBUG on attempt 2 ("Subsystem or device may not be present"). This produced alarming red [ERROR] logs in Home Assistant on every reboot.

Defense-in-Depth Solution

This PR provides immediate protection in Home Assistant while coordinating with the upstream protocol library:

  1. custom_components/myhome/gateway.py:
    • Added _StatusRequestLogFilter to LOGGER. Intermediate retry logs for status requests (*#...##) are safely downgraded from ERROR to DEBUG.
    • Regular command errors (*WHO*WHAT*WHERE##) and unexpected exceptions remain completely unaffected at ERROR.
  2. tests/test_gateway.py:
    • Added test_status_request_log_filter asserting status-request retry errors are downgraded to DEBUG while command errors and other exceptions remain ERROR.
  3. tests/test_phase1_architecture.py:
    • Added error log verification in test_harness_nack_simulation to verify status request NACK error suppression.

Verification

  • test_gateway.py and test_phase1_architecture.py: 90 passed.
  • verify_ha_standards.py: All 18 checks passed, Platinum Quality Scale clean.
  • ruff check: 0 violations.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@GreenGrassBlueOcean
GreenGrassBlueOcean marked this pull request as draft September 18, 2026 13:11
@GreenGrassBlueOcean GreenGrassBlueOcean added the blocked: upstream Blocked pending upstream release or dependency label Sep 18, 2026
@GreenGrassBlueOcean GreenGrassBlueOcean changed the title fix(gateway): suppress ERROR logs on startup discovery status request NACKs (#406) [BLOCKED on OWNd>=2.0.0b8] fix(gateway): suppress ERROR logs on startup discovery status request NACKs (#406) Sep 18, 2026
@GreenGrassBlueOcean

Copy link
Copy Markdown
Contributor Author

🔒 Merge Lock Applied:
This pull request has been converted to Draft and tagged with the blocked: upstream label.

Conditions for unlocking and merging:

  1. Upstream PR OpenWebNet-HA/OWNd#44 must be merged into OpenWebNet-HA:master.
  2. A new version of OWNd (>= 2.0.0b8) must be published to PyPI.
  3. Once published, custom_components/myhome/manifest.json requirements will be bumped to "requirements": ["OWNd==2.0.0b8"] and the assertion gate in tests/test_phase1_architecture.py removed.
  4. After CI validates the bumped pin, the PR will be marked as "Ready for review" and merged.

@GreenGrassBlueOcean GreenGrassBlueOcean changed the title [BLOCKED on OWNd>=2.0.0b8] fix(gateway): suppress ERROR logs on startup discovery status request NACKs (#406) [BLOCKED on OWNd>=2.0.0b9] fix(gateway): suppress ERROR logs on startup discovery status request NACKs (#406) Sep 18, 2026
@GreenGrassBlueOcean

Copy link
Copy Markdown
Contributor Author

ℹ️ Update: OWNd 2.0.0b8 was officially released to PyPI containing the HMAC refactor (Release v2.0.0-b8).

This PR's merge lock now targets OWNd >= 2.0.0b9, which will be the dedicated release for the startup status request NACK logging fix (OpenWebNet-HA/OWNd#44).

@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the fix/issue-406-status-request-nack-logging branch from 1dff5ea to 7f53d5e Compare September 18, 2026 20:47
@GreenGrassBlueOcean GreenGrassBlueOcean changed the title [BLOCKED on OWNd>=2.0.0b9] fix(gateway): suppress ERROR logs on startup discovery status request NACKs (#406) fix(gateway): suppress ERROR logs on startup discovery status request NACKs (#406) Sep 18, 2026
@GreenGrassBlueOcean
GreenGrassBlueOcean marked this pull request as ready for review September 18, 2026 20:48
@GreenGrassBlueOcean GreenGrassBlueOcean removed the blocked: upstream Blocked pending upstream release or dependency label Sep 18, 2026
@xtimmy86x
xtimmy86x merged commit f638f44 into OpenWebNet-HA:v2-phase1-architecture Sep 18, 2026
16 checks passed
@GreenGrassBlueOcean
GreenGrassBlueOcean deleted the fix/issue-406-status-request-nack-logging branch September 18, 2026 21:03
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.

3 participants