Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/electrical energy & power measurement clusters #31518

Merged
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6b02d7b
Hoist shared enums and bitmaps into detail namespace
hasty Dec 14, 2023
f6e2e30
Regenerate
hasty Dec 14, 2023
82716f2
Add electrical measurement clusters
hasty Nov 21, 2023
b4164bd
Add NumberOfMeasurements attribute
hasty Nov 22, 2023
9c2842c
Bump to latest spec
hasty Jan 17, 2024
18b453b
Bump ZAP version
hasty Jan 17, 2024
f9123c4
Remove Electrical Measurement cluster
hasty Jan 18, 2024
80960e1
Add initial Electrical Power Measurement cluster implementation
hasty Jan 18, 2024
e8a1f9c
Revert "Remove Electrical Measurement cluster"
hasty Jan 18, 2024
76a7465
Fix incorrect min/max values on energy attributes
hasty Jan 19, 2024
58d6cf2
Formatting electrical-power-measurement-server
hasty Jan 19, 2024
f755203
Regen after restoring deprecated electrical measurement cluster
hasty Jan 19, 2024
d55d637
Re-add inexplicably important blank line to zap_execution.py
hasty Jan 19, 2024
3aead8a
De-alphabetize list of files to avoid breaking GH action
hasty Jan 19, 2024
dbea267
Semi-realphabetize?
hasty Jan 19, 2024
1335b8a
Restore strangely dropped events
hasty Jan 19, 2024
58bfa09
Better BitMask handling
hasty Jan 19, 2024
519b0ac
Change min/max on electrical measurements to be decimal instead of hex
hasty Jan 22, 2024
9d79bba
Rename meas-and-sense to measurement-and-sensing.xml
hasty Jan 22, 2024
792b0e5
Remove seemingly superfluous attribute requirements on Descriptor clu…
hasty Jan 22, 2024
c7161de
Updates to electrical-power-measurement-server based on comments
hasty Jan 22, 2024
1ff7640
Remove defaults from MeasurementAccuracyRangeStruct to match spec update
hasty Jan 24, 2024
ab2ba44
Restore side="server" to events
hasty Jan 25, 2024
9117f30
Move common enums and bitmaps to detail:: instead of detail::Enums an…
hasty Jan 25, 2024
6b0b45c
Assign ID to Electrical Sensor device type
hasty Jan 25, 2024
adf13f6
Merge branch 'master' into granbery/electrical_measurement
hasty Jan 25, 2024
6dcf82c
Removed EPM and EEM from Root Node Device
hasty Jan 25, 2024
d788995
Restyled formatting is different than clang-format
hasty Jan 25, 2024
a9f0afd
Re-add FeatureMap to attributeAccessInterfaceAttributes for EEM and EPM
hasty Jan 25, 2024
ab17650
Regen after merge
hasty Jan 25, 2024
f854e11
Lock client on Electrical Sensor device type
hasty Jan 26, 2024
2d8fa4b
Remove unneeded using statement now that Enums are in detail::
hasty Jan 26, 2024
54b126f
Check for null iterators and error
hasty Jan 26, 2024
0fd361e
Switch to ResourceExhausted from CHIP_ERROR_INTERNAL
hasty Jan 26, 2024
29d6f41
Add stub for EPM cluster
hasty Jan 26, 2024
78c7658
Fixes for Python tests
hasty Jan 27, 2024
5677719
Merge branch 'master' into granbery/electrical_measurement
hasty Jan 27, 2024
887253a
Correct name for Ember init callback
hasty Jan 27, 2024
2e1d2c9
Formatting
hasty Jan 27, 2024
febcb9c
Merge branch 'master' into granbery/electrical_measurement
hasty Jan 27, 2024
8f1edea
Sync optional attributes list with .zap file for EPM
hasty Jan 27, 2024
3b4ad35
Add missing features to EPM stub
hasty Jan 27, 2024
1203545
Revert FeatureMap in attributeAccessInterfaceAttributes
hasty Jan 27, 2024
37e8fed
Allow FeatureMap in EEM constructor; add all-clusters-app EEM stub
hasty Jan 27, 2024
272ca37
Forgot zcl-with-test-extensions
hasty Jan 27, 2024
3fae3b4
Unregister EEM attribute access in destructor
hasty Jan 27, 2024
a951bf1
Remove redundant returns to keep clang-tidy happy
hasty Jan 28, 2024
d87f897
Merge branch 'master' into granbery/electrical_measurement
hasty Jan 30, 2024
0ed559c
Add CumulativeEnergyResetStruct and CumulativeEnergyReset attribute t…
hasty Jan 31, 2024
a730bf4
Merge branch 'granbery/electrical_measurement' of github.com:hasty/co…
hasty Jan 31, 2024
5ac33e5
Add optional CumulativeEnergyReset attribute to EEM
hasty Jan 31, 2024
94d96e4
Merge branch 'master' into granbery/electrical_measurement
hasty Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/measurement-and-sensing.xml \
src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \
Expand Down Expand Up @@ -193,6 +194,8 @@ jobs:
src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml \
"
- name: Build Apps
run: |
Expand Down
1 change: 1 addition & 0 deletions docs/clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Generally regenerate using one of:
| 114 | 0x72 | ActivatedCarbonFilterMonitoring |
| 128 | 0x80 | BooleanStateConfiguration |
| 129 | 0x81 | ValveConfigurationAndControl |
| 144 | 0x90 | ElectricalPowerMeasurement |
| 145 | 0x91 | ElectricalEnergyMeasurement |
| 150 | 0x96 | DemandResponseLoadControl |
| 152 | 0x98 | DeviceEnergyManagement |
Expand Down
138 changes: 136 additions & 2 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -3865,6 +3865,111 @@ provisional cluster ValveConfigurationAndControl = 129 {
command Close(): DefaultSuccess = 1;
}

/** This cluster provides a mechanism for querying data about electrical power as measured by the server. */
provisional cluster ElectricalPowerMeasurement = 144 {
revision 1;

enum MeasurementTypeEnum : enum16 {
kUnspecified = 0;
kVoltage = 1;
kActiveCurrent = 2;
kReactiveCurrent = 3;
kApparentCurrent = 4;
kActivePower = 5;
kReactivePower = 6;
kApparentPower = 7;
kRMSVoltage = 8;
kRMSCurrent = 9;
kRMSPower = 10;
kFrequency = 11;
kPowerFactor = 12;
kNeutralCurrent = 13;
kElectricalEnergy = 14;
}

enum PowerModeEnum : enum8 {
kUnknown = 0;
kDC = 1;
kAC = 2;
}

bitmap Feature : bitmap32 {
kDirectCurrent = 0x1;
kAlternatingCurrent = 0x2;
kPolyphasePower = 0x4;
kHarmonics = 0x8;
kPowerQuality = 0x10;
}

struct MeasurementAccuracyRangeStruct {
int64s rangeMin = 0;
int64s rangeMax = 1;
optional percent100ths percentMax = 2;
optional percent100ths percentMin = 3;
optional percent100ths percentTypical = 4;
optional int64u fixedMax = 5;
optional int64u fixedMin = 6;
optional int64u fixedTypical = 7;
}

struct MeasurementAccuracyStruct {
MeasurementTypeEnum measurementType = 0;
boolean measured = 1;
int64s minMeasuredValue = 2;
int64s maxMeasuredValue = 3;
MeasurementAccuracyRangeStruct accuracyRanges[] = 4;
}

struct HarmonicMeasurementStruct {
int8u order = 0;
nullable int64s measurement = 1;
}

struct MeasurementRangeStruct {
MeasurementTypeEnum measurementType = 0;
int64s min = 1;
int64s max = 2;
optional epoch_s startTimestamp = 3;
optional epoch_s endTimestamp = 4;
optional epoch_s minTimestamp = 5;
optional epoch_s maxTimestamp = 6;
optional systime_ms startSystime = 7;
optional systime_ms endSystime = 8;
optional systime_ms minSystime = 9;
optional systime_ms maxSystime = 10;
}

info event MeasurementPeriodRanges = 0 {
MeasurementRangeStruct ranges[] = 0;
}

readonly attribute PowerModeEnum powerMode = 0;
readonly attribute int8u numberOfMeasurementTypes = 1;
readonly attribute MeasurementAccuracyStruct accuracy[] = 2;
readonly attribute optional MeasurementRangeStruct ranges[] = 3;
readonly attribute optional nullable voltage_mv voltage = 4;
readonly attribute optional nullable amperage_ma activeCurrent = 5;
readonly attribute optional nullable amperage_ma reactiveCurrent = 6;
readonly attribute optional nullable amperage_ma apparentCurrent = 7;
readonly attribute nullable power_mw activePower = 8;
readonly attribute optional nullable power_mw reactivePower = 9;
readonly attribute optional nullable power_mw apparentPower = 10;
readonly attribute optional nullable voltage_mv RMSVoltage = 11;
readonly attribute optional nullable amperage_ma RMSCurrent = 12;
readonly attribute optional nullable power_mw RMSPower = 13;
readonly attribute optional nullable int64s frequency = 14;
readonly attribute optional nullable HarmonicMeasurementStruct harmonicCurrents[] = 15;
readonly attribute optional nullable HarmonicMeasurementStruct harmonicPhases[] = 16;
readonly attribute optional nullable int64s powerFactor = 17;
readonly attribute optional nullable amperage_ma neutralCurrent = 18;
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 provides a mechanism for querying data about the electrical energy imported or provided by the server. */
provisional cluster ElectricalEnergyMeasurement = 145 {
revision 1;
Expand Down Expand Up @@ -3914,7 +4019,7 @@ provisional cluster ElectricalEnergyMeasurement = 145 {
}

struct EnergyMeasurementStruct {
int64s energy = 0;
energy_mwh energy = 0;
optional epoch_s startTimestamp = 1;
optional epoch_s endTimestamp = 2;
optional systime_ms startSystime = 3;
Expand Down Expand Up @@ -8088,6 +8193,35 @@ endpoint 1 {
handle command Close;
}

server cluster ElectricalPowerMeasurement {
jamesharrow marked this conversation as resolved.
Show resolved Hide resolved
emits event MeasurementPeriodRanges;
callback attribute powerMode;
callback attribute numberOfMeasurementTypes;
callback attribute accuracy;
callback attribute ranges;
callback attribute voltage;
callback attribute activeCurrent;
callback attribute reactiveCurrent;
callback attribute apparentCurrent;
callback attribute activePower;
callback attribute reactivePower;
callback attribute apparentPower;
callback attribute RMSVoltage;
callback attribute RMSCurrent;
callback attribute RMSPower;
callback attribute frequency;
callback attribute harmonicCurrents;
callback attribute harmonicPhases;
callback attribute powerFactor;
callback attribute neutralCurrent;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
callback attribute featureMap;
ram attribute clusterRevision default = 1;
}

server cluster ElectricalEnergyMeasurement {
emits event CumulativeEnergyMeasured;
jamesharrow marked this conversation as resolved.
Show resolved Hide resolved
emits event PeriodicEnergyMeasured;
Expand All @@ -8100,7 +8234,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0x000F;
callback attribute featureMap;
ram attribute clusterRevision default = 1;
}

Expand Down
Loading
Loading