Repository navigation
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
0bf88b6 to
d51cf77
Compare
|
Self-correction in 68c9992 + e2fdfd1 (no review asked for it). @GreenGrassBlueOcean a quick confirmation would be welcome. Context. How it was found. Reading the decoder for edge inputs it does not test: Live check (2026-10-26 16:45 UTC). What changed. The codes must be ASCII digits ( |
GreenGrassBlueOcean
left a comment
There was a problem hiding this comment.
The live F461 2.0.11 and MyHomeServer1 3.87.13 captures in OpenWebNet-HA/MyHOME#799 establish the wire encoding (*#13**27*C1#C2#...##), and failing closed on *-separated or non-printable values is clean. Note that neither OWNd nor MyHOME sends *#13**27## or reads OWNGatewayEvent.model_name in production today (MyHOME identifies gateways via WHO 13 dim 15 + WHO 1013 dim 1 + SSDP/UPnP), so this is passive event-session decoding when an external client queries *#13**27## (plus clearing the two pending_decoder_rx entries in MyHOME on the next pin bump).
Please hold rebasing until #138 lands so _HASH_VALUE_REPLIES in OWNd/message/base.py only has to be merged once, then address these points:
-
Bind
_HASH_VALUE_REPLIESto ASCII digits and+quantifier inOWNd/message/base.py:re.compile( r"^\*#(?P<who>13)\*(?P<where>)(?P<where_param>)\*(?P<dimension>27)(?P<dimension_param>)(?P<dimension_value>\*[0-9]+(?:#[0-9]+)+)##$", re.ASCII, )
- In the current pattern (
\*\d+(?:#\d+)*), the zero-#branch of*is unreachable for ASCII digits because_DIMENSION_REQUEST_REPLYmatches*#13**27*70##first; using(?:#[0-9]+)+makes the#-separated grammar explicit (and note in the comment that all known BTicino/Legrand model strings are multi-character, as a single code*#13**27*70##is indistinguishable from a plain numeric dimension reply). - Because
\d+lackedre.ASCII,*#13**27*٧٠#٥٢##matched_HASH_VALUE_REPLIESand parsed asOWNGatewayEvent(model_name=None)(requiring the.isascii()workaround ingateway.pyandtest_model_name_with_unicode_digit_codes_is_not_decoded). Non-ASCII digits are not legal OpenWebNet wire frames and should returnNonefromOWNMessage.parserather than constructing anOWNGatewayEvent.
- In the current pattern (
-
Pin
OWNEvent.parse(...)symmetry alongsideOWNMessage.parse(...)intests/test_who13_model_name.py(as in#62). -
Housekeeping:
- Update the Companion section (
OpenWebNet-HA/MyHOME#802was closed). - Rebase cleanly onto
masterwithout merge commit6a2d3baand reset commit authorship on68c9992/e2fdfd1(Mac Book <macbook@Macs-MacBook-Pro.local>).
- Update the Companion section (
|
Why the The job runs MyHOME's suite with this checkout in place of the pinned The CONFLICTING state is separate: this branch waits for #138 to land (its |
|
@gdluck please rebase than i will merge |
*OpenWebNet-HA#13**27*C1#C2#...## is the gateway model name as '#'-separated ASCII codes: 70#52#54#49 is "F461" on a live F461 2.0.11 and 77#121#...OpenWebNet-HA#49 is "MyHomeServer1" on a live MyHomeServer1 3.87.13 (MyHOME#799 traces). OWNGatewayEvent.model_name decodes that single '#'-separated value; the '*'-separated form and a single code stay undecoded. The frame pattern joins _HASH_VALUE_REPLIES bound to ASCII digits with an explicit (?:#[0-9]+)+ grammar, so non-ASCII digit codes are no frame at all. OWNEvent.parse and OWNMessage.parse agree. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
b46cb1f to
3ffe8a8
Compare
|
Rebased: one commit |
Requested by A
Summary
The physical F461 2.0.11 answers
*#13**27##with*#13**27*70#52#54#49##: its model name as#-separated ASCII codes (70 52 54 49= "F461"). A physical MyHomeServer1 3.87.13 answers*#13**27*77#121#72#111#109#101#83#101#114#118#101#114#49##("MyHomeServer1"). The dimension-reply regex accepts only digits in values, soOWNMessage.parsereturnedNone, the event session handed the rawstron and MyHOME logged "Data received is not a message". It was the only one of the 69 events captured on 2026-10-23 (68 typed, 1 raw) that did not come back as a typed class.Refs
OpenWebNet-HA/MyHOME#799(both captures). The WHO 1001 diagnostic event that this PR carried at first is now its own PR (see Companion): different evidence, different reviewers.Changes
OWNd/message/base.py: the WHO 13 Dimension 27 shape joins_HASH_VALUE_REPLIES(introduced by fix(message): parse '#'-prefixed dimension 14 setpoint values #138), bound to ASCII digits with the#grammar explicit:^\*#(?P<who>13)\*(?P<where>)(?P<where_param>)\*(?P<dimension>27)(?P<dimension_param>)(?P<dimension_value>\*[0-9]{1,3}(?:#[0-9]{1,3})+)##$,re.ASCII.(?:#[0-9]{1,3})+because a single code (*#13**27*70##) is indistinguishable from a plain numeric reply, which_DIMENSION_REQUEST_REPLYalready parses, and every known BTicino / Legrand model string has more than one character; three digits per code at most because printable ASCII is 32..126 (a second-opinion review found that an unbounded[0-9]+would let a frame with a 4300-digit code reachint()and raise). Non-ASCII digits are no frame:OWNMessage.parse('*#13**27*٧٠#٥٢##')isNone(the.isascii()workaround of the previous revision is gone with its cause).OWNd/message/gateway.py:OWNGatewayEvent.model_namedecodes Dimension 27 only when the reply has exactly one value that contains#and every code names a printable ASCII character (32..126);human_readable_logreads "Gateway's model name is: F461.". The general*-separated form (*#13**27*70*52*54*49##) and a single code without#(*#13**27*70##) are not a model name:model_namestaysNone(fail closed).*#13**27##is still anOWNGatewayCommanddimension request.CHANGELOG.md: entry under[Unreleased]/Added.State Diagram
stateDiagram-v2 direction TB state "OWNMessage.parse(*#13**27*...##)" as Parse { [*] --> General General --> Plain : *#13**27*70*52*54*49## , *-separated, general regex\nOWNGatewayEvent, model_name None , fail closed General --> HashAllowlist : # inside the value - general regex does not match HashAllowlist --> Name : *#13**27*70#52#54#49## , one value, #-separated, printable ASCII\nOWNGatewayEvent, model_name F461 , new - before - None, Data received is not a message HashAllowlist --> NoName : *#13**27*70#7#300## , non-printable code\nOWNGatewayEvent, model_name None HashAllowlist --> NoneResult : *#13**27*70#52#54#49*1##, *#13**12*70#52##, *#1*11*1*#5##\nNone , unchanged }Where are the traces
OpenWebNet-HA/MyHOME#799(merged),f461_live_2026-10-23run 1 (run1_oracle_replay_readonly); the frame is inpending_decoder_rxoftests/test_trace_oracle_validation.pythere, citing this PR*#13**16*2*0*11##)*#13**27##->*#13**27*70#52#54#49##("F461"), returned on the command session and delivered on the event sessionOpenWebNet-HA/MyHOME#799(merged),myhomeserver1_live_2026-10-24run 1 (run1_identify)*#13**16*3*87*13##)*#13**27##->*#13**27*77#121#72#111#109#101#83#101#114#118#101#114#49##("MyHomeServer1")What does the Oracle say
No oracle stimulus exists for this frame: no suite sends
*#13**27##. The two physical captures above are the evidence.Testing
tests/test_who13_model_name.py(new, 19 cases): the F461 and MyHomeServer1 replies parse asOWNGatewayEventwith the rawdimension_value,dimension_param == [], the decodedmodel_name, the log line andstr(message)unchanged;OWNEvent.parse(the event session's entry point) gives the same object asOWNMessage.parseon four shapes (review point 2); non-printable codes, the*-separated form and a single code without#leavemodel_nameNone;*#13**27##is a dimension request; a second value after the codes, mixed separators, a code of four digits, a code of 5000 digits, another dimension with a#value and a WHO 1#value do not parse at all; the Unicode-digit frame isNonefromOWNMessage.parseand the event session's usual invalid event fromOWNEvent.parse, with no name.master5 fail, 5 pass (OWNMessage.parse('*#13**27*70#52#54#49##')has nomodel_name; the request shape and the negative cases already pass); on this branch all 10 pass. Re-verified 2026-10-24 on both plants with plain OWNd master as the sender:*#13**27##->*#13**27*70#52#54#49##(F461 2.0.11, 14 ms) and*#13**27*77#121#72#111#109#101#83#101#114#118#101#114#49##(MyHomeServer1 3.87.13, 21 ms); this head decodes them toF461/MyHomeServer1, master toNone.2357 passed;mypyclean,ruffclean.Live retest (2026-10-24)
Confirmed, narrowly: on the F461 2.0.11 with this decoder,
*#13**27##->*#13**27*70#52#54#49##and the HA log readsGateway's model name is: F461.instead of "Data received is not a message". It is not wired into MyHOME's diagnostics (identification.who13_modelstaysnull); that is a separate MyHOME change.Companion
MyHOME: none required now.
OpenWebNet-HA/MyHOME#802(the warning rate limit) was closed; the twopending_decoder_rxentries in MyHOME'stests/test_trace_oracle_validation.pyare dropped at the pin bump (see the CI note).OpenWebNet-HA/MyHOME#799carries the traces. Related OWNd PR (split from this one): #145, merged.Revision 3ffe8a8 (review 5684988925, after #138 landed). Rebuilt as one commit on master
f3efc1d: no merge commit (6a2d3bagone), authorship reset (68c9992/e2fdfd1folded in),_HASH_VALUE_REPLIESbound to ASCII with the+quantifier (point 1),OWNEvent.parsesymmetry pinned (point 2), Companion updated (point 3). On top of the review: codes capped at three digits.CI note (expected red check)
The
MyHOME test suitejob runs MyHOME against this branch. MyHOME'stests/test_trace_oracle_validation.pylists the two dimension-27 frames of the merged trace PR OpenWebNet-HA/MyHOME#799 inpending_decoder_rxand, by the maintainers' request on that PR, asserts loudly that they still parse toNoneuntil the OWNd pin is bumped. This decoder makes them parse, so that single job is red by construction (remove … from pending_decoder_rx: the OWNd pin now decodes it). The cleanup is a one-line MyHOME change that belongs with the pin bump; every other check is green.🤖 Generated with Claude Code