Skip to content

Commit 5ac33e5

Browse files
committed
Add optional CumulativeEnergyReset attribute to EEM
1 parent a730bf4 commit 5ac33e5

40 files changed

+1033
-234
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+9
Original file line numberDiff line numberDiff line change
@@ -4012,6 +4012,13 @@ provisional cluster ElectricalEnergyMeasurement = 145 {
40124012
MeasurementAccuracyRangeStruct accuracyRanges[] = 4;
40134013
}
40144014

4015+
struct CumulativeEnergyResetStruct {
4016+
optional nullable epoch_s importedResetTimestamp = 0;
4017+
optional nullable epoch_s exportedResetTimestamp = 1;
4018+
optional nullable systime_ms importedResetSystime = 2;
4019+
optional nullable systime_ms exportedResetSystime = 3;
4020+
}
4021+
40154022
struct EnergyMeasurementStruct {
40164023
energy_mwh energy = 0;
40174024
optional epoch_s startTimestamp = 1;
@@ -4035,6 +4042,7 @@ provisional cluster ElectricalEnergyMeasurement = 145 {
40354042
readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyExported = 2;
40364043
readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyImported = 3;
40374044
readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyExported = 4;
4045+
readonly attribute optional nullable CumulativeEnergyResetStruct cumulativeEnergyReset = 5;
40384046
readonly attribute command_id generatedCommandList[] = 65528;
40394047
readonly attribute command_id acceptedCommandList[] = 65529;
40404048
readonly attribute event_id eventList[] = 65530;
@@ -8225,6 +8233,7 @@ endpoint 1 {
82258233
callback attribute cumulativeEnergyExported;
82268234
callback attribute periodicEnergyImported;
82278235
callback attribute periodicEnergyExported;
8236+
callback attribute cumulativeEnergyReset;
82288237
callback attribute generatedCommandList;
82298238
callback attribute acceptedCommandList;
82308239
callback attribute eventList;

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

+49-33
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@
1717
}
1818
],
1919
"package": [
20-
{
21-
"pathRelativity": "relativeToZap",
22-
"path": "../../../src/app/zap-templates/app-templates.json",
23-
"type": "gen-templates-json",
24-
"version": "chip-v1"
25-
},
2620
{
2721
"pathRelativity": "relativeToZap",
2822
"path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json",
2923
"type": "zcl-properties",
3024
"category": "matter",
3125
"version": 1,
3226
"description": "Matter SDK ZCL data with some extensions"
27+
},
28+
{
29+
"pathRelativity": "relativeToZap",
30+
"path": "../../../src/app/zap-templates/app-templates.json",
31+
"type": "gen-templates-json",
32+
"version": "chip-v1"
3333
}
3434
],
3535
"endpointTypes": [
@@ -9511,7 +9511,7 @@
95119511
"storageOption": "External",
95129512
"singleton": 0,
95139513
"bounded": 0,
9514-
"defaultValue": "",
9514+
"defaultValue": null,
95159515
"reportable": 1,
95169516
"minInterval": 1,
95179517
"maxInterval": 65534,
@@ -9667,7 +9667,7 @@
96679667
"storageOption": "External",
96689668
"singleton": 0,
96699669
"bounded": 0,
9670-
"defaultValue": "",
9670+
"defaultValue": null,
96719671
"reportable": 1,
96729672
"minInterval": 1,
96739673
"maxInterval": 65534,
@@ -11363,7 +11363,7 @@
1136311363
"storageOption": "External",
1136411364
"singleton": 0,
1136511365
"bounded": 0,
11366-
"defaultValue": "",
11366+
"defaultValue": null,
1136711367
"reportable": 1,
1136811368
"minInterval": 1,
1136911369
"maxInterval": 65534,
@@ -12709,7 +12709,7 @@
1270912709
"storageOption": "External",
1271012710
"singleton": 0,
1271112711
"bounded": 0,
12712-
"defaultValue": "",
12712+
"defaultValue": null,
1271312713
"reportable": 1,
1271412714
"minInterval": 1,
1271512715
"maxInterval": 65534,
@@ -12725,7 +12725,7 @@
1272512725
"storageOption": "External",
1272612726
"singleton": 0,
1272712727
"bounded": 0,
12728-
"defaultValue": "",
12728+
"defaultValue": null,
1272912729
"reportable": 1,
1273012730
"minInterval": 1,
1273112731
"maxInterval": 65534,
@@ -12741,7 +12741,7 @@
1274112741
"storageOption": "External",
1274212742
"singleton": 0,
1274312743
"bounded": 0,
12744-
"defaultValue": "",
12744+
"defaultValue": null,
1274512745
"reportable": 1,
1274612746
"minInterval": 1,
1274712747
"maxInterval": 65534,
@@ -12757,7 +12757,7 @@
1275712757
"storageOption": "External",
1275812758
"singleton": 0,
1275912759
"bounded": 0,
12760-
"defaultValue": "",
12760+
"defaultValue": null,
1276112761
"reportable": 1,
1276212762
"minInterval": 1,
1276312763
"maxInterval": 65534,
@@ -12773,7 +12773,7 @@
1277312773
"storageOption": "External",
1277412774
"singleton": 0,
1277512775
"bounded": 0,
12776-
"defaultValue": "",
12776+
"defaultValue": null,
1277712777
"reportable": 1,
1277812778
"minInterval": 1,
1277912779
"maxInterval": 65534,
@@ -12789,7 +12789,7 @@
1278912789
"storageOption": "External",
1279012790
"singleton": 0,
1279112791
"bounded": 0,
12792-
"defaultValue": "",
12792+
"defaultValue": null,
1279312793
"reportable": 1,
1279412794
"minInterval": 1,
1279512795
"maxInterval": 65534,
@@ -12805,7 +12805,7 @@
1280512805
"storageOption": "External",
1280612806
"singleton": 0,
1280712807
"bounded": 0,
12808-
"defaultValue": "",
12808+
"defaultValue": null,
1280912809
"reportable": 1,
1281012810
"minInterval": 1,
1281112811
"maxInterval": 65534,
@@ -12821,7 +12821,7 @@
1282112821
"storageOption": "External",
1282212822
"singleton": 0,
1282312823
"bounded": 0,
12824-
"defaultValue": "",
12824+
"defaultValue": null,
1282512825
"reportable": 1,
1282612826
"minInterval": 1,
1282712827
"maxInterval": 65534,
@@ -12837,7 +12837,7 @@
1283712837
"storageOption": "External",
1283812838
"singleton": 0,
1283912839
"bounded": 0,
12840-
"defaultValue": "",
12840+
"defaultValue": null,
1284112841
"reportable": 1,
1284212842
"minInterval": 1,
1284312843
"maxInterval": 65534,
@@ -12853,7 +12853,7 @@
1285312853
"storageOption": "External",
1285412854
"singleton": 0,
1285512855
"bounded": 0,
12856-
"defaultValue": "",
12856+
"defaultValue": null,
1285712857
"reportable": 1,
1285812858
"minInterval": 1,
1285912859
"maxInterval": 65534,
@@ -12869,7 +12869,7 @@
1286912869
"storageOption": "External",
1287012870
"singleton": 0,
1287112871
"bounded": 0,
12872-
"defaultValue": "",
12872+
"defaultValue": null,
1287312873
"reportable": 1,
1287412874
"minInterval": 1,
1287512875
"maxInterval": 65534,
@@ -12885,7 +12885,7 @@
1288512885
"storageOption": "External",
1288612886
"singleton": 0,
1288712887
"bounded": 0,
12888-
"defaultValue": "",
12888+
"defaultValue": null,
1288912889
"reportable": 1,
1289012890
"minInterval": 1,
1289112891
"maxInterval": 65534,
@@ -12901,7 +12901,7 @@
1290112901
"storageOption": "External",
1290212902
"singleton": 0,
1290312903
"bounded": 0,
12904-
"defaultValue": "",
12904+
"defaultValue": null,
1290512905
"reportable": 1,
1290612906
"minInterval": 1,
1290712907
"maxInterval": 65534,
@@ -12917,7 +12917,7 @@
1291712917
"storageOption": "External",
1291812918
"singleton": 0,
1291912919
"bounded": 0,
12920-
"defaultValue": "",
12920+
"defaultValue": null,
1292112921
"reportable": 1,
1292212922
"minInterval": 1,
1292312923
"maxInterval": 65534,
@@ -12933,7 +12933,7 @@
1293312933
"storageOption": "External",
1293412934
"singleton": 0,
1293512935
"bounded": 0,
12936-
"defaultValue": "",
12936+
"defaultValue": null,
1293712937
"reportable": 1,
1293812938
"minInterval": 1,
1293912939
"maxInterval": 65534,
@@ -12949,7 +12949,7 @@
1294912949
"storageOption": "External",
1295012950
"singleton": 0,
1295112951
"bounded": 0,
12952-
"defaultValue": "",
12952+
"defaultValue": null,
1295312953
"reportable": 1,
1295412954
"minInterval": 1,
1295512955
"maxInterval": 65534,
@@ -12965,7 +12965,7 @@
1296512965
"storageOption": "External",
1296612966
"singleton": 0,
1296712967
"bounded": 0,
12968-
"defaultValue": "",
12968+
"defaultValue": null,
1296912969
"reportable": 1,
1297012970
"minInterval": 1,
1297112971
"maxInterval": 65534,
@@ -12981,7 +12981,7 @@
1298112981
"storageOption": "External",
1298212982
"singleton": 0,
1298312983
"bounded": 0,
12984-
"defaultValue": "",
12984+
"defaultValue": null,
1298512985
"reportable": 1,
1298612986
"minInterval": 1,
1298712987
"maxInterval": 65534,
@@ -12997,7 +12997,7 @@
1299712997
"storageOption": "External",
1299812998
"singleton": 0,
1299912999
"bounded": 0,
13000-
"defaultValue": "",
13000+
"defaultValue": null,
1300113001
"reportable": 1,
1300213002
"minInterval": 1,
1300313003
"maxInterval": 65534,
@@ -13013,7 +13013,7 @@
1301313013
"storageOption": "External",
1301413014
"singleton": 0,
1301513015
"bounded": 0,
13016-
"defaultValue": "",
13016+
"defaultValue": null,
1301713017
"reportable": 1,
1301813018
"minInterval": 1,
1301913019
"maxInterval": 65534,
@@ -13029,7 +13029,7 @@
1302913029
"storageOption": "External",
1303013030
"singleton": 0,
1303113031
"bounded": 0,
13032-
"defaultValue": "",
13032+
"defaultValue": null,
1303313033
"reportable": 1,
1303413034
"minInterval": 1,
1303513035
"maxInterval": 65534,
@@ -13045,7 +13045,7 @@
1304513045
"storageOption": "External",
1304613046
"singleton": 0,
1304713047
"bounded": 0,
13048-
"defaultValue": "",
13048+
"defaultValue": null,
1304913049
"reportable": 1,
1305013050
"minInterval": 1,
1305113051
"maxInterval": 65534,
@@ -13061,7 +13061,7 @@
1306113061
"storageOption": "External",
1306213062
"singleton": 0,
1306313063
"bounded": 0,
13064-
"defaultValue": "",
13064+
"defaultValue": null,
1306513065
"reportable": 1,
1306613066
"minInterval": 1,
1306713067
"maxInterval": 65534,
@@ -13077,7 +13077,7 @@
1307713077
"storageOption": "External",
1307813078
"singleton": 0,
1307913079
"bounded": 0,
13080-
"defaultValue": "0",
13080+
"defaultValue": null,
1308113081
"reportable": 1,
1308213082
"minInterval": 1,
1308313083
"maxInterval": 65534,
@@ -13199,6 +13199,22 @@
1319913199
"maxInterval": 65534,
1320013200
"reportableChange": 0
1320113201
},
13202+
{
13203+
"name": "CumulativeEnergyReset",
13204+
"code": 5,
13205+
"mfgCode": null,
13206+
"side": "server",
13207+
"type": "CumulativeEnergyResetStruct",
13208+
"included": 1,
13209+
"storageOption": "External",
13210+
"singleton": 0,
13211+
"bounded": 0,
13212+
"defaultValue": null,
13213+
"reportable": 1,
13214+
"minInterval": 1,
13215+
"maxInterval": 65534,
13216+
"reportableChange": 0
13217+
},
1320213218
{
1320313219
"name": "GeneratedCommandList",
1320413220
"code": 65528,

examples/all-clusters-app/all-clusters-common/src/electrical-energy-measurement-stub.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ void emberAfElectricalEnergyMeasurementClusterInitCallback(chip::EndpointId endp
3030
VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1.
3131
VerifyOrDie(!gAttrAccess);
3232

33-
gAttrAccess = std::make_unique<ElectricalEnergyMeasurementAttrAccess>(BitMask<Feature, uint32_t>(
34-
Feature::kImportedEnergy, Feature::kExportedEnergy, Feature::kCumulativeEnergy, Feature::kPeriodicEnergy));
33+
gAttrAccess = std::make_unique<ElectricalEnergyMeasurementAttrAccess>(
34+
BitMask<Feature, uint32_t>(Feature::kImportedEnergy, Feature::kExportedEnergy, Feature::kCumulativeEnergy,
35+
Feature::kPeriodicEnergy),
36+
BitMask<OptionalAttributes, uint32_t>(OptionalAttributes::kOptionalAttributeCumulativeEnergyReset));
3537

3638
if (gAttrAccess)
3739
{

examples/energy-management-app/energy-management-common/energy-management-app.matter

+8
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,13 @@ provisional cluster ElectricalEnergyMeasurement = 145 {
948948
MeasurementAccuracyRangeStruct accuracyRanges[] = 4;
949949
}
950950

951+
struct CumulativeEnergyResetStruct {
952+
optional nullable epoch_s importedResetTimestamp = 0;
953+
optional nullable epoch_s exportedResetTimestamp = 1;
954+
optional nullable systime_ms importedResetSystime = 2;
955+
optional nullable systime_ms exportedResetSystime = 3;
956+
}
957+
951958
struct EnergyMeasurementStruct {
952959
energy_mwh energy = 0;
953960
optional epoch_s startTimestamp = 1;
@@ -971,6 +978,7 @@ provisional cluster ElectricalEnergyMeasurement = 145 {
971978
readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyExported = 2;
972979
readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyImported = 3;
973980
readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyExported = 4;
981+
readonly attribute optional nullable CumulativeEnergyResetStruct cumulativeEnergyReset = 5;
974982
readonly attribute command_id generatedCommandList[] = 65528;
975983
readonly attribute command_id acceptedCommandList[] = 65529;
976984
readonly attribute event_id eventList[] = 65530;

0 commit comments

Comments
 (0)