Skip to content

fix(light): handle dimmer no-load state WHAT 19 and promote to dimmable (#619) - #622

Merged
GreenGrassBlueOcean merged 1 commit into
v2-phase1-architecturefrom
fix/dimmer-no-load-what19
Oct 4, 2026
Merged

GreenGrassBlueOcean merged 1 commit into
v2-phase1-architecturefrom
fix/dimmer-no-load-what19

Conversation

@GreenGrassBlueOcean

@GreenGrassBlueOcean GreenGrassBlueOcean commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #619: Handle BTicino phase-cut dimmer unloaded / open-circuit state (*1*19*<WHERE>##).

Physical modular phase-cut dimmers (e.g. BTicino F414) require a minimum closed load circuit for AC zero-crossing detection. When no load is attached or a lamp filament is blown, the dimmer enters an unloaded state and emits *1*19*<WHERE>##.

Previously, this resulted in:

  1. Dimmers becoming permanently stuck in the UI as ON at 1% brightness when operated.
  2. Dimmer entities being auto-discovered as non-dimmable switches (ColorMode.ONOFF).
  3. Persistent unmapped_device_status repair issues being raised for unused cabinet channels.

Details & Behavior

  1. Light Entity (custom_components/myhome/light.py):
    • Treats WHAT 19 as _attr_is_on = False, preventing the entity from remaining stuck ON at 1%.
    • Exposes no_load: true in extra_state_attributes while unloaded.
    • Logs state transitions to no_load once at INFO level (subsequent recurring unloaded frames log at DEBUG), ensuring blown lamps or disconnected loads are visible in standard logs without spam.
    • Normal OFF commands (*1*0*<WHERE>##) preserve no_load: true (turning off an unloaded channel does not imply a load was connected).
    • no_load is cleared and an INFO message logged when an active load reconnects (positive is_on = True or level frame arrives).
    • Automatically promotes existing entities to ColorMode.BRIGHTNESS on receiving WHAT 19 (respecting lock_features).
    • Automatically discovers unloaded dimmers as dimmable = True in build() when first seen via WHAT 19.
  2. Device Health & Diagnostics (custom_components/myhome/device_health.py, docs/diagnostics/repair-issues.md):
    • Added 19 to RECOGNIZED_STATUSES in device_health.py (keeping DOCUMENTED_EVENTS strictly for ZigBee spec events {32, 34, 39}).
    • Receiving WHAT 19 clears any prior unmapped_status fault on that address without raising new repair issues.
    • Updated diagnostic documentation in docs/diagnostics/repair-issues.md.
  3. Trace Fixtures & Conformance (tests/fixtures/traces/issue_619/, README.md, docs/trace-availability.md):
    • Committed authentic physical F453AV & F414 bus trace contributed by @nce2704 in Investigate lighting WHAT 19 status frames from BTicino F414 modular dimmers #619 (myhome_trace_F453AV_all_2026-10-04T08-28-13.json) with README documentation.
    • Added trace replay test suite in tests/test_issue_619_dimmer_trace.py verifying discrete dimming levels 2..7 with 35 W load, turn off transitions, and unloaded channel WHAT 19 handling.
    • Synchronized trace availability matrix across README.md and documentation.
  4. Unit Tests:
    • tests/test_component_light.py: Unit tests for WHAT 19 no-load behavior, stuck-on prevention, async_turn_on() UI execution, level recovery, OFF command preservation of no_load, state transition logging, and dimmable discovery.
    • tests/test_device_health.py: Verified WHAT 19 clears unmapped status faults and raises no repair issues.
    • tests/test_device_health_corpus.py: Replay suite tests verifying DOCUMENTED_EVENTS and RECOGNIZED_STATUSES.

Verification

  • WSL Python 3.14 / HA Core 2026.9.2: Full test suite passed (218 component/health/trace tests passed).

  • Ruff Linting: 0 violations across custom_components, tests, and scripts.

  • Architectural Standards: All 22 checks passed via scripts/verify_ha_standards.py.

  • V2 Architecture: New entities implement handle_event() and do not manually subscribe via async_dispatcher_connect.

@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!

…le (#619)

- Light entity: handle WHAT 19 (*1*19*WHERE##) as is_on=False and expose no_load: True attribute
- Prevent unloaded lights from staying stuck ON at 1% in Home Assistant UI
- Log state transitions to no_load at INFO level, and subsequent unloaded frames at DEBUG
- Preserve no_load attribute on normal OFF commands; only clear on positive load reconnect
- Auto-promote existing entities to ColorMode.BRIGHTNESS when WHAT 19 is received (unless locked)
- Auto-detect dimmable in build() when first frame carries WHAT 19
- Classify WHAT 19 as RECOGNIZED_STATUSES in device_health to suppress false faults and clear prior unmapped anomalies
- Update diagnostics documentation in repair-issues.md
- Commit authentic F453AV & F414 bus trace fixture with replay test suite in test_issue_619_dimmer_trace.py
- Add comprehensive unit tests in test_component_light.py, test_device_health.py, and test_device_health_corpus.py
- Synchronize documentation and trace availability matrix
@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the fix/dimmer-no-load-what19 branch from a34d1f4 to 93de412 Compare October 4, 2026 16:15
@GreenGrassBlueOcean
GreenGrassBlueOcean merged commit dd8b0c7 into v2-phase1-architecture Oct 4, 2026
17 checks passed
@GreenGrassBlueOcean
GreenGrassBlueOcean deleted the fix/dimmer-no-load-what19 branch October 4, 2026 16:22
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.

2 participants