Skip to content

Commit

Permalink
Update valve configuration and control cluster XML according to lates…
Browse files Browse the repository at this point in the history
…t 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
  • Loading branch information
fessehaeve authored and pull[bot] committed Apr 12, 2024
1 parent fd6b353 commit 1327170
Show file tree
Hide file tree
Showing 44 changed files with 1,033 additions and 1,571 deletions.
4 changes: 2 additions & 2 deletions src/app/zap-templates/zcl/data-model/chip/matter-devices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2115,9 +2115,9 @@ limitations under the License.
</clusters>
</deviceType>
<deviceType>
<name>MA-valve</name>
<name>MA-water-valve</name>
<domain>CHIP</domain>
<typeName>Matter Valve</typeName>
<typeName>Matter Water Valve</typeName>
<profileId editable="false">0x0103</profileId>
<deviceId editable="false">0x0042</deviceId>
<class>Simple</class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,35 @@ limitations under the License.

<bitmap name="Feature" type="bitmap32">
<cluster code="0x0081"/>
<field name="TimeSync" mask="0x1"/>
<field name="Level" mask="0x2"/>
<field name="TimeSync" mask="0x01"/>
<field name="Level" mask="0x02"/>
</bitmap>

<bitmap name="ValveFaultBitmap" type="bitmap16">
<cluster code="0x0081"/>
<field name="GeneralFault" mask="0x1"/>
<field name="Blocked" mask="0x2"/>
<field name="Leaking" mask="0x4"/>
<field name="GeneralFault" mask="0x01"/>
<field name="Blocked" mask="0x02"/>
<field name="Leaking" mask="0x04"/>
<field name="NotConnected" mask="0x08"/>
<field name="ShortCircuit" mask="0x10"/>
<field name="CurrentExceeded" mask="0x20"/>
</bitmap>

<enum name="ValveStateEnum" type="enum8">
<cluster code="0x0081"/>
<item name="Open" value="0x0"/>
<item name="Closed" value="0x1"/>
<item name="Closed" value="0x0"/>
<item name="Open" value="0x1"/>
<item name="Transitioning" value="0x2"/>
</enum>

<enum name="StatusCodeEnum" type="enum8">
<cluster code="0x0081"/>
<item name="FailureDueToFault" value="0x02"/>
</enum>

<cluster apiMaturity="provisional">
<name>Valve Configuration and Control</name>
<domain>HVAC</domain>
<name>Valve Configuration and Control</name>
<code>0x0081</code>
<define>VALVE_CONFIGURATION_AND_CONTROL_CLUSTER</define>
<client tick="false" init="false">true</client>
Expand All @@ -48,51 +57,37 @@ limitations under the License.

<!-- min max definition for attribute size larger than 2 bytes is not allowed by zap codegen https://github.com/project-chip/zap/issues/1187 -->
<!-- Therefore, this check needs to be done in code. -->
<attribute side="server" code="0x0000" define="OPEN_DURATION" type="elapsed_s" isNullable="true" writable="true" optional="false">
<description>OpenDuration</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
<attribute side="server" code="0x0001" define="AUTO_CLOSE_TIME" type="epoch_us" isNullable="true" writable="false" optional="true">AutoCloseTime</attribute>
<attribute side="server" code="0x0002" define="REMAINING_DURATION" type="elapsed_s" isNullable="true" writable="false" optional="true">RemainingDuration</attribute>
<attribute side="server" code="0x0003" define="CURRENT_STATE" type="ValveStateEnum" isNullable="true" writable="false" optional="false">CurrentState</attribute>
<attribute side="server" code="0x0004" define="TARGET_STATE" type="ValveStateEnum" isNullable="true" writable="false" optional="false">TargetState</attribute>
<attribute side="server" code="0x0005" define="START_UP_STATE" type="ValveStateEnum" isNullable="false" writable="true" optional="true">
<description>StartUpState</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
<attribute side="server" code="0x0000" define="OPEN_DURATION" type="elapsed_s" isNullable="true" writable="false" optional="false">OpenDuration</attribute>
<!-- min max definition for attribute size larger than 2 bytes is not allowed by zap codegen https://github.com/project-chip/zap/issues/1187 -->
<!-- Therefore, this check needs to be done in code. -->
<attribute side="server" code="0x0001" define="DEFAULT_OPEN_DURATION" type="elapsed_s" isNullable="true" writable="true" optional="false">DefaultOpenDuration</attribute>
<attribute side="server" code="0x0002" define="AUTO_CLOSE_TIME" type="epoch_us" isNullable="true" writable="false" optional="true">AutoCloseTime</attribute>
<attribute side="server" code="0x0003" define="REMAINING_DURATION" type="elapsed_s" isNullable="true" writable="false" optional="false">RemainingDuration</attribute>
<attribute side="server" code="0x0004" define="CURRENT_STATE" type="ValveStateEnum" isNullable="true" writable="false" optional="false">CurrentState</attribute>
<attribute side="server" code="0x0005" define="TARGET_STATE" type="ValveStateEnum" isNullable="true" writable="false" optional="false">TargetState</attribute>
<attribute side="server" code="0x0006" define="CURRENT_LEVEL" type="percent" isNullable="true" min="0" max="100" writable="false" optional="true">CurrentLevel</attribute>
<attribute side="server" code="0x0007" define="TARGET_LEVEL" type="percent" isNullable="true" min="0" max="100" writable="false" optional="true">TargetLevel</attribute>
<attribute side="server" code="0x0008" define="OPEN_LEVEL" type="percent" isNullable="true" min="1" max="100" writable="true" default="100" optional="true">
<description>OpenLevel</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
<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>
<attribute side="server" code="0x0009" define="VALVE_FAULT" type="ValveFaultBitmap" isNullable="false" writable="false" optional="true">ValveFault</attribute>

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

<command source="client" code="0x01" name="Close" optional="false">
<description>This command is used to set the valve to its fully closed position.</description>
</command>

<command source="client" code="0x02" name="SetLevel" optional="true">
<description>This command is used to set the valve to a specific level.</description>
<arg name="Level" type="percent"/>
<arg name="OpenDuration" type="elapsed_s" optional="true"/>
<description>This command is used to set the valve to its closed position.</description>
</command>

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

<event side="server" code="0x01" priority="info" name="ValveFault" optional="true">
<description>This event SHALL be generated when the valve registers a fault.</description>
<description>This event SHALL be generated when the valve registers or clears a fault.</description>
<field id="0" name="ValveFault" type="ValveFaultBitmap"/>
</event>
</cluster>
Expand Down
41 changes: 22 additions & 19 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -4058,9 +4058,14 @@ provisional cluster BooleanStateConfiguration = 128 {
provisional cluster ValveConfigurationAndControl = 129 {
revision 1;

enum StatusCodeEnum : enum8 {
kFailureDueToFault = 2;
}

enum ValveStateEnum : enum8 {
kOpen = 0;
kClosed = 1;
kClosed = 0;
kOpen = 1;
kTransitioning = 2;
}

bitmap Feature : bitmap32 {
Expand All @@ -4072,25 +4077,29 @@ provisional cluster ValveConfigurationAndControl = 129 {
kGeneralFault = 0x1;
kBlocked = 0x2;
kLeaking = 0x4;
kNotConnected = 0x8;
kShortCircuit = 0x10;
kCurrentExceeded = 0x20;
}

info event ValveStateChanged = 0 {
ValveStateEnum valveState = 0;
optional percent valveLevel = 1;
}

info event ValveFault = 1 {
ValveFaultBitmap valveFault = 0;
}

attribute access(write: manage) nullable elapsed_s openDuration = 0;
readonly attribute optional nullable epoch_us autoCloseTime = 1;
readonly attribute optional nullable elapsed_s remainingDuration = 2;
readonly attribute nullable ValveStateEnum currentState = 3;
readonly attribute nullable ValveStateEnum targetState = 4;
attribute access(write: manage) optional ValveStateEnum startUpState = 5;
readonly attribute nullable elapsed_s openDuration = 0;
attribute nullable elapsed_s defaultOpenDuration = 1;
readonly attribute optional nullable epoch_us autoCloseTime = 2;
readonly attribute nullable elapsed_s remainingDuration = 3;
readonly attribute nullable ValveStateEnum currentState = 4;
readonly attribute nullable ValveStateEnum targetState = 5;
readonly attribute optional nullable percent currentLevel = 6;
readonly attribute optional nullable percent targetLevel = 7;
attribute access(write: manage) optional nullable percent openLevel = 8;
attribute optional percent defaultOpenLevel = 8;
readonly attribute optional ValveFaultBitmap valveFault = 9;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand All @@ -4100,20 +4109,14 @@ provisional cluster ValveConfigurationAndControl = 129 {
readonly attribute int16u clusterRevision = 65533;

request struct OpenRequest {
optional elapsed_s openDuration = 0;
}

request struct SetLevelRequest {
percent level = 0;
optional elapsed_s openDuration = 1;
optional nullable elapsed_s openDuration = 0;
optional percent targetLevel = 1;
}

/** This command is used to set the valve to its fully open position. */
/** This command is used to set the valve to its open position. */
command Open(OpenRequest): DefaultSuccess = 0;
/** This command is used to set the valve to its fully closed position. */
/** This command is used to set the valve to its closed position. */
command Close(): DefaultSuccess = 1;
/** This command is used to set the valve to a specific level. */
command SetLevel(SetLevelRequest): DefaultSuccess = 2;
}

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

0 comments on commit 1327170

Please sign in to comment.