Hi,
I am modifying Zigbee HA Demo EK004 (JN-AN-1221) to have the 'LED' as well as 'light sensor' on the same node. So will these two different shared device structures (tsHA_DimmableLightDevice and tsHA_LightSensorDevice) require to be on two separate endpoints on the same node or can they be on the same endpoint?
If they are on the same endpoint then how will the BASIC (and IDENTIFY) cluster be shared among them? I mean, which shared structure's properties will the BASIC cluster show?
Thanks in advance.
Hi Navdeep,
If you want to add a new cluster to a device, you do not need to add an extra endpoint. In ZigBee, all clusters can be added as optional supported clusters. This means it will be the same device but with support for additional clusters. Doing this saves RAM because there are less endpoints. Also, by having two endpoints, it requires to certify both endpoints separately.
To do this, you will need to go into the SDK (for example a DimmableLight) and modify the following file:
C:\NXP\bstudio_nxp\sdk\JN-SW-4168\Components\ZCL\Profiles\HA\Lighting\Source\dimmable_light.c
C:\NXP\bstudio_nxp\sdk\JN-SW-4168\Components\ZCL\Profiles\HA\Lighting\Include\dimmable_light.h
You can use the other clusters as reference to add additional clusters. The cluster that needs to be added should be add to the following:
tsHA_DimmableLightDeviceClusterInstances
tsHA_DimmableLightDevice
eHA_RegisterDimmableLightEndPoint
If you want to add illuminance sensing to the device, look at the following file:
C:\NXP\bstudio_nxp\sdk\JN-SW-4168\Components\ZCL\Profiles\HA\Lighting\Source\light_sensor.c
C:\NXP\bstudio_nxp\sdk\JN-SW-4168\Components\ZCL\Profiles\HA\Lighting\Include\light_sensor.h
You should see the following define in light_sensor.c, register light sensor:
#if (defined CLD_ILLUMINANCE_MEASUREMENT) && (defined ILLUMINANCE_MEASUREMENT_SERVER)
/* Create an instance of an Illuminance Measurement cluster as a server */
eCLD_IlluminanceMeasurementCreateIlluminanceMeasurement(
&psDeviceInfo->sClusterInstance.sIlluminanceMeasurementServer,
TRUE,
&sCLD_IlluminanceMeasurement,
&psDeviceInfo->sIlluminanceMeasurementServerCluster,
&au8IlluminanceMeasurementServerAttributeControlBits[0]);
#endif
And the following define in light_sensor.h, structure tsHA_LightSensorDeviceClusterInstances
#if (defined CLD_ILLUMINANCE_MEASUREMENT) && (defined ILLUMINANCE_MEASUREMENT_SERVER)
tsZCL_ClusterInstance sIlluminanceMeasurementServer;
#endif
And finally the following define in light_sensor.h, structure tsHA_LightSensorDevice
#if (defined CLD_ILLUMINANCE_MEASUREMENT) && (defined ILLUMINANCE_MEASUREMENT_SERVER)
/* Illuminance Measurement Cluster - Server */
tsCLD_IlluminanceMeasurement sIlluminanceMeasurementServerCluster;
#endif
Hope it helps
Best Regards,
Mario
Hi Mario,
Thanks for the detailed reply. This is exactly the kind of information I was looking for. This will enable me to use less number of endpoints on a node.
Thanks,
Navdeep.