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

Add Electrical power measurement to energy management app #31616

Merged
Changes from 1 commit
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
42378df
Hoist shared enums and bitmaps into detail namespace
hasty Dec 14, 2023
5ee8f28
Regenerate
hasty Dec 14, 2023
849cad0
Add electrical measurement clusters
hasty Nov 21, 2023
d0428be
Add NumberOfMeasurements attribute
hasty Nov 22, 2023
9e1584a
Bump to latest spec
hasty Jan 17, 2024
c575ae6
Bump ZAP version
hasty Jan 17, 2024
05fecc3
Remove Electrical Measurement cluster
hasty Jan 18, 2024
76d8ddd
Add initial Electrical Power Measurement cluster implementation
hasty Jan 18, 2024
b69252b
Revert "Remove Electrical Measurement cluster"
hasty Jan 18, 2024
cd6f0d6
Fix incorrect min/max values on energy attributes
hasty Jan 19, 2024
4dd9b67
Formatting electrical-power-measurement-server
hasty Jan 19, 2024
21d08bf
Regen after restoring deprecated electrical measurement cluster
hasty Jan 19, 2024
565b64c
Re-add inexplicably important blank line to zap_execution.py
hasty Jan 19, 2024
1ffda41
De-alphabetize list of files to avoid breaking GH action
hasty Jan 19, 2024
8ebcd8d
Semi-realphabetize?
hasty Jan 19, 2024
c2bf953
Added EPM cluster to Energy Management App
jamesharrow Jan 22, 2024
76574fa
Restore strangely dropped events
hasty Jan 19, 2024
6768141
Better BitMask handling
hasty Jan 19, 2024
d223821
Change min/max on electrical measurements to be decimal instead of hex
hasty Jan 22, 2024
cbd200c
Rename meas-and-sense to measurement-and-sensing.xml
hasty Jan 22, 2024
f3fdd5b
Remove seemingly superfluous attribute requirements on Descriptor clu…
hasty Jan 22, 2024
6728e90
Updates to electrical-power-measurement-server based on comments
hasty Jan 22, 2024
8322207
Merge branch 'upstream-master' into granbery/electrical_measurement-A…
jamesharrow Jan 22, 2024
d9ba277
Take all-clusters-zap from upstream-master.
jamesharrow Jan 22, 2024
9a51fc1
Added side=server into electrical-power and electrical-energy cluster…
jamesharrow Jan 22, 2024
7b937ac
Updated all-clusters.zap and reran autogen. Added EPM cluster to ener…
jamesharrow Jan 22, 2024
383deef
Added initial version of EPM delegate and instance to energy-manageme…
jamesharrow Jan 22, 2024
4e2109e
Enabled Electrical Energy Measurement in example-energy-management-ap…
jamesharrow Jan 23, 2024
2657e28
Added ElectricalEnergyMeasurement to chip-repl __init__.py
jamesharrow Jan 23, 2024
5104e2d
Restyled by isort
restyled-commits Jan 23, 2024
1174c33
Changed feature map to indicate CUME and IMP support only
jamesharrow Jan 23, 2024
341cd20
Merge branch 'master' into 31258-13-the-implementation-of-the-electri…
jamesharrow Jan 23, 2024
664e12c
Adding into __all__ some missing clusters which are causing flake8 is…
jamesharrow Jan 23, 2024
9da8f32
Removed out of date comment
jamesharrow Jan 23, 2024
c6971eb
Added a test event trigger to fake energy reporting readings into the…
jamesharrow Jan 23, 2024
5f0c4af
Added new Energy Reporting TE Trigger delegate
jamesharrow Jan 23, 2024
f975000
Updated random calculation and scaled into mWh (divide by 3600)
jamesharrow Jan 23, 2024
36e928a
Restyled by whitespace
restyled-commits Jan 23, 2024
5192257
Restyled by gn
restyled-commits Jan 23, 2024
e4715d7
Removed accidental launch.json inclusion
jamesharrow Jan 23, 2024
16fb7d9
Fix for ARM linux etc builds due to gn dependency check error
jamesharrow Jan 24, 2024
014fa25
Merge branch 'upstream-master' into 31258-13-the-implementation-of-th…
jamesharrow Jan 24, 2024
0b7e6f5
Added code review suggestions.
jamesharrow Jan 24, 2024
88abbdb
More code review suggestions fixed.
jamesharrow Jan 24, 2024
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
2064e85
Merge branch 'master' into 31258-13-the-implementation-of-the-electri…
jamesharrow 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
e496350
Added electrical-energy-measurement-server to CMakelist to fix linker…
jamesharrow Jan 26, 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
27aaa23
Merge branch 'granbery/electrical_measurement' into granbery/electric…
jamesharrow Jan 26, 2024
bbc0533
Merge branch '31258-13-the-implementation-of-the-electrical-energy-me…
jamesharrow Jan 26, 2024
68084c1
Re-enabled EEM in energy management app and regen all after previous …
jamesharrow Jan 26, 2024
d392bd9
Some refactoring to add EPM Instance into the EVSEManufacturer class …
jamesharrow Jan 26, 2024
8782d9f
Missed one file.
jamesharrow Jan 26, 2024
0cd0549
Fixed crash due to unassigned dg pointer. Power/Voltage/Current fakin…
jamesharrow Jan 26, 2024
5636975
Touch file since restyled crashed
jamesharrow Jan 26, 2024
eeb4e71
Restyled by gn
restyled-commits Jan 26, 2024
013ae77
Restyled by isort
restyled-commits Jan 26, 2024
29d6f41
Add stub for EPM cluster
hasty Jan 26, 2024
4e401d2
Reverted whitespace change
jamesharrow Jan 26, 2024
cc4c144
Merge branch 'upstream-master' into granbery/electrical_measurement-A…
jamesharrow Jan 26, 2024
9978a08
Did regen_all after merge from master to resolve conflicts.
jamesharrow Jan 27, 2024
2d6e59a
Put back line of clusters which somehow got deleted accidentally.
jamesharrow Jan 27, 2024
f89a9a9
Merge branch 'upstream-master' into granbery/electrical_measurement-A…
jamesharrow Jan 27, 2024
fa610ef
Remerged ZAP file and regen all after resolving conflicts.
jamesharrow Jan 27, 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
39a3c04
Fix for issue mentioned in code review on EEM cluster limiting the nu…
jamesharrow Jan 28, 2024
72600fd
Refactoring to have a common EvseMain across all platforms to avoid m…
jamesharrow Jan 28, 2024
3276299
Merge remote-tracking branch 'hasty_epm/granbery/electrical_measureme…
jamesharrow Jan 28, 2024
ae00d9f
Added electrical-power-measurement-server to ESP32 CMakeLists.txt
jamesharrow Jan 28, 2024
9a9db14
Merge remote-tracking branch 'upstream/master' into granbery/electric…
jamesharrow Jan 29, 2024
60e60c4
Merge remote-tracking branch 'upstream/master' into granbery/electric…
jamesharrow Jan 30, 2024
82bbadf
Updated Matter device types to add EVSE
jamesharrow Jan 30, 2024
ae73d8d
Merge remote-tracking branch 'upstream/master' into granbery/electric…
jamesharrow Feb 4, 2024
38732a8
Open and saved energy-management-app.zap and regen_all
jamesharrow Feb 4, 2024
62fd3fa
Removed duplicate ElectricalEnergyMeasurment class which was accident…
jamesharrow Feb 4, 2024
626f976
Merge remote-tracking branch 'upstream/master' into granbery/electric…
jamesharrow Feb 4, 2024
821c07f
Added support for test event triggers and handling of reading events …
jamesharrow Feb 4, 2024
98cf8ae
Made TC_EEVSE_Utils.py use the matter_testing_support instead of its …
jamesharrow Feb 4, 2024
bfa7f0e
Restyled by isort
restyled-commits Feb 4, 2024
71b8c66
Cherry pick from Tweaks to EVSE Test plans (Issue #31460)
jamesharrow Feb 4, 2024
3775ade
Changed the random value generation to make the values +/- and handle…
jamesharrow Feb 5, 2024
bf7972b
Enabled cumulativeEnergyExported in Energy-management-app.
jamesharrow Feb 5, 2024
68af0a0
Added initial electrical power measurement 2.2 test case
jamesharrow Feb 5, 2024
f37e745
Changed copyright date
jamesharrow Feb 6, 2024
d35c70c
Code review comment fixes.
jamesharrow Feb 6, 2024
bb748c6
Changed to c++ style cast
jamesharrow Feb 6, 2024
90e01a7
Fixed trailing whitepace
jamesharrow Feb 6, 2024
00fb2d9
Merge branch 'upstream-master' into granbery/electrical_measurement-A…
jamesharrow Feb 6, 2024
db9bb17
Added support for testing read of EEM attributes and change of values
jamesharrow Feb 6, 2024
227516c
Corrected EPM references in TC_EEM_2_2. Added TC_EEM_2_3
jamesharrow Feb 6, 2024
1fc8759
Added periodic energy reporting, and new cumulativeEnergyReset attrib…
jamesharrow Feb 6, 2024
69d000e
Added periodic energy reading support and TC_EEM_2_3 to 2_5.
jamesharrow Feb 6, 2024
f40837d
Python removed unused logging and EventChangeCallback
jamesharrow Feb 6, 2024
35b446b
Updates to align to test plan PR #3949
jamesharrow Feb 7, 2024
ab55452
Added initial EEM_2_1 test script.
jamesharrow Feb 7, 2024
babf463
Added example of setting EEM Accuracy and EEM CumulativeEnergyReset s…
jamesharrow Feb 7, 2024
f536ffb
Restyled by whitespace
restyled-commits Feb 7, 2024
1757efa
Restyled
jamesharrow Feb 8, 2024
078af94
Removed extra spaces in TC_EEM_2_1.py
jamesharrow Feb 8, 2024
e85b3f0
Removed unused EnergyManagementManager.cpp/.h
jamesharrow Feb 8, 2024
d72ab68
Fixed PowerMode = kAc
jamesharrow Feb 8, 2024
ae08b31
Merge branch 'upstream-master' into granbery/electrical_measurement-A…
jamesharrow Feb 8, 2024
ad6505b
Initial TC_EPM_2_1.py script
jamesharrow Feb 8, 2024
689884f
Restyled by isort
restyled-commits Feb 8, 2024
c95b1ea
Merge branch 'upstream-master' into granbery/electrical_measurement-A…
jamesharrow Feb 8, 2024
b1f497d
Merged TC_EEVSE tests back in
jamesharrow Feb 8, 2024
9b3b7eb
Initialized NumberOfMeasurementTypes
jamesharrow Feb 8, 2024
ce708f8
Added EEM 2.1,2.2,2.3,2.4,2.5 and EPM 2.1,2.2 into CI workflow tests.…
jamesharrow Feb 8, 2024
d04127e
Interim state - partially refactored how Measurement Structs are enco…
jamesharrow Feb 9, 2024
f3d0efd
Merge remote-tracking branch 'upstream/master' into granbery/electric…
jamesharrow Feb 9, 2024
e6fab15
Removed SetNumberOfMeasurementTypes since this can be derived from th…
jamesharrow Feb 9, 2024
80bc590
Completed TC_EPM_2_1.py script
jamesharrow Feb 9, 2024
d19b1b9
Corrected test plan spec reference.
jamesharrow Feb 9, 2024
68a1890
Test EPM_2_1 now runs and passes. Allows checking that attributes are…
jamesharrow Feb 9, 2024
c068b61
Revert unintended change to tests.yaml
jamesharrow Feb 9, 2024
4efe496
Python test case code-review updates
jamesharrow Feb 9, 2024
2a16811
Removed old range iterator.
jamesharrow Feb 9, 2024
34e52cd
Fixed lint issues and adjusted timings to match the test plan pr.
jamesharrow Feb 9, 2024
88fa403
Fixed all-clusters electrical-power-measurement cluster by using the …
jamesharrow Feb 9, 2024
9ba5390
Implemented HarmonicCurrents and HarmonicStructs (to return empty lis…
jamesharrow Feb 9, 2024
ebc6243
Changed the API to ensure that a delegate doesn't change the data mid…
jamesharrow Feb 11, 2024
fa7cb67
Applying suggested changes
jamesharrow Feb 11, 2024
db4f09e
Incorporated feedback from review to simplify the code
jamesharrow Feb 12, 2024
9d6ad9f
Removed comment per code review
jamesharrow Feb 12, 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
Prev Previous commit
Next Next commit
Changed the random value generation to make the values +/- and handle…
… sign conversion to avoid compile warnings
jamesharrow committed Feb 5, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
lilnasy Arsh
commit 3775adec6fc086a1366c9d14bafa4ecb50017df1
Original file line number Diff line number Diff line change
@@ -253,11 +253,11 @@ void EVSEManufacturer::FakeReadingsUpdate()

// Update readings
// Avoid using floats - so we will do a basic rand() call which will generate a integer value between 0 and RAND_MAX
// first compute power as a nominal + some random value in range 0 to mPowerRandomness_mW
int64_t power = (rand() % gFakeReadingsData.mPowerRandomness_mW);
// first compute power as a mean + some random value in range +/- mPowerRandomness_mW
int64_t power = ((int64_t) rand() % (2 * gFakeReadingsData.mPowerRandomness_mW)) - gFakeReadingsData.mPowerRandomness_mW;
power += gFakeReadingsData.mPower_mW; // add in the base power

int64_t voltage = (rand() % gFakeReadingsData.mVoltageRandomness_mV);
int64_t voltage = ((int64_t) rand() % (2 * gFakeReadingsData.mVoltageRandomness_mV)) - gFakeReadingsData.mVoltageRandomness_mV;
voltage += gFakeReadingsData.mVoltage_mV; // add in the base voltage

/* Note: whilst we could compute a current from the power and voltage,
@@ -267,7 +267,7 @@ void EVSEManufacturer::FakeReadingsUpdate()
* This is meant more as an example to show how to use the APIs, not
* to be a real representation of laws of physics.
*/
int64_t current = (rand() % gFakeReadingsData.mCurrentRandomness_mA);
int64_t current = ((int64_t) rand() % (2 * gFakeReadingsData.mCurrentRandomness_mA)) - gFakeReadingsData.mCurrentRandomness_mA;
current += gFakeReadingsData.mCurrent_mA; // add in the base current

SendPowerReading(gFakeReadingsData.mEndpointId, power, voltage, current);