Hi
I'm currently struggling a bit with the zboss API. I am trying to define 2 lights on my nRF52840 DK board. Via Amazon Alexa, it should be possible to control these two lights individually.
I started from the light_bulb_eddystone example in Zigbee SDK 3.0.0. From what I understand, I need to make 2 endpoints on my zigbee node, one for each light.
But Alexa always sees one device. How can I individually switch on/off the lights ? In the zcl_device_cb function, decisions are made based on attribute types and cluster id. But my device has 2 endpoints, both with the same cluster-id (ZB_ZCL_CLUSTER_ID_ON_OFF) and attribute-db-id (ZB_ZCL_SET_ATTR_VALUE_CB_ID).
switch (p_device_cb_param->device_cb_id)
{
case ZB_ZCL_LEVEL_CONTROL_SET_VALUE_CB_ID:
...
case ZB_ZCL_SET_ATTR_VALUE_CB_ID:
cluster_id = p_device_cb_param->cb_param.set_attr_value_param.cluster_id;
attr_id = p_device_cb_param->cb_param.set_attr_value_param.attr_id;
if (cluster_id == ZB_ZCL_CLUSTER_ID_ON_OFF)
{
uint8_t value = p_device_cb_param->cb_param.set_attr_value_param.values.data8;
LOG_TRM("on/off attribute setting to %hd", PU16(value));
if (attr_id == ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID)
{
on_off_set_value((zb_bool_t) value);
}
}
I suppose Alexa won't recognize two devices, but I have to make a custom skill to be able to send commands such as 'switch on light1' and 'switch on light2' ?
But how can I decide in my zcl_device_cb function which endpoint is actually addressed by Alexa ?
Anyone who can shed a light on this please ? I can't find any example in the SDK which shows how to work with multiple endpoints.
Kind regards