Skip to content

Commit 633cd53

Browse files
PeterC1965jamesharrow
authored andcommitted
Add water heater mode cluster xml (project-chip#34333)
* Add water-heater-mode-cluster.xml * Add water-heater-mode-cluster support into control files and regenerate files * Fix zap template generation issues * Remove Water Heater Management entries * Regenerate files * Comment Water Heater Mode with right name --------- Co-authored-by: jamesharrow <93921463+jamesharrow@users.noreply.github.com>
1 parent 79e87d1 commit 633cd53

File tree

55 files changed

+6582
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6582
-3
lines changed

docs/zap_clusters.md

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Generally regenerate using one of:
8787
| 155 | 0x9B | EnergyPreference |
8888
| 156 | 0x9C | PowerTopology |
8989
| 157 | 0x9D | EnergyEvseMode |
90+
| 158 | 0x9E | WaterHeaterMode |
9091
| 159 | 0x9F | DeviceEnergyManagementMode |
9192
| 257 | 0x101 | DoorLock |
9293
| 258 | 0x102 | WindowCovering |

scripts/rules.matterlint

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml";
102102
load "../src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml";
103103
load "../src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml";
104104
load "../src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml";
105+
load "../src/app/zap-templates/zcl/data-model/chip/water-heater-mode-cluster.xml";
105106
load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml";
106107
load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml";
107108
load "../src/app/zap-templates/zcl/data-model/chip/window-covering.xml";

src/app/zap-templates/zcl/data-model/all.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
<xi:include href="chip/valve-configuration-and-control-cluster.xml" />
110110
<xi:include href="chip/wake-on-lan-cluster.xml" />
111111
<xi:include href="chip/washer-controls-cluster.xml" />
112-
<xi:include href="chip/water-heater-management-cluster.xml" />
112+
<xi:include href="chip/water-heater-management-cluster.xml" />
113+
<xi:include href="chip/water-heater-mode-cluster.xml" />
113114
<xi:include href="chip/wifi-network-diagnostics-cluster.xml" />
114115
<xi:include href="chip/wifi-network-management-cluster.xml" />
115116
<xi:include href="chip/window-covering.xml" />

src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ This is because zap does not currently support generating code for clusters that
3232
<cluster code="0x005E"/> <!-- Microwave Oven Mode -->
3333
<cluster code="0x0049"/> <!-- Oven Mode -->
3434
<cluster code="0x009D"/> <!-- Energy EVSE Mode -->
35+
<cluster code="0x009E"/> <!-- Water Heater Mode -->
3536
<cluster code="0x009F"/> <!-- Device Energy Management Mode -->
3637
<!-- MfgCode has been deprecated -->
3738
<item name="MfgCode" type="vendor_id" optional="true"/>
@@ -47,6 +48,7 @@ This is because zap does not currently support generating code for clusters that
4748
<cluster code="0x005E"/> <!-- Microwave Oven Mode -->
4849
<cluster code="0x0049"/> <!-- Oven Mode -->
4950
<cluster code="0x009D"/> <!-- Energy EVSE Mode -->
51+
<cluster code="0x009E"/> <!-- Water Heater Mode -->
5052
<cluster code="0x009F"/> <!-- Device Energy Management Mode -->
5153
<item name="Label" type="char_string" length="64" optional="false"/>
5254
<item name="Mode" type="int8u" optional="false"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Copyright (c) 2024 Project CHIP Authors
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<configurator>
18+
<domain name="CHIP"/>
19+
20+
<enum name="ModeTag" type="enum16">
21+
<cluster code="0x009E"/>
22+
<item value="0x4000" name="Off"/>
23+
<item value="0x4001" name="Manual"/>
24+
<item value="0x4002" name="Timed"/>
25+
</enum>
26+
27+
<cluster>
28+
<domain>General</domain>
29+
<name>Water Heater Mode</name>
30+
<code>0x009E</code>
31+
<define>WATER_HEATER_MODE_CLUSTER</define>
32+
<client init="false" tick="false">true</client>
33+
<server init="false" tick="false">true</server>
34+
<description>Attributes and commands for selecting a mode from a list of supported options.</description>
35+
<globalAttribute side="either" code="0xFFFD" value="1"/>
36+
37+
<features>
38+
<feature bit="0" code="DEPONOFF" name="OnOff" summary="Dependency with the OnOff cluster">
39+
<optionalConform/>
40+
</feature>
41+
</features>
42+
43+
<!-- Base data types -->
44+
<attribute side="server" code="0x0000" define="SUPPORTED_MODES" type="array" entryType="ModeOptionStruct" writable="false" optional="false" isNullable="false" length="255">SupportedModes</attribute>
45+
<attribute side="server" code="0x0001" define="CURRENT_MODE" type="int8u" writable="false" optional="false" isNullable="false" reportable="true">CurrentMode</attribute>
46+
<attribute side="server" code="0x0002" define="START_UP_MODE" type="int8u" writable="true" optional="true" isNullable="true">StartUpMode</attribute>
47+
<attribute side="server" code="0x0003" define="ON_MODE" type="int8u" writable="true" optional="true" isNullable="true">OnMode</attribute>
48+
49+
<!-- Commands -->
50+
<command source="client" code="0x00" name="ChangeToMode" response="ChangeToModeResponse" optional="false">
51+
<description>
52+
This command is used to change device modes.
53+
On receipt of this command the device SHALL respond with a ChangeToModeResponse command.
54+
</description>
55+
<arg name="NewMode" type="int8u" optional="false"/>
56+
</command>
57+
58+
<command source="server" code="0x01" name="ChangeToModeResponse" disableDefaultResponse="true" optional="false">
59+
<description>
60+
This command is sent by the device on receipt of the ChangeToModeWithStatus command.
61+
</description>
62+
<arg name="Status" type="enum8" optional="false"/>
63+
<arg name="StatusText" type="char_string" lenght="64" optional="true"/>
64+
</command>
65+
</cluster>
66+
</configurator>

src/app/zap-templates/zcl/zcl-with-test-extensions.json

+2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
"wake-on-lan-cluster.xml",
132132
"washer-controls-cluster.xml",
133133
"water-heater-management-cluster.xml",
134+
"water-heater-mode-cluster.xml",
134135
"wifi-network-diagnostics-cluster.xml",
135136
"wifi-network-management-cluster.xml",
136137
"window-covering.xml",
@@ -643,6 +644,7 @@
643644
"Power Topology": ["FeatureMap"],
644645
"Valve Configuration and Control": ["RemainingDuration"],
645646
"Boolean State Configuration": ["CurrentSensitivityLevel"],
647+
"Water Heater Mode": ["SupportedModes", "CurrentMode", "FeatureMap"],
646648
"Wi-Fi Network Management": ["SSID"]
647649
},
648650
"defaultReportingPolicy": "mandatory",

src/app/zap-templates/zcl/zcl.json

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
"wake-on-lan-cluster.xml",
130130
"washer-controls-cluster.xml",
131131
"water-heater-management-cluster.xml",
132+
"water-heater-mode-cluster.xml",
132133
"wifi-network-diagnostics-cluster.xml",
133134
"wifi-network-management-cluster.xml",
134135
"window-covering.xml",
@@ -641,6 +642,7 @@
641642
"Power Topology": ["FeatureMap"],
642643
"Valve Configuration and Control": ["RemainingDuration"],
643644
"Boolean State Configuration": ["CurrentSensitivityLevel"],
645+
"Water Heater Mode": ["SupportedModes", "CurrentMode", "FeatureMap"],
644646
"Wi-Fi Network Management": ["SSID"]
645647
},
646648
"defaultReportingPolicy": "mandatory",

src/controller/data_model/controller-clusters.matter

+50
Original file line numberDiff line numberDiff line change
@@ -5172,6 +5172,56 @@ cluster EnergyEvseMode = 157 {
51725172
command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
51735173
}
51745174

5175+
/** Attributes and commands for selecting a mode from a list of supported options. */
5176+
cluster WaterHeaterMode = 158 {
5177+
revision 1;
5178+
5179+
enum ModeTag : enum16 {
5180+
kOff = 16384;
5181+
kManual = 16385;
5182+
kTimed = 16386;
5183+
}
5184+
5185+
bitmap Feature : bitmap32 {
5186+
kOnOff = 0x1;
5187+
}
5188+
5189+
struct ModeTagStruct {
5190+
optional vendor_id mfgCode = 0;
5191+
enum16 value = 1;
5192+
}
5193+
5194+
struct ModeOptionStruct {
5195+
char_string<64> label = 0;
5196+
int8u mode = 1;
5197+
ModeTagStruct modeTags[] = 2;
5198+
}
5199+
5200+
readonly attribute ModeOptionStruct supportedModes[] = 0;
5201+
readonly attribute int8u currentMode = 1;
5202+
attribute optional nullable int8u startUpMode = 2;
5203+
attribute optional nullable int8u onMode = 3;
5204+
readonly attribute command_id generatedCommandList[] = 65528;
5205+
readonly attribute command_id acceptedCommandList[] = 65529;
5206+
readonly attribute event_id eventList[] = 65530;
5207+
readonly attribute attrib_id attributeList[] = 65531;
5208+
readonly attribute bitmap32 featureMap = 65532;
5209+
readonly attribute int16u clusterRevision = 65533;
5210+
5211+
request struct ChangeToModeRequest {
5212+
int8u newMode = 0;
5213+
}
5214+
5215+
response struct ChangeToModeResponse = 1 {
5216+
enum8 status = 0;
5217+
optional char_string statusText = 1;
5218+
}
5219+
5220+
/** This command is used to change device modes.
5221+
On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */
5222+
command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
5223+
}
5224+
51755225
/** Attributes and commands for selecting a mode from a list of supported options. */
51765226
provisional cluster DeviceEnergyManagementMode = 159 {
51775227
revision 1;

0 commit comments

Comments
 (0)