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 measurement #30389

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f7b5327
Added the xml for the electrical energy measurement cluster
drempelg Nov 9, 2023
6d8daca
Added convienience functions for sending events
drempelg Nov 9, 2023
1d0d228
Merge branch 'project-chip:master' into feature/electrical_energy_mea…
drempelg Nov 9, 2023
04c265b
Fixed weird whitespace
drempelg Nov 9, 2023
ab70458
ran codegen
drempelg Nov 9, 2023
fc07e11
Merge branch 'master' into feature/electrical_energy_measurement
andy31415 Dec 1, 2023
687eb04
Add license server
andy31415 Dec 1, 2023
93473de
Remove chip namespace prefix because we are in the chip namespace alr…
andy31415 Dec 1, 2023
bcab262
Restyle and use CHIP_ERROR_FORMAT
andy31415 Dec 1, 2023
4e84017
Fix header as well
andy31415 Dec 1, 2023
7ec6948
Restyle
andy31415 Dec 1, 2023
18cd9c9
Some changes from epoch_s to systime_ms
andy31415 Dec 1, 2023
e143561
Update the cluster to the latest version from the SPEC PR
andy31415 Dec 1, 2023
b1a96de
Zap regen
andy31415 Dec 1, 2023
8b71ae6
Remove files that are not generated anymore by our xmls
andy31415 Dec 1, 2023
e3d57b6
Mark struct type attributes as needing attributeAccessInterfaceAttrib…
andy31415 Dec 1, 2023
213b12c
Ran zap_convert_all.py
andy31415 Dec 1, 2023
f0242fc
zaq regen after zap convert
andy31415 Dec 1, 2023
257e86a
make all clusters compile
andy31415 Dec 1, 2023
2c9e00c
Fix domain
andy31415 Dec 1, 2023
9e08a51
Do not use PRIu64
andy31415 Dec 1, 2023
50489c0
Fix esp32 compilation - add server cluster directory
andy31415 Dec 1, 2023
1c300bf
Start adding an attribute encoding interface - for now we write nulls
andy31415 Dec 4, 2023
e33f683
Start adding some storage capability for the energy bits
andy31415 Dec 4, 2023
ca3dffe
Also add attribute access interface for accuracy
andy31415 Dec 4, 2023
5f4ab03
Also reserve space for dynamic endpoints. Note that accuracy setting …
andy31415 Dec 4, 2023
daa999b
Make reporting work when accuracy is changed
andy31415 Dec 4, 2023
0762886
Merge branch 'master' into feature/electrical_energy_measurement
andreilitvin Dec 5, 2023
2c86bc7
Fix featuremap default
andreilitvin Dec 5, 2023
742c52a
Merge branch 'master' into feature/electrical_energy_measurement
andreilitvin Dec 5, 2023
5053f99
XML updates based on review
andy31415 Dec 6, 2023
a465078
Zap regen all
andy31415 Dec 6, 2023
eb77b7b
Merge branch 'feature/electrical_energy_measurement' of github.com:dr…
andy31415 Dec 6, 2023
86beff5
Update some copyrights
andy31415 Dec 6, 2023
fa836c4
Merge branch 'master' into feature/electrical_energy_measurement
andy31415 Dec 6, 2023
b1382e0
Merge branch 'master' into feature/electrical_energy_measurement
andy31415 Dec 6, 2023
f876441
Undo submodule change
andy31415 Dec 6, 2023
5e55f0b
fix test
andy31415 Dec 6, 2023
2121ea2
Merge branch 'master' into feature/electrical_energy_measurement
andreilitvin Dec 8, 2023
8c132a2
Merge branch 'master' into feature/electrical_energy_measurement
andreilitvin Dec 8, 2023
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
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 | BooleanSensorConfiguration |
| 129 | 0x81 | ValveConfigurationAndControl |
| 145 | 0x91 | ElectricalEnergyMeasurement |
| 150 | 0x96 | DemandResponseLoadControl |
| 152 | 0x98 | DeviceEnergyManagement |
| 153 | 0x99 | EnergyEvse |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7583,5 +7583,6 @@
"endpointId": 4,
"networkId": 0
}
]
],
"log": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6063,5 +6063,6 @@
"endpointId": 1,
"networkId": 0
}
]
],
"log": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -3638,6 +3638,85 @@ cluster ActivatedCarbonFilterMonitoring = 114 {
command ResetCondition(): DefaultSuccess = 0;
}

/** This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */
provisional cluster ElectricalEnergyMeasurement = 145 {
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;
}

bitmap Feature : bitmap32 {
kImportedEnergy = 0x1;
kExportedEnergy = 0x2;
kCumulativeEnergy = 0x4;
kPeriodicEnergy = 0x8;
}

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 EnergyMeasurementStruct {
int64s energy = 0;
optional epoch_s startTimestamp = 1;
optional epoch_s endTimestamp = 2;
optional systime_ms startSystime = 3;
optional systime_ms endSystime = 4;
}

info event CumulativeEnergyMeasured = 0 {
optional EnergyMeasurementStruct energyImported = 0;
optional EnergyMeasurementStruct energyExported = 1;
}

info event PeriodicEnergyMeasured = 1 {
optional EnergyMeasurementStruct energyImported = 0;
optional EnergyMeasurementStruct energyExported = 1;
}

readonly attribute MeasurementAccuracyStruct accuracy = 0;
readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyImported = 1;
readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyExported = 2;
readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyImported = 3;
readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyExported = 4;
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;
}

/** Provides an interface for controlling and adjusting automatic window coverings. */
cluster WindowCovering = 258 {
revision 5;
Expand Down Expand Up @@ -7046,6 +7125,22 @@ endpoint 1 {
handle command ResetCondition;
}

server cluster ElectricalEnergyMeasurement {
emits event CumulativeEnergyMeasured;
emits event PeriodicEnergyMeasured;
callback attribute accuracy;
callback attribute cumulativeEnergyImported;
callback attribute cumulativeEnergyExported;
callback attribute periodicEnergyImported;
callback attribute periodicEnergyExported;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0x000F;
ram attribute clusterRevision default = 1;
}

server cluster WindowCovering {
ram attribute type default = 0x08;
ram attribute physicalClosedLimitLift default = 0xFFFF;
Expand Down
221 changes: 220 additions & 1 deletion examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -11524,6 +11524,225 @@
}
]
},
{
"name": "Electrical Energy Measurement",
"code": 145,
"mfgCode": null,
"define": "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER",
"side": "server",
"enabled": 1,
"apiMaturity": "provisional",
"attributes": [
{
"name": "Measured",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "boolean",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "false",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "Accuracy",
"code": 1,
"mfgCode": null,
"side": "server",
"type": "MeasurementAccuracyStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "CumulativeEnergyImported",
"code": 2,
"mfgCode": null,
"side": "server",
"type": "EnergyMeasurementStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "CumulativeEnergyExported",
"code": 3,
"mfgCode": null,
"side": "server",
"type": "EnergyMeasurementStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "PeriodicEnergyImported",
"code": 4,
"mfgCode": null,
"side": "server",
"type": "EnergyMeasurementStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "PeriodicEnergyExported",
"code": 5,
"mfgCode": null,
"side": "server",
"type": "EnergyMeasurementStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AcceptedCommandList",
"code": 65529,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EventList",
"code": 65530,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x000F",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
],
"events": [
{
"name": "CumulativeEnergyMeasured",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1
},
{
"name": "PeriodicEnergyMeasured",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1
}
]
},
{
"name": "Window Covering",
"code": 258,
Expand Down Expand Up @@ -21742,4 +21961,4 @@
}
],
"log": []
}
}
3 changes: 2 additions & 1 deletion examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/temperature-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-synchronization-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/dishwasher-alarm-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/electrical-energy-measurement-server"
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12252,5 +12252,6 @@
"endpointId": 65534,
"networkId": 0
}
]
],
"log": []
}
3 changes: 2 additions & 1 deletion examples/bridge-app/bridge-common/bridge-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -5753,5 +5753,6 @@
"endpointId": 2,
"networkId": 0
}
]
],
"log": []
}
Loading
Loading