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

Water heater management server impl #34230

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
cf2e8ab
Updated device-energy-management-cluster.xml and energy-evse-cluster.…
jamesharrow May 29, 2024
1b9021e
Regen_all checked in.
jamesharrow May 29, 2024
c508af5
Added missing energy-management-app.matter
jamesharrow May 29, 2024
2ed3c01
Updated with spec PR #9251 merged to master.
jamesharrow May 30, 2024
f34083f
Updated with spec PR #9266 (change ForecastId -> ForecastID)
jamesharrow May 30, 2024
824f90b
regen_all
jamesharrow May 30, 2024
6ca83b4
Removed extra entryType="PowerAdjustStruct" which causes incorrect ge…
jamesharrow Jun 3, 2024
c9c27a5
Removed extra min="-4611686018427387904" max="4611686018427387903" wh…
jamesharrow Jun 3, 2024
59c5802
Updated after regen_all
jamesharrow Jun 3, 2024
26d3030
Reverted max="86400" in RANDOMIZATION_DELAY_WINDOW which upsets some …
jamesharrow Jun 3, 2024
6ce2430
Added missing autogen'd code for DEM changes.
jamesharrow Jun 3, 2024
2380b98
Fix up compilation errors caused by change to forecastID and powerAdj…
jamesharrow Jun 3, 2024
9bd8e16
Merge branch 'upstream-master' into Update_Energy_Cluster_XML_For_1_4
jamesharrow Jun 18, 2024
482a6af
Added Water Heater Management cluster XML
jamesharrow Jun 18, 2024
f53bfeb
Added Water Heater Management to controller-clusters.zap
jamesharrow Jun 18, 2024
7e510b1
Added Water Heater Management to zap_cluster_list.json
jamesharrow Jun 18, 2024
749636e
Added Water Heater Management cluster to all-clusters-app.zap
jamesharrow Jun 18, 2024
6c7c308
Tried to add apiMaturity="provisional" to silence deprecation warning…
jamesharrow Jun 18, 2024
f5c4f62
Added all-clusters-app.matter and controller-clusters.matter after re…
jamesharrow Jun 18, 2024
81f7009
Added output from regen_all.py
jamesharrow Jun 18, 2024
61668a3
Merge branch 'master' into Update_Energy_Cluster_XML_For_1_4
jamesharrow Jun 18, 2024
df7ad2b
Updated .zap files after adding provisional flag.
jamesharrow Jun 18, 2024
aa58bed
Added Java matter controller now that apiMaturity=provisional has pop…
jamesharrow Jun 18, 2024
ad27399
Trying to remove Thread Border Router Management in controller-cluste…
jamesharrow Jun 18, 2024
50308fd
Removed water-heater-management-server for now so compilers don't try…
jamesharrow Jun 18, 2024
5330712
Reverted all-clusters-app.zap (removed Water heater). Reverted contro…
jamesharrow Jun 18, 2024
2cbeab7
updated all-clusters-app.matter after removing WaterHeaterManagement …
jamesharrow Jun 18, 2024
4944127
Candidate fix for THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER which resol…
jamesharrow Jun 18, 2024
dfb81db
Merge branch 'project-chip:master' into Update_Energy_Cluster_XML_For…
jamesharrow Jun 18, 2024
f8b35c2
Merge branch 'upstream-master' into Update_Energy_Cluster_XML_For_1_4
jamesharrow Jun 19, 2024
44441b8
Initial implementation of the water heater management server
PeterC1965 Jun 20, 2024
87a55bf
Get all-clusters-app building with water-heater-management cluster
PeterC1965 Jun 20, 2024
daab57e
Add some debug prints
PeterC1965 Jun 20, 2024
8a0f8e5
Add water-heater-management-app
PeterC1965 Jun 21, 2024
9357945
Implement TC_EWATERHTR_2_1.py
PeterC1965 Jun 22, 2024
40e4c8c
Implement TC_EWATERHTR_2_1.py
PeterC1965 Jun 22, 2024
97f2dbe
Start on WHM 2.2 + initial support for WaterHeater modes
PeterC1965 Jun 22, 2024
f8cfb75
Add support for the WaterHeaterMode cluster
PeterC1965 Jun 22, 2024
c3c19a3
Add support for the WaterHeaterMode cluster
PeterC1965 Jun 22, 2024
f1d9d45
Add support for the WaterHeaterMode cluster
PeterC1965 Jun 22, 2024
1c5c56d
Improve water heater mode implementation
PeterC1965 Jun 23, 2024
3b7e00c
Complete implementation of test TC_EWATERHTR_2_2
PeterC1965 Jun 24, 2024
542204f
Get WHM 2.2 passing
PeterC1965 Jun 24, 2024
29e7979
Get WHM test 2.3 working
PeterC1965 Jun 24, 2024
5283e9c
Check feature map
PeterC1965 Jun 24, 2024
acca32d
Start getting ESP32 target building
PeterC1965 Jun 24, 2024
3e7f6a4
Take water-heater-management out of all-clusters-app
PeterC1965 Jun 24, 2024
587f33e
Add water-heater-management app to config files and regenerate zzz files
PeterC1965 Jun 24, 2024
f26be3d
Get ESP32 WHM target building
PeterC1965 Jun 24, 2024
d72f443
Tidy ups
PeterC1965 Jun 24, 2024
ad6c1f8
Merge branch 'master' into water-heater-management-server-impl
PeterC1965 Jun 24, 2024
89d433d
Regenerate zap files
PeterC1965 Jun 24, 2024
bf3e798
Use the manufacturer object to determine heating sources and turn on/…
PeterC1965 Jun 25, 2024
275b471
Remove TODOs
PeterC1965 Jun 25, 2024
7486cc3
Bring into line with latest spec changes
PeterC1965 Jun 25, 2024
e1463a5
Tidy up python code
PeterC1965 Jun 26, 2024
bb75aa3
Initialise the WaterHeaterModeInstance
PeterC1965 Jun 26, 2024
d22e735
Fix CI tests
PeterC1965 Jun 26, 2024
8e5046b
Merge branch 'master' into water-heater-management-server-impl
PeterC1965 Jun 26, 2024
155c495
Catch up with head master + regenerate all files
PeterC1965 Jun 26, 2024
d44f3ed
Catch up with head master + regenerate all files
PeterC1965 Jun 26, 2024
54f87e5
Improve error handling
PeterC1965 Jul 4, 2024
268bd0e
Merge branch 'master' into water-heater-management-server-impl
PeterC1965 Jul 8, 2024
778f60a
Restyled by whitespace
restyled-commits Jul 8, 2024
1b35c85
Restyled by clang-format
restyled-commits Jul 8, 2024
0b9ca86
Restyled by gn
restyled-commits Jul 8, 2024
7e56303
Restyled by prettier-markdown
restyled-commits Jul 8, 2024
e53e501
Restyled by autopep8
restyled-commits Jul 8, 2024
514dc47
Restyled by isort
restyled-commits Jul 8, 2024
9083688
Enable uniqueID in the BasicInformation cluster
PeterC1965 Jul 8, 2024
678aa7f
Regenerate zap files
PeterC1965 Jul 8, 2024
e32ec37
Apply review comments from Boris
PeterC1965 Jul 16, 2024
fc90ec5
Add command line support for specifying the featureMap + fix logic in…
PeterC1965 Jul 17, 2024
588d64c
Add command line support for specifying the featureMap + fix logic in…
PeterC1965 Jul 17, 2024
7190fef
Restyled by clang-format
restyled-commits Jul 17, 2024
f8a385a
Merge branch 'master' into water-heater-management-server-impl
PeterC1965 Jul 18, 2024
eb6de20
Finish merge
PeterC1965 Jul 18, 2024
1528700
Apply code review changes
PeterC1965 Jul 18, 2024
09d01a9
Sync up with review comments
PeterC1965 Jul 21, 2024
e05568e
Return ModeBase::StatusCode::kSuccess in WaterHeaterManagementDelegat…
PeterC1965 Jul 21, 2024
b1e4164
Update from fixes done on other branches
PeterC1965 Jul 22, 2024
4929eef
Merge branch 'master' into water-heater-management-server-impl
PeterC1965 Jul 22, 2024
8e84752
Tidy up merge from master
PeterC1965 Jul 22, 2024
433d33d
Add RUNNER commands
PeterC1965 Jul 22, 2024
c33273b
Merge branch 'master' into water-heater-management-server-impl
PeterC1965 Jul 23, 2024
94909fd
Update following test script changes
PeterC1965 Jul 25, 2024
4715c98
Update following test script changes
PeterC1965 Jul 25, 2024
8ce0b33
Merge branch 'master' into water-heater-management-server-impl
PeterC1965 Jul 25, 2024
1101eea
Merge branch 'master' into water-heater-management-server-impl
PeterC1965 Jul 25, 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
2 changes: 2 additions & 0 deletions data_model/1.3/clusters/cluster_ids.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@
"129": "Valve Configuration and Control",
"144": "Electrical Power Measurement",
"145": "Electrical Energy Measurement",
"148": "Water Heater Management",
"151": "Messages",
"152": "Device Energy Management",
"153": "Energy EVSE",
"155": "Energy Preference",
"156": "Power Topology",
"157": "Energy EVSE Mode",
"158": "Water Heater Mode",
"159": "Device Energy Management Mode",
"257": "Door Lock",
"258": "Window Covering",
Expand Down
7 changes: 7 additions & 0 deletions examples/platform/linux/AppMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
#if CHIP_DEVICE_CONFIG_ENABLE_ENERGY_REPORTING_TRIGGER
#include <app/clusters/electrical-energy-measurement-server/EnergyReportingTestEventTriggerHandler.h>
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WATER_HEATER_MANAGEMENT_TRIGGER
#include <app/clusters/water-heater-management-server/WaterHeaterManagementTestEventTriggerHandler.h>
#endif
#include <app/TestEventTriggerDelegate.h>

#include <signal.h>
Expand Down Expand Up @@ -553,6 +556,10 @@ void ChipLinuxAppMainLoop(AppMainLoopImplementation * impl)
static EnergyReportingTestEventTriggerHandler sEnergyReportingTestEventTriggerHandler;
sTestEventTriggerDelegate.AddHandler(&sEnergyReportingTestEventTriggerHandler);
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WATER_HEATER_MANAGEMENT_TRIGGER
static WaterHeaterManagementTestEventTriggerHandler sWaterHeaterManagementTestEventTriggerHandler;
sTestEventTriggerDelegate.AddHandler(&sWaterHeaterManagementTestEventTriggerHandler);
#endif

initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;

Expand Down
2 changes: 2 additions & 0 deletions examples/platform/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ declare_args() {
chip_enable_boolean_state_configuration_trigger = false
chip_enable_energy_evse_trigger = false
chip_enable_energy_reporting_trigger = false
chip_enable_water_heater_management_trigger = false
}

config("app-main-config") {
Expand Down Expand Up @@ -117,6 +118,7 @@ source_set("app-main") {
"CHIP_DEVICE_CONFIG_ENABLE_BOOLEAN_STATE_CONFIGURATION_TRIGGER=${chip_enable_boolean_state_configuration_trigger}",
"CHIP_DEVICE_CONFIG_ENABLE_ENERGY_EVSE_TRIGGER=${chip_enable_energy_evse_trigger}",
"CHIP_DEVICE_CONFIG_ENABLE_ENERGY_REPORTING_TRIGGER=${chip_enable_energy_reporting_trigger}",
"CHIP_DEVICE_CONFIG_ENABLE_WATER_HEATER_MANAGEMENT_TRIGGER=${chip_enable_water_heater_management_trigger}",
]

public_configs = [ ":app-main-config" ]
Expand Down
4 changes: 4 additions & 0 deletions examples/water-heater-management-app/esp32/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/build/
/sdkconfig
/sdkconfig.old
main/insights_auth_key.txt
87 changes: 87 additions & 0 deletions examples/water-heater-management-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#
# Copyright (c) 2021-2024 Project CHIP Authors
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

set(PROJECT_VER "v1.0")
set(PROJECT_VER_NUMBER 1)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/cmake/idf_flashing.cmake)

set(EXTRA_COMPONENT_DIRS
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components"
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common"
)

if(${IDF_TARGET} STREQUAL "esp32")
list(APPEND EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/m5stack-tft/repo/components")
endif()


project(chip-energy-management-app)

# WARNING: This is just an example for using key for decrypting the encrypted OTA image
# Please do not use it as is.
if(CONFIG_ENABLE_ENCRYPTED_OTA)
target_add_binary_data(chip-energy-management-app.elf "esp_image_encryption_key.pem" TEXT)
endif()

# C++17 is required for RPC build.
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
# For the C3, project_include.cmake sets -Wno-format, but does not clear various
# flags that depend on -Wformat
idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security" APPEND)

# -Wmaybe-uninitialized has too many false positives, including on std::optional
# and chip::Optional. Make it nonfatal.
#
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=maybe-uninitialized" APPEND)

#For the H2, -Werror=uninitialized will cause an error in "src/lib/support/LambdaBridge.h"
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=uninitialized" APPEND)

flashing_script()

if (CONFIG_ENABLE_PW_RPC)
get_filename_component(CHIP_ROOT ./third_party/connectedhomeip REALPATH)
include(third_party/connectedhomeip/third_party/pigweed/repo/pw_build/pigweed.cmake)
include($ENV{PW_ROOT}/pw_assert/backend.cmake)
include($ENV{PW_ROOT}/pw_log/backend.cmake)
include($ENV{PW_ROOT}/pw_sys_io/backend.cmake)
include($ENV{PW_ROOT}/pw_trace/backend.cmake)

pw_set_module_config(pw_rpc_CONFIG pw_rpc.disable_global_mutex_config)

pw_set_backend(pw_log pw_log_basic)
pw_set_backend(pw_assert.check pw_assert_log.check_backend)
pw_set_backend(pw_assert.assert pw_assert.assert_compatibility_backend)
pw_set_backend(pw_sys_io pw_sys_io.esp32)
pw_set_backend(pw_trace pw_trace_tokenized)

add_subdirectory(third_party/connectedhomeip/third_party/pigweed/repo)
add_subdirectory(third_party/connectedhomeip/third_party/nanopb/repo)
add_subdirectory(third_party/connectedhomeip/examples/platform/esp32/pw_sys_io)

get_target_property(_target_cxx_flags pw_build.cpp17._public_config INTERFACE_COMPILE_OPTIONS)
list(REMOVE_ITEM _target_cxx_flags $<$<COMPILE_LANGUAGE:CXX>:-std=c++17>)
list(APPEND _target_cxx_flags $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17>)
set_target_properties(pw_build.cpp17._public_config PROPERTIES INTERFACE_COMPILE_OPTIONS "${_target_cxx_flags}")
endif(CONFIG_ENABLE_PW_RPC)
49 changes: 49 additions & 0 deletions examples/water-heater-management-app/esp32/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Matter ESP32 Energy Management Example

This example demonstrates the Matter Electric Vehicle Supply Equipment
application on ESP platforms.

Please
[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md)
and refer
[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md)
guides to get started.

### Enabling ESP-Insights:

- Before building the app, enable the option: ESP_INSIGHTS_ENABLED through
menuconfig.

- Create a file named insights_auth_key.txt in the main directory of the
example.

- Follow the steps
present[here](https://github.com/espressif/esp-insights/blob/main/examples/README.md#set-up-esp-insights-account)
to set up an insights_account and the auth key created while setting it up
will be used in the example.

- Download the auth key and copy Auth Key to the example

```
cp /path/to/auth/key.txt path/to/connectedhomeip/examples/energy-management-app/esp32/main/insights_auth_key.txt
```

---

- [Cluster Control](#cluster-control)
- [Matter OTA guide](../../../docs/guides/esp32/ota.md)

---

### Cluster Control

- After successful commissioning, use the Energy Electric Vehicle Supply
Equipment cluster command to disable/enable charging and discharging.

```
$./out/debug/chip-tool energyevse disable <NODE ID> 1
```

```
$ ./out/debug/chip-tool energyevse enable-charging 0xFFFFFFFF 6000 32000 <NODE ID> 1 --timedInteractionTimeoutMs <Time>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
*
* Copyright (c) 2020 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file
* Example project configuration file for CHIP.
*
* This is a place to put application or project-specific overrides
* to the default configuration values for general CHIP features.
*
*/

#pragma once

// include the CHIPProjectConfig from config/standalone
#include <CHIPProjectConfig.h>

#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 0

#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT 1

#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1

#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1

#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 0x050C // Energy EVSE

#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME 1

#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1

#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Water Heater Management"

#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 1
#endif

#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0"
#endif
Loading
Loading