Skip to content

Commit 7f71c4c

Browse files
authored
Merge pull request #67 from AndrewDemsDS/fix/breakglass-and-subscription-revert
AmebaZ2: aggregate fault endpoint, and correcting the 0x24 diagnosis
2 parents b4c1d94 + ec3aa08 commit 7f71c4c

3 files changed

Lines changed: 559 additions & 1 deletion

File tree

firmware/src/sdk-edits/matter_drivers.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ static const chip::EndpointId kSleepEp = 6; // OnOff -> sleep profile (on=Gener
9595
static const chip::EndpointId kHeatRelayEp = 7; // BooleanState (Contact Sensor) -> aux/PTC electric-heat relay (#51)
9696
static const chip::EndpointId kCoilTempEp = 8; // TemperatureMeasurement -> outdoor/condenser coil temp (#51)
9797
static const chip::EndpointId kDisplayEp = 9; // OnOff -> panel display (#19 parity; on=0xC0/off=0x40 @20)
98+
static const chip::EndpointId kFaultEp = 10; // BooleanState (Contact Sensor) -> aggregate A/C fault (#38)
9899

99100
/* --------------------------------------------------------------------------
100101
* Command shadow: incrementally updated by each Matter write, flushed as one
@@ -483,6 +484,7 @@ CHIP_ERROR matter_driver_room_aircon_init(void)
483484
set_ha_entity_label(kHeatRelayEp, "Aux Heat");
484485
set_ha_entity_label(kCoilTempEp, "Coil");
485486
set_ha_entity_label(kDisplayEp, "Display");
487+
set_ha_entity_label(kFaultEp, "Fault");
486488
HISENSE_INIT_STAGE(4);
487489

488490
/* ep9 Display boots ON (#33) via the .zap OnOff defaultValue -- deliberately NOT an ember
@@ -1244,6 +1246,17 @@ void matter_driver_downlink_update_handler(AppEvent *aEvent)
12441246
// asserts in cold/defrost. Standard cluster => HA-readable (unlike the mfg attrs).
12451247
BoolAttr::StateValue::Set(kHeatRelayEp, st.heat_relay_on);
12461248

1249+
// #38: aggregate fault flag -> BooleanState (Contact Sensor, ep10). HisenseFaults.any
1250+
// already ORs the raw fault bytes minus HISENSE_FAULT_NONFAULT_PROTECT (byte 66 bit 7
1251+
// reads 0x80 on a healthy unit -- it is a mode flag, not a fault). Do NOT re-derive this
1252+
// from the named bools.
1253+
{
1254+
HisenseFaults fl;
1255+
if (hisense_get_faults(&fl)) {
1256+
BoolAttr::StateValue::Set(kFaultEp, fl.any);
1257+
}
1258+
}
1259+
12471260
// #5: report the A/C panel's display unit via TUIC (ep1). READ SIDE ONLY -- the
12481261
// write path is rejected by the write-access override below until the byte-23
12491262
// command is bench-verified. Writing the wrong unit is not cosmetic: a setpoint

0 commit comments

Comments
 (0)