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 illuminance measurement cluster #10776

254 changes: 254 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -5535,6 +5535,133 @@
}
]
},
{
"name": "Illuminance Measurement",
"code": 1024,
"mfgCode": null,
"define": "ILLUMINANCE_MEASUREMENT_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [],
"attributes": [
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "client",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Illuminance Measurement",
"code": 1024,
"mfgCode": null,
"define": "ILLUMINANCE_MEASUREMENT_CLUSTER",
"side": "server",
"enabled": 0,
"commands": [],
"attributes": [
{
"name": "MeasuredValue",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0000",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "MinMeasuredValue",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "MaxMeasuredValue",
"code": 2,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "Tolerance",
"code": 3,
"mfgCode": null,
"side": "server",
"included": 0,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "LightSensorType",
"code": 4,
"mfgCode": null,
"side": "server",
"included": 0,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0xFF",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Temperature Measurement",
"code": 1026,
Expand Down Expand Up @@ -12540,6 +12667,133 @@
}
]
},
{
"name": "Illuminance Measurement",
"code": 1024,
"mfgCode": null,
"define": "ILLUMINANCE_MEASUREMENT_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [],
"attributes": [
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "client",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Illuminance Measurement",
"code": 1024,
"mfgCode": null,
"define": "ILLUMINANCE_MEASUREMENT_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [],
"attributes": [
{
"name": "MeasuredValue",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0000",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "MinMeasuredValue",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "MaxMeasuredValue",
"code": 2,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "Tolerance",
"code": 3,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "LightSensorType",
"code": 4,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0xFF",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Temperature Measurement",
"code": 1026,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2021 Project CHIP Authors

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.
-->
<configurator>
<domain name="CHIP"/>

<cluster>
<name>Illuminance Measurement</name>
<domain>Measurement &amp; Sensing</domain>
<description>Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements.</description>
<code>0x0400</code>
<define>ILLUMINANCE_MEASUREMENT_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<globalAttribute side="either" code="0xFFFD" value="2"/>
<attribute side="server" code="0x0000" define="ILLUM_MEASURED_VALUE" type="INT16U" min="0x0000" max="0xFFFF" writable="false" reportable="true" isNullable="true" default="0x0000" optional="false">MeasuredValue</attribute>
<attribute side="server" code="0x0001" define="ILLUM_MIN_MEASURED_VALUE" type="INT16U" min="0x0001" max="0xFFFD" writable="false" isNullable="true" optional="false">MinMeasuredValue</attribute>
<attribute side="server" code="0x0002" define="ILLUM_MAX_MEASURED_VALUE" type="INT16U" min="0x0001" max="0xFFFE" writable="false" isNullable="true" optional="false">MaxMeasuredValue</attribute>
<attribute side="server" code="0x0003" define="ILLUM_TOLERANCE" type="INT16U" min="0x0000" max="0x0800" writable="false" optional="true" >Tolerance</attribute>
<attribute side="server" code="0x0004" define="ILLUM_LIGHT_SENSOR_TYPE" type="ENUM8" min="0x00" max="0xFF" writable="false" isNullable="true" default="0xFF" optional="true" >LightSensorType</attribute>
</cluster>

<enum name="LightSensorType" type="ENUM8">
<cluster code="0x0400"/>
<item name="Photodiode" value="0x00"/>
<item name="CMOS" value="0x01"/>
<!-- RESERVED = 0x40 - 0xFE -->
</enum>
</configurator>LST
33 changes: 0 additions & 33 deletions src/app/zap-templates/zcl/data-model/silabs/ha.xml
Original file line number Diff line number Diff line change
Expand Up @@ -418,39 +418,6 @@ limitations under the License.
<attribute side="server" code="0x0034" define="LAMP_ALARM_MODE" type="BITMAP8" min="0x00" max="0x01" writable="true" default="0x00" optional="true">lamp alarm mode</attribute>
<attribute side="server" code="0x0035" define="LAMP_BURN_HOURS_TRIP_POINT" type="INT24U" min="0x000000" max="0xFFFFFE" writable="true" default="0xFFFFFF" optional="true">lamp burn hours trip point</attribute>
</cluster>
<cluster>
<name>Illuminance Measurement</name>
<domain>Measurement &amp; Sensing</domain>
<description>Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements.</description>
<code>0x0400</code>
<define>ILLUM_MEASUREMENT_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" tickFrequency="half" init="false">true</server>
<globalAttribute side="either" code="0xFFFD" value="2"/>
<attribute side="server" code="0x0000" define="ILLUM_MEASURED_VALUE" type="INT16U" min="0x0000" max="0xFFFF" writable="false" reportable="true" default="0x0000" optional="false">measured value</attribute>
<!-- MEASURED_VALUE -->
<attribute side="server" code="0x0001" define="ILLUM_MIN_MEASURED_VALUE" type="INT16U" min="0x0001" max="0xFFFD" writable="false" optional="false">min measured value</attribute>
<!-- MIN_MEASURED_VALUE -->
<attribute side="server" code="0x0002" define="ILLUM_MAX_MEASURED_VALUE" type="INT16U" min="0x0001" max="0xFFFE" writable="false" optional="false">max measured value</attribute>
<!-- MAX_MEASURED_VALUE -->
<attribute side="server" code="0x0003" define="ILLUM_TOLERANCE" type="INT16U" min="0x0000" max="0x0800" writable="false" optional="true">tolerance</attribute>
<!-- TOLERANCE -->
<attribute side="server" code="0x0004" define="MEASUREMENT_LIGHT_SENSOR_TYPE" type="ENUM8" min="0x00" max="0xFF" writable="false" default="0xFF" optional="true">light sensor type</attribute>
<!-- LIGHT_SENSOR_TYPE -->
</cluster>
<cluster>
<name>Illuminance Level Sensing</name>
<domain>Measurement &amp; Sensing</domain>
<description>Attributes and commands for configuring the sensing of illuminance levels, and reporting whether illuminance is above, below, or on target.</description>
<code>0x0401</code>
<define>ILLUM_LEVEL_SENSING_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<attribute side="server" code="0x0000" define="LEVEL_STATUS" type="ENUM8" min="0x00" max="0xFE" writable="false" reportable="true" optional="false">level status</attribute>
<attribute side="server" code="0x0001" define="SENSING_LIGHT_SENSOR_TYPE" type="ENUM8" min="0x00" max="0xFE" writable="false" optional="true">light sensor type</attribute>
<!-- LIGHT_SENSOR_TYPE -->
<attribute side="server" code="0x0010" define="ILLUMINANCE_TARGET_LEVEL" type="INT16U" min="0x0000" max="0xFFFE" writable="true" optional="false">illuminance level target</attribute>
</cluster>
<cluster>
<name>Occupancy Sensing</name>
<domain>Measurement &amp; Sensing</domain>
Expand Down
8 changes: 0 additions & 8 deletions src/app/zap-templates/zcl/data-model/silabs/types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,11 @@ limitations under the License.
<enum name="ColorControlOptions" type="BITMAP8">
<item name="ExecuteIfOff" value="0x1"/>
</enum>
<enum name="MeasurementLightSensorType" type="ENUM8">
<item name="photodiode" value="0x0"/>
<item name="CMOS" value="0x1"/>
</enum>
<enum name="LevelStatus" type="ENUM8">
<item name="OnTarget" value="0x0"/>
<item name="BelowTarget" value="0x1"/>
<item name="AboveTarget" value="0x2"/>
</enum>
<enum name="SensingLightSensorType" type="ENUM8">
<item name="photodiode" value="0x0"/>
<item name="CMOS" value="0x1"/>
</enum>
<enum name="OccupancySensorType" type="ENUM8">
<item name="PIR" value="0x0"/>
<item name="Ultrasonic" value="0x1"/>
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"global-attributes.xml",
"group-key-mgmt-cluster.xml",
"identify-cluster.xml",
"illuminance-measurement-cluster.xml",
"keypad-input-cluster.xml",
"low-power-cluster.xml",
"media-input-cluster.xml",
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap_cluster_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'GROUP_KEY_MANAGEMENT_CLUSTER': [],
'IAS_ZONE_CLUSTER': ['ias-zone-server'],
'IDENTIFY_CLUSTER': ['identify-server'],
'ILLUMINANCE_MEASUREMENT_CLUSTER': [],
'KEYPAD_INPUT_CLUSTER': ['keypad-input-server'],
'LEVEL_CONTROL_CLUSTER': ['level-control'],
'LOW_POWER_CLUSTER': ['low-power-server'],
Expand Down Expand Up @@ -104,6 +105,7 @@
'GROUP_KEY_MANAGEMENT_CLUSTER': [],
'IAS_ZONE_CLUSTER': ['ias-zone-client'],
'IDENTIFY_CLUSTER': [],
'ILLUMINANCE_MEASUREMENT_CLUSTER': [],
'KEYPAD_INPUT_CLUSTER': [],
'LEVEL_CONTROL_CLUSTER': [],
'LOW_POWER_CLUSTER': [],
Expand Down
Loading