Repository navigation
feat(alarm): complete WHO 5 burglar alarm implementation and gateway profiles - #66
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Pushed
Not changed, still open from the audit: |
|
Pushed
889 tests pass. Still open: commit |
e6cfe52 to
7c69b9f
Compare
fedem95
left a comment
There was a problem hiding this comment.
Reviewed the logic; holding off on approval until this is rebased.
Rebase needed. #70 deleted OWNd/message.py (modify/delete conflict), so the parser changes have to move to message/base.py (_ALARM_EMPTY_WHERE, the * → "0" normalisation, parse()) and the event/command changes to message/alarm.py. The README profile table also needs regenerating after #74. Once it's rebased I'll rerun the 3,791-frame old/new comparison from #70: only WHO 5 should move.
On the logic, which should carry over unchanged:
-
engage()/disengage()keep changing shape. First*5*8*<where>##, then*5*8##with a zone bitmap ("documented"), now back to*5*8*<where>##in 56571ab. Which source does the current form come from? Without a TX capture I'd keep them marked experimental in the docstring (as e6cfe52 did) and have MyHOME not expose them yet. -
Empty WHERE is still "system".
OWNAlarmEventsets_system = Truefor"", so the no-panel poll dump*5*9*##reportsis_disarmed = Trueand logs "System is reporting: …". Keepingwhere == ""is good, but every consumer then has to remember to check it before trusting the flags._system = Falsefor""(or a dedicatedis_poll_dumpflag) would make the safe path the default. -
H4890
supported_whois an allow-list of what the captures happened to contain. It drops heating (4), CEN (15) and scenarios (17), and MyHOME's startup sweep and topology checks followsupported_who. Unless a datasheet says the 4890 screens don't relay those,DEFAULT_SUPPORTED_WHO + WHO_ALARMseems safer than inferring absence from traces. Same reasoning as the audio question on #74. -
F455 without WHO 5 is right, and there's now a source for it: the F455 installer manual (RA00125AB) lists "Antintrusione" among the functions it does not manage.
Data point from my MH201 (fw 3.6.27), on a plant whose burglar alarm is not on the SCS bus: *#5*0## is NACKed (twice, ~20 ms), with no WHO 5 frames, and none in 30 h of logs. So this says nothing about whether the MH201 can relay WHO 5. It does show that "no panel" doesn't always look like the MH200N's empty-WHERE dump (*5*9*##): the MH201 just NACKs. Another reason not to let "" stand for the system address (point 2).
The stale message on e97c213 goes away with a squash merge.
…profiles - Parser: support WHO 5 empty-WHERE broadcast syntax (*5*<what>*##) and normalise * system address to '0' - Alarm message: system-scope is_active, is_armed_away, is_disarmed, is_engaged; add telemetry & status flags - Alarm command: provide standard engage() and disengage() commands marked experimental - Profiles: add H4890Profile with aliases and measured WHO set, add WHO_ALARM to MH202Profile, add auth_measured - README: regenerate hardware profile table with unmeasured defaults footnote - Golden corpus & tests: add WHO 5 alarm golden frames and comprehensive unit tests
56571ab to
958257f
Compare
|
@fedem95 Rebased onto Addressing the review points in detail: 1. Rebase & Squash Cleanup
2.
|
fedem95
left a comment
There was a problem hiding this comment.
Thanks for the rebase. Verified on 958257f against master (67408c8) with the same 3,791 frames: only WHO 5 changes (new flags, *5*<what>*## now parsed, * → "0", zone/sensor frames no longer moving the panel flags, is_armed_home always False). Every other subsystem and the auth helpers are identical. engage()/disengage() are marked experimental, good.
Point 2: you're right, I withdraw it. The F454 trace from MyHOME#311 (tests/fixtures/plants/issue_311_f454, a real panel with zones #1–#8) answers the status poll with empty-WHERE frames (*5*1*##, *5*5*##, *5*7*##, *5*9*##). Treating "" as non-system would lose a real panel's state.
Point 3: yes please, DEFAULT_SUPPORTED_WHO + WHO_ALARM for H4890.
New, from the same F454 trace: WHAT 1 is not "armed". The panel sends WHAT 1 when it is not armed:
- disarm sequence:
*5*2*0##→*5*1*0##→*5*9*0## - status dump of a disarmed system:
*5*1*##…*5*9*##
With is_armed_away = state_code in (1, 8), replaying those frames through this branch gives is_armed_away=True on the middle *5*1*0##. MyHOME's handle_event checks is_armed_away before is_disarmed, so on every disarm the panel goes DISARMED → ARMED_AWAY → DISARMED, and automations triggered on "armed_away" fire during a disarm (also briefly after the startup poll). The arm sequence is *5*1*0## → *5*8*0##, so WHAT 8 alone is enough to mark armed. WHAT 1 looks like "system operational" and fits is_active only. This is already in master, but since this PR redefines exactly these flags, it seems the right place: is_armed_away → state_code == 8 and self._system.
Side note, not for this PR: arm_away() and arm_home() both build *5*1*<where>##, the same frame, and with engage() there are again two different ways to "arm". Worth sorting out together with the first TX capture.
…alarm The F454 trace (MyHOME#311) shows WHAT 1 on a disarm (*5*2*0## -> *5*1*0## -> *5*9*0##) and in disarmed status dumps. Only WHAT 8 means armed, so is_armed_away is now WHAT 8 on the system address. H4890 supported_who is DEFAULT_SUPPORTED_WHO + WHO_ALARM instead of an allow-list of what the captures contained. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The MH202 (MyHOME#564) and H4890 (MyHOME#466) captures are status dumps of a disarmed panel (*5*1*0##, *5*9*0##) plus zone states; neither shows an arm transition or an alarm event. The is_armed_home comment still said the system state comes from WHAT 1; armed/disarmed is WHAT 8/9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plant owner in MyHOME#564 (comment 5913248544) reports, quoting BTicino support, that current central-unit firmware rejects arm/disarm sent as WHO 5 frames over SCS, whichever gateway sends them. They arm with a WHO 9 AUX frame (e.g. *9*1*7##) and an automation programmed on the central unit. OWNAlarmCommand now says so: status() is the only builder to rely on, the arm/disarm/trigger/engage/disengage builders are unverified and kept for API compatibility, and arm_away() notes that WHAT 1 is activation, not armed. The H4890 and MH202 profiles state that their WHO 5 support means reading the alarm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@fedem95 thanks for the second pass. Since your review on Your review pointsWHAT 1 is not armed (
Point 3: H4890
Point 2: left as is (empty WHERE stays the system address), per your withdrawal. New since your reviewDocstrings now match the captures ( Arm/disarm over WHO 5 is rejected by the central unit (
Downstream / CI
Related: OpenWebNet-HA/openwebnet-mcp#13 fixes the WHO 5 table in the openwebnet-mcp Ready for another look. |
fedem95
left a comment
There was a problem hiding this comment.
Verified a4c0f59 against 958257f with the same 3,791 frames: the only difference is is_armed_away turning False on WHAT 1 frames (*5*1*##, *5*1**##, *5*1*0##, …). Every other attribute, class and command is unchanged, as are the auth helpers. Profiles check out: H4890 and its aliases now have the default set plus WHO 5, MH202 has WHO 5, and F454/F455/MH201/MH200N don't. The docstring commits match what the captures actually contain, and documenting all the arm paths as unverified without picking one is the right call until there's a TX capture. All 8 checks are green, including the MyHOME suite after #608. Approving.
11989e5
into
OpenWebNet-HA:master
Problem
"4890"and the family names resolved to generic profiles whosesupported_wholacks WHO 5. MyHOME's shared-bus onboarding trustssupported_whoand rejects the alarm withwho_not_supported_by_gateway(MyHOME#564). The MH202 has the same gap.*5*1*##), next to the documented star form (*5*1**##). The empty form was dropped asNone.WHAT 11("active zone",*5*11*#n##) was treated asarmed_home, so a status dump on a disarmed system flipped the panel toARMED_HOME.is_armed_awaywas true for WHAT 1. The F454 trace (MyHOME#311) sends WHAT 1 on every disarm (*5*2*0##→*5*1*0##→*5*9*0##) and in disarmed status dumps; arming is*5*1*0##→*5*8*0##. A disarm went DISARMED → ARMED_AWAY → DISARMED.Arming and disarming are not possible over WHO 5
Important
The plant owner in MyHOME#564 (comment) reports, quoting BTicino support, that current central-unit firmware rejects arm/disarm sent as
*5*...frames over SCS, whichever gateway sends them. No TX capture shows any WHO 5 command being accepted.Their working route is a WHO 9 auxiliary command, e.g.
*9*1*7##(AUX channel 7 ON), plus an automation programmed on the central unit that arms the chosen zones when that AUX command arrives. Which AUX channels and WHATs arm or disarm depends on the installer's programming, so OWNd has no fixed frame for it.So in this PR WHO 5 support means reading the alarm:
OWNAlarmCommand.status()is the only builder to rely on.arm_away(),arm_home(),disarm(),trigger(),engage()anddisengage()are documented as unverified and kept for API compatibility.arm_away()andarm_home()build the same frame,*5*1*<where>##, which is "activation", not arming.How a WHO 5 frame is handled
Empty WHERE is still the system address: the F454 panel in MyHOME#311 answers the poll with
*5*1*##,*5*5*##,*5*7*##,*5*9*##, so treating""as non-system would lose a real panel's state. It stays""rather than"0"because the MH200N in MyHOME#466 (no panel installed) sends the same spelling; mapping it to0made MyHOME create a phantomalarm_control_panel.alarm_0. Consumers must not turn the empty spelling into a device on its own.Changes
*5*<what>*##) accepts the empty-WHERE form._STATUSis unchanged, so*1*1*##is still invalid.*5*<what>**##now reportswhere "0"(same identity as*5*<what>*0##).OWNAlarmEvent:is_armed_away,is_disarmed,is_activeandis_engagedare system-scoped.is_armed_awayis WHAT 8 only.is_armed_homeis alwaysFalse: no capture shows a system-level WHAT 11.is_zone_active,is_zone_inactive(WHAT 18 is partition state, not bypass), battery/mains (is_battery_fault,is_battery_ok,is_mains_fault,is_mains_ok,is_power_telemetry) andis_intrusion,is_tamper,is_panic,is_technical,is_silent. The power flags are not system-scoped.OWNAlarmCommand: class docstring documents the SCS rejection and the AUX route. Newengage()/disengage()(*5*8*<where>##/*5*9*<where>##) are experimental and unverified like the existing builders.H4890Profile, aliases limited to the measured 3.5" family:am4890,ln4890,ln4890a,4890. Other touch screens (mh4892,3488,myhometouch, ...) stay generic.supported_whoisDEFAULT_SUPPORTED_WHO+ WHO 5: the captures don't show the screen dropping heating, CEN or scenarios. Sessions and pacing are class defaults; auth is shown asAuth unmeasured.MH202Profilecarries WHO 5 (MyHOME#564 capture).*5*1*##,*5*0*##,*5*1**##.Tests
1009 passed, 1 skipped. Ruff clean, README profile table in sync.
Downstream
OpenWebNet-HA/MyHOME#608 fixes 4 MyHOME tests that armed with
*5*1*0##. They now arm with*5*8*0##and pass on both OWNd 2.0.0b9 and this branch (full MyHOME suite: 3124 passed). The "MyHOME test suite" conformance job runs againstv2-phase1-architecture, so it stays red until #608 merges.