Skip to content

Commit

Permalink
[Chef] Add Power Source cluster to Water leak sensor EP1 (#35410)
Browse files Browse the repository at this point in the history
* Update rootnode_waterleakdetector_0b067acfa3.zap

Add Power Source cluster to EP1 to simulate a battery

* Update rootnode_waterleakdetector_0b067acfa3.matter

Add Power Source cluster to EP1 to Matter file

* Update rootnode_waterleakdetector_0b067acfa3.matter

* Update rootnode_waterleakdetector_0b067acfa3.zap

* Update rootnode_waterleakdetector_0b067acfa3.matter

Remove Scenes Management Cluster

* Manual correction of device type order due to ZAP tool bug

* Update rootnode_waterleakdetector_0b067acfa3.zap

* Update rootnode_waterleakdetector_0b067acfa3.zap

* Update rootnode_waterleakdetector_0b067acfa3.zap

* Update rootnode_waterleakdetector_0b067acfa3.matter

* Update rootnode_waterleakdetector_0b067acfa3.zap

* Update rootnode_waterleakdetector_0b067acfa3.matter
  • Loading branch information
lboue authored Oct 2, 2024
1 parent 8a39aff commit 6c4f94b
Show file tree
Hide file tree
Showing 2 changed files with 615 additions and 6 deletions.
282 changes: 282 additions & 0 deletions examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,265 @@ cluster BasicInformation = 40 {
command MfgSpecificPing(): DefaultSuccess = 0;
}

/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */
cluster PowerSource = 47 {
revision 1; // NOTE: Default/not specifically set

enum BatApprovedChemistryEnum : enum16 {
kUnspecified = 0;
kAlkaline = 1;
kLithiumCarbonFluoride = 2;
kLithiumChromiumOxide = 3;
kLithiumCopperOxide = 4;
kLithiumIronDisulfide = 5;
kLithiumManganeseDioxide = 6;
kLithiumThionylChloride = 7;
kMagnesium = 8;
kMercuryOxide = 9;
kNickelOxyhydride = 10;
kSilverOxide = 11;
kZincAir = 12;
kZincCarbon = 13;
kZincChloride = 14;
kZincManganeseDioxide = 15;
kLeadAcid = 16;
kLithiumCobaltOxide = 17;
kLithiumIon = 18;
kLithiumIonPolymer = 19;
kLithiumIronPhosphate = 20;
kLithiumSulfur = 21;
kLithiumTitanate = 22;
kNickelCadmium = 23;
kNickelHydrogen = 24;
kNickelIron = 25;
kNickelMetalHydride = 26;
kNickelZinc = 27;
kSilverZinc = 28;
kSodiumIon = 29;
kSodiumSulfur = 30;
kZincBromide = 31;
kZincCerium = 32;
}

enum BatChargeFaultEnum : enum8 {
kUnspecified = 0;
kAmbientTooHot = 1;
kAmbientTooCold = 2;
kBatteryTooHot = 3;
kBatteryTooCold = 4;
kBatteryAbsent = 5;
kBatteryOverVoltage = 6;
kBatteryUnderVoltage = 7;
kChargerOverVoltage = 8;
kChargerUnderVoltage = 9;
kSafetyTimeout = 10;
}

enum BatChargeLevelEnum : enum8 {
kOK = 0;
kWarning = 1;
kCritical = 2;
}

enum BatChargeStateEnum : enum8 {
kUnknown = 0;
kIsCharging = 1;
kIsAtFullCharge = 2;
kIsNotCharging = 3;
}

enum BatCommonDesignationEnum : enum16 {
kUnspecified = 0;
kAAA = 1;
kAA = 2;
kC = 3;
kD = 4;
k4v5 = 5;
k6v0 = 6;
k9v0 = 7;
k12AA = 8;
kAAAA = 9;
kA = 10;
kB = 11;
kF = 12;
kN = 13;
kNo6 = 14;
kSubC = 15;
kA23 = 16;
kA27 = 17;
kBA5800 = 18;
kDuplex = 19;
k4SR44 = 20;
k523 = 21;
k531 = 22;
k15v0 = 23;
k22v5 = 24;
k30v0 = 25;
k45v0 = 26;
k67v5 = 27;
kJ = 28;
kCR123A = 29;
kCR2 = 30;
k2CR5 = 31;
kCRP2 = 32;
kCRV3 = 33;
kSR41 = 34;
kSR43 = 35;
kSR44 = 36;
kSR45 = 37;
kSR48 = 38;
kSR54 = 39;
kSR55 = 40;
kSR57 = 41;
kSR58 = 42;
kSR59 = 43;
kSR60 = 44;
kSR63 = 45;
kSR64 = 46;
kSR65 = 47;
kSR66 = 48;
kSR67 = 49;
kSR68 = 50;
kSR69 = 51;
kSR516 = 52;
kSR731 = 53;
kSR712 = 54;
kLR932 = 55;
kA5 = 56;
kA10 = 57;
kA13 = 58;
kA312 = 59;
kA675 = 60;
kAC41E = 61;
k10180 = 62;
k10280 = 63;
k10440 = 64;
k14250 = 65;
k14430 = 66;
k14500 = 67;
k14650 = 68;
k15270 = 69;
k16340 = 70;
kRCR123A = 71;
k17500 = 72;
k17670 = 73;
k18350 = 74;
k18500 = 75;
k18650 = 76;
k19670 = 77;
k25500 = 78;
k26650 = 79;
k32600 = 80;
}

enum BatFaultEnum : enum8 {
kUnspecified = 0;
kOverTemp = 1;
kUnderTemp = 2;
}

enum BatReplaceabilityEnum : enum8 {
kUnspecified = 0;
kNotReplaceable = 1;
kUserReplaceable = 2;
kFactoryReplaceable = 3;
}

enum PowerSourceStatusEnum : enum8 {
kUnspecified = 0;
kActive = 1;
kStandby = 2;
kUnavailable = 3;
}

enum WiredCurrentTypeEnum : enum8 {
kAC = 0;
kDC = 1;
}

enum WiredFaultEnum : enum8 {
kUnspecified = 0;
kOverVoltage = 1;
kUnderVoltage = 2;
}

bitmap Feature : bitmap32 {
kWired = 0x1;
kBattery = 0x2;
kRechargeable = 0x4;
kReplaceable = 0x8;
}

struct BatChargeFaultChangeType {
BatChargeFaultEnum current[] = 0;
BatChargeFaultEnum previous[] = 1;
}

struct BatFaultChangeType {
BatFaultEnum current[] = 0;
BatFaultEnum previous[] = 1;
}

struct WiredFaultChangeType {
WiredFaultEnum current[] = 0;
WiredFaultEnum previous[] = 1;
}

info event WiredFaultChange = 0 {
WiredFaultEnum current[] = 0;
WiredFaultEnum previous[] = 1;
}

info event BatFaultChange = 1 {
BatFaultEnum current[] = 0;
BatFaultEnum previous[] = 1;
}

info event BatChargeFaultChange = 2 {
BatChargeFaultEnum current[] = 0;
BatChargeFaultEnum previous[] = 1;
}

readonly attribute PowerSourceStatusEnum status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
readonly attribute optional nullable int32u wiredAssessedInputVoltage = 3;
readonly attribute optional nullable int16u wiredAssessedInputFrequency = 4;
readonly attribute optional WiredCurrentTypeEnum wiredCurrentType = 5;
readonly attribute optional nullable int32u wiredAssessedCurrent = 6;
readonly attribute optional int32u wiredNominalVoltage = 7;
readonly attribute optional int32u wiredMaximumCurrent = 8;
readonly attribute optional boolean wiredPresent = 9;
readonly attribute optional WiredFaultEnum activeWiredFaults[] = 10;
readonly attribute optional nullable int32u batVoltage = 11;
readonly attribute optional nullable int8u batPercentRemaining = 12;
readonly attribute optional nullable int32u batTimeRemaining = 13;
readonly attribute optional BatChargeLevelEnum batChargeLevel = 14;
readonly attribute optional boolean batReplacementNeeded = 15;
readonly attribute optional BatReplaceabilityEnum batReplaceability = 16;
readonly attribute optional boolean batPresent = 17;
readonly attribute optional BatFaultEnum activeBatFaults[] = 18;
readonly attribute optional char_string<60> batReplacementDescription = 19;
readonly attribute optional BatCommonDesignationEnum batCommonDesignation = 20;
readonly attribute optional char_string<20> batANSIDesignation = 21;
readonly attribute optional char_string<20> batIECDesignation = 22;
readonly attribute optional BatApprovedChemistryEnum batApprovedChemistry = 23;
readonly attribute optional int32u batCapacity = 24;
readonly attribute optional int8u batQuantity = 25;
readonly attribute optional BatChargeStateEnum batChargeState = 26;
readonly attribute optional nullable int32u batTimeToFullCharge = 27;
readonly attribute optional boolean batFunctionalWhileCharging = 28;
readonly attribute optional nullable int32u batChargingCurrent = 29;
readonly attribute optional BatChargeFaultEnum activeBatChargeFaults[] = 30;
readonly attribute endpoint_no endpointList[] = 31;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
}

/** This cluster is used to manage global aspects of the Commissioning flow. */
cluster GeneralCommissioning = 48 {
revision 1; // NOTE: Default/not specifically set
Expand Down Expand Up @@ -1576,6 +1835,7 @@ endpoint 0 {
}
}
endpoint 1 {
device type ma_powersource = 17, version 1;
device type ma_water_leak_detector = 67, version 1;


Expand Down Expand Up @@ -1627,6 +1887,28 @@ endpoint 1 {
callback attribute clusterRevision;
}

server cluster PowerSource {
ram attribute status default = 1;
ram attribute order default = 1;
ram attribute description default = "Primary Battery";
ram attribute batVoltage default = 4100;
ram attribute batPercentRemaining default = 95;
ram attribute batTimeRemaining default = 518400;
ram attribute batChargeLevel default = 0;
ram attribute batReplaceability default = 1;
ram attribute batPresent default = 1;
ram attribute batCapacity default = 350;
ram attribute batChargeState default = 4;
ram attribute batFunctionalWhileCharging default = 1;
callback attribute endpointList;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0x06;
ram attribute clusterRevision default = 1;
}

server cluster BooleanState {
ram attribute stateValue;
callback attribute generatedCommandList;
Expand Down
Loading

0 comments on commit 6c4f94b

Please sign in to comment.