Skip to content

Commit 1468092

Browse files
fessehaevepull[bot]
authored andcommitted
Update valve configuration and control cluster XML according to latest spec (#30955)
* update valve configuration and control cluster according to latest spec * DefaultOpenDuration is writable and updated device type name to Water Valve * moved domain to be the first element
1 parent bb8d0ce commit 1468092

Some content is hidden

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

44 files changed

+1033
-1571
lines changed

src/app/zap-templates/zcl/data-model/chip/matter-devices.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2115,9 +2115,9 @@ limitations under the License.
21152115
</clusters>
21162116
</deviceType>
21172117
<deviceType>
2118-
<name>MA-valve</name>
2118+
<name>MA-water-valve</name>
21192119
<domain>CHIP</domain>
2120-
<typeName>Matter Valve</typeName>
2120+
<typeName>Matter Water Valve</typeName>
21212121
<profileId editable="false">0x0103</profileId>
21222122
<deviceId editable="false">0x0042</deviceId>
21232123
<class>Simple</class>

src/app/zap-templates/zcl/data-model/chip/valve-configuration-and-control-cluster.xml

+33-38
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,35 @@ limitations under the License.
1919

2020
<bitmap name="Feature" type="bitmap32">
2121
<cluster code="0x0081"/>
22-
<field name="TimeSync" mask="0x1"/>
23-
<field name="Level" mask="0x2"/>
22+
<field name="TimeSync" mask="0x01"/>
23+
<field name="Level" mask="0x02"/>
2424
</bitmap>
2525

2626
<bitmap name="ValveFaultBitmap" type="bitmap16">
2727
<cluster code="0x0081"/>
28-
<field name="GeneralFault" mask="0x1"/>
29-
<field name="Blocked" mask="0x2"/>
30-
<field name="Leaking" mask="0x4"/>
28+
<field name="GeneralFault" mask="0x01"/>
29+
<field name="Blocked" mask="0x02"/>
30+
<field name="Leaking" mask="0x04"/>
31+
<field name="NotConnected" mask="0x08"/>
32+
<field name="ShortCircuit" mask="0x10"/>
33+
<field name="CurrentExceeded" mask="0x20"/>
3134
</bitmap>
3235

3336
<enum name="ValveStateEnum" type="enum8">
3437
<cluster code="0x0081"/>
35-
<item name="Open" value="0x0"/>
36-
<item name="Closed" value="0x1"/>
38+
<item name="Closed" value="0x0"/>
39+
<item name="Open" value="0x1"/>
40+
<item name="Transitioning" value="0x2"/>
41+
</enum>
42+
43+
<enum name="StatusCodeEnum" type="enum8">
44+
<cluster code="0x0081"/>
45+
<item name="FailureDueToFault" value="0x02"/>
3746
</enum>
3847

3948
<cluster apiMaturity="provisional">
40-
<name>Valve Configuration and Control</name>
4149
<domain>HVAC</domain>
50+
<name>Valve Configuration and Control</name>
4251
<code>0x0081</code>
4352
<define>VALVE_CONFIGURATION_AND_CONTROL_CLUSTER</define>
4453
<client tick="false" init="false">true</client>
@@ -48,51 +57,37 @@ limitations under the License.
4857

4958
<!-- min max definition for attribute size larger than 2 bytes is not allowed by zap codegen https://github.com/project-chip/zap/issues/1187 -->
5059
<!-- Therefore, this check needs to be done in code. -->
51-
<attribute side="server" code="0x0000" define="OPEN_DURATION" type="elapsed_s" isNullable="true" writable="true" optional="false">
52-
<description>OpenDuration</description>
53-
<access op="read" privilege="view"/>
54-
<access op="write" privilege="manage"/>
55-
</attribute>
56-
<attribute side="server" code="0x0001" define="AUTO_CLOSE_TIME" type="epoch_us" isNullable="true" writable="false" optional="true">AutoCloseTime</attribute>
57-
<attribute side="server" code="0x0002" define="REMAINING_DURATION" type="elapsed_s" isNullable="true" writable="false" optional="true">RemainingDuration</attribute>
58-
<attribute side="server" code="0x0003" define="CURRENT_STATE" type="ValveStateEnum" isNullable="true" writable="false" optional="false">CurrentState</attribute>
59-
<attribute side="server" code="0x0004" define="TARGET_STATE" type="ValveStateEnum" isNullable="true" writable="false" optional="false">TargetState</attribute>
60-
<attribute side="server" code="0x0005" define="START_UP_STATE" type="ValveStateEnum" isNullable="false" writable="true" optional="true">
61-
<description>StartUpState</description>
62-
<access op="read" privilege="view"/>
63-
<access op="write" privilege="manage"/>
64-
</attribute>
60+
<attribute side="server" code="0x0000" define="OPEN_DURATION" type="elapsed_s" isNullable="true" writable="false" optional="false">OpenDuration</attribute>
61+
<!-- min max definition for attribute size larger than 2 bytes is not allowed by zap codegen https://github.com/project-chip/zap/issues/1187 -->
62+
<!-- Therefore, this check needs to be done in code. -->
63+
<attribute side="server" code="0x0001" define="DEFAULT_OPEN_DURATION" type="elapsed_s" isNullable="true" writable="true" optional="false">DefaultOpenDuration</attribute>
64+
<attribute side="server" code="0x0002" define="AUTO_CLOSE_TIME" type="epoch_us" isNullable="true" writable="false" optional="true">AutoCloseTime</attribute>
65+
<attribute side="server" code="0x0003" define="REMAINING_DURATION" type="elapsed_s" isNullable="true" writable="false" optional="false">RemainingDuration</attribute>
66+
<attribute side="server" code="0x0004" define="CURRENT_STATE" type="ValveStateEnum" isNullable="true" writable="false" optional="false">CurrentState</attribute>
67+
<attribute side="server" code="0x0005" define="TARGET_STATE" type="ValveStateEnum" isNullable="true" writable="false" optional="false">TargetState</attribute>
6568
<attribute side="server" code="0x0006" define="CURRENT_LEVEL" type="percent" isNullable="true" min="0" max="100" writable="false" optional="true">CurrentLevel</attribute>
6669
<attribute side="server" code="0x0007" define="TARGET_LEVEL" type="percent" isNullable="true" min="0" max="100" writable="false" optional="true">TargetLevel</attribute>
67-
<attribute side="server" code="0x0008" define="OPEN_LEVEL" type="percent" isNullable="true" min="1" max="100" writable="true" default="100" optional="true">
68-
<description>OpenLevel</description>
69-
<access op="read" privilege="view"/>
70-
<access op="write" privilege="manage"/>
71-
</attribute>
70+
<attribute side="server" code="0x0008" define="DEFAULT_OPEN_LEVEL" type="percent" isNullable="false" min="1" max="100" writable="true" default="100" optional="true">DefaultOpenLevel</attribute>
7271
<attribute side="server" code="0x0009" define="VALVE_FAULT" type="ValveFaultBitmap" isNullable="false" writable="false" optional="true">ValveFault</attribute>
7372

7473
<command source="client" code="0x00" name="Open" optional="false">
75-
<description>This command is used to set the valve to its fully open position.</description>
76-
<arg name="OpenDuration" type="elapsed_s" optional="true"/>
74+
<description>This command is used to set the valve to its open position.</description>
75+
<arg name="OpenDuration" type="elapsed_s" optional="true" isNullable="true"/>
76+
<arg name="TargetLevel" type="percent" optional="true"/>
7777
</command>
7878

7979
<command source="client" code="0x01" name="Close" optional="false">
80-
<description>This command is used to set the valve to its fully closed position.</description>
81-
</command>
82-
83-
<command source="client" code="0x02" name="SetLevel" optional="true">
84-
<description>This command is used to set the valve to a specific level.</description>
85-
<arg name="Level" type="percent"/>
86-
<arg name="OpenDuration" type="elapsed_s" optional="true"/>
80+
<description>This command is used to set the valve to its closed position.</description>
8781
</command>
8882

8983
<event side="server" code="0x00" priority="info" name="ValveStateChanged" optional="true">
90-
<description>This event SHALL be generated when the valve changes state, either opens or closes.</description>
84+
<description>This event SHALL be generated when the valve state changed.</description>
9185
<field id="0" name="ValveState" type="ValveStateEnum"/>
86+
<field id="1" name="ValveLevel" type="percent" optional="true"/>
9287
</event>
9388

9489
<event side="server" code="0x01" priority="info" name="ValveFault" optional="true">
95-
<description>This event SHALL be generated when the valve registers a fault.</description>
90+
<description>This event SHALL be generated when the valve registers or clears a fault.</description>
9691
<field id="0" name="ValveFault" type="ValveFaultBitmap"/>
9792
</event>
9893
</cluster>

src/controller/data_model/controller-clusters.matter

+22-19
Original file line numberDiff line numberDiff line change
@@ -4058,9 +4058,14 @@ provisional cluster BooleanStateConfiguration = 128 {
40584058
provisional cluster ValveConfigurationAndControl = 129 {
40594059
revision 1;
40604060

4061+
enum StatusCodeEnum : enum8 {
4062+
kFailureDueToFault = 2;
4063+
}
4064+
40614065
enum ValveStateEnum : enum8 {
4062-
kOpen = 0;
4063-
kClosed = 1;
4066+
kClosed = 0;
4067+
kOpen = 1;
4068+
kTransitioning = 2;
40644069
}
40654070

40664071
bitmap Feature : bitmap32 {
@@ -4072,25 +4077,29 @@ provisional cluster ValveConfigurationAndControl = 129 {
40724077
kGeneralFault = 0x1;
40734078
kBlocked = 0x2;
40744079
kLeaking = 0x4;
4080+
kNotConnected = 0x8;
4081+
kShortCircuit = 0x10;
4082+
kCurrentExceeded = 0x20;
40754083
}
40764084

40774085
info event ValveStateChanged = 0 {
40784086
ValveStateEnum valveState = 0;
4087+
optional percent valveLevel = 1;
40794088
}
40804089

40814090
info event ValveFault = 1 {
40824091
ValveFaultBitmap valveFault = 0;
40834092
}
40844093

4085-
attribute access(write: manage) nullable elapsed_s openDuration = 0;
4086-
readonly attribute optional nullable epoch_us autoCloseTime = 1;
4087-
readonly attribute optional nullable elapsed_s remainingDuration = 2;
4088-
readonly attribute nullable ValveStateEnum currentState = 3;
4089-
readonly attribute nullable ValveStateEnum targetState = 4;
4090-
attribute access(write: manage) optional ValveStateEnum startUpState = 5;
4094+
readonly attribute nullable elapsed_s openDuration = 0;
4095+
attribute nullable elapsed_s defaultOpenDuration = 1;
4096+
readonly attribute optional nullable epoch_us autoCloseTime = 2;
4097+
readonly attribute nullable elapsed_s remainingDuration = 3;
4098+
readonly attribute nullable ValveStateEnum currentState = 4;
4099+
readonly attribute nullable ValveStateEnum targetState = 5;
40914100
readonly attribute optional nullable percent currentLevel = 6;
40924101
readonly attribute optional nullable percent targetLevel = 7;
4093-
attribute access(write: manage) optional nullable percent openLevel = 8;
4102+
attribute optional percent defaultOpenLevel = 8;
40944103
readonly attribute optional ValveFaultBitmap valveFault = 9;
40954104
readonly attribute command_id generatedCommandList[] = 65528;
40964105
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -4100,20 +4109,14 @@ provisional cluster ValveConfigurationAndControl = 129 {
41004109
readonly attribute int16u clusterRevision = 65533;
41014110

41024111
request struct OpenRequest {
4103-
optional elapsed_s openDuration = 0;
4104-
}
4105-
4106-
request struct SetLevelRequest {
4107-
percent level = 0;
4108-
optional elapsed_s openDuration = 1;
4112+
optional nullable elapsed_s openDuration = 0;
4113+
optional percent targetLevel = 1;
41094114
}
41104115

4111-
/** This command is used to set the valve to its fully open position. */
4116+
/** This command is used to set the valve to its open position. */
41124117
command Open(OpenRequest): DefaultSuccess = 0;
4113-
/** This command is used to set the valve to its fully closed position. */
4118+
/** This command is used to set the valve to its closed position. */
41144119
command Close(): DefaultSuccess = 1;
4115-
/** This command is used to set the valve to a specific level. */
4116-
command SetLevel(SetLevelRequest): DefaultSuccess = 2;
41174120
}
41184121

41194122
/** This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */

0 commit comments

Comments
 (0)