fix(light): keep the last state when a light reports an unknown WHAT - #456
Merged
GreenGrassBlueOcean merged 2 commits intoSep 24, 2026
Conversation
An MH200 actuator at 74 answers *#1*74## with *1*19*74## and a WHO 1001 DIMENSION 11 autodiagnostic mask. WHAT 19 is not in the WHO 1 table, but OWNd reported it as on, so light.light_74 kept flipping back on. The OWNd fix makes is_on None and exposes the raw value as unknown_state. handle_event already ignores is_on None; the light now also shows the value as an unknown_state attribute, cleared by the next known state, and warns once per value. The live-frame test is a strict xfail while the installed OWNd still reports WHAT 19 as on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GreenGrassBlueOcean
merged commit Sep 24, 2026
60dbeba
into
OpenWebNet-HA:v2-phase1-architecture
16 checks passed
GreenGrassBlueOcean
added a commit
that referenced
this pull request
Sep 24, 2026
Live on the MH200 with the #456 test build: light.light_74 came back "on" from the state the WHAT 19 bug had left, and since the bus only ever answers *1*19*74## (+ a WHO 1001 fault mask), "keep the last state" kept that stale "on" forever. A state seen on the bus or set from Home Assistant is still kept against an unknown WHAT; one that was only restored at startup now becomes unknown on the first fault report, and the warning says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
An MH200 actuator at
74(not a configured light) answers*#1*74##with*1*19*74##plus a WHO 1001 DIMENSION 11 autodiagnostic fault mask (*#1001*74*11*111110111111111111110111##). WHAT 19 isn't in the WHO 1 WHAT table, but OWNd reported it as on. Solight.light_74stayed on, and turning it off made the device answer 19 again and the entity flipped back.Change
is_onNonefor WHATs outside the table and addsunknown_state.handle_eventalready ignoredis_on is None, so the light keeps its last state. On top of that, the light now:unknown_stateattribute, cleared by the next known on/off statelight 74 reports unknown lighting WHAT 19; keeping its last state)unknown_stateis read withgetattr+isinstance(int), so the pinnedOWNd==2.0.0b8still works.Behaviour change: with OWNd#59, lighting WHATs 32/33 and 39+ also become unknown, so a light that receives one now keeps its last state instead of turning off.
Tests
tests/test_component_light.py:*1*0*74##then*1*19*74##): a strictxfailwhile the installed OWNd still reports WHAT 19 as on, following the same detect-don't-pin pattern as the OWNd#48/fixed deprecation warning in HA 2022.6 #51/OpenWebNet - different Local Bus #53 markers. It passes against the OWNd#59 checkout.Full suite: 2008 passed against the released OWNd and 2015 passed against OWNd#59; ruff and mypy on
light.pyare clean.Checklist
handle_event()and do not manually subscribe viaasync_dispatcher_connect. (No new entities.)Follow-up
Home Assistant only gets the fix once OWNd#59 is released and the manifest pin is bumped. At that point the strict xfail will start failing, and its marker should be removed.
🤖 Generated with Claude Code