This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I want to create 2 endpoints on the same zigbee device.

I want to create two switch EP(if it is possible I would like to it as much switches as possible).

I am using WIndows 10 with Segger and nRF COnnect SDK v1.5.0.

I tried it in the following way(I tried other many ways but seems that defining the same macro is conflicting):

zb_zcl_basic_attrs_ext_t         basic_attr;

ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST_EXT(
	basic_attr_list,
	&basic_attr.zcl_version,
	&basic_attr.app_version,
	&basic_attr.stack_version,
	&basic_attr.hw_version,
	basic_attr.mf_name,
	basic_attr.model_id,
	basic_attr.date_code,
	&basic_attr.power_source,
	basic_attr.location_id,
	&basic_attr.ph_env,
	basic_attr.sw_ver);

/* Declare attribute list for Identify cluster. */
ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST(identify_attr_list, &attr_identify_time);

/* Declare cluster list for Dimmer Switch device (Identify, Basic, Scenes,
 * Groups, On Off, Level Control).
 * Only clusters Identify and Basic have attributes.
 */
ZB_HA_DECLARE_DIMMER_SWITCH_CLUSTER_LIST(dimmer_switch_clusters,
					 basic_attr_list,
					 identify_attr_list);

/* Declare endpoint for Dimmer Switch device. */
ZB_HA_DECLARE_DIMMER_SWITCH_EP(dimmer_switch_ep,
			       LIGHT_SWITCH_ENDPOINT,
			       dimmer_switch_clusters);

ZB_HA_DECLARE_DIMMER_SWITCH_EP(dimmer_switch_ep_snd,
			       LIGHT_SWITCH_ENDPOINT_SND,
			       dimmer_switch_clusters);

/* Declare application's device context (list of registered endpoints)
 * for Dimmer Switch device.
 */
#ifndef CONFIG_ZIGBEE_FOTA
//ZBOSS_DECLARE_DEVICE_CTX_1_EP(dimmer_switch_ctx, dimmer_switch_ep);
ZBOSS_DECLARE_DEVICE_CTX_2_EP(dimmer_switch_ctx, dimmer_switch_ep, dimmer_switch_ep_snd);
#else

I get the following error:

Do I have to create different atributes/clusters to each end point?

What way would be the best to do it?

Also I would like the best approach to send and receive data(integers, arrays, etc) over zigbee. Specially receive.

  • Hello

    Okay I get it!

    I don't see any attached file(If you mean to your answer).

    My intention is to add multiple buttons to zigbee2mqtt from the same board, I don't if I can make it in some hacky way with groups I will try for sure to avoid problems.

    I also would like to add a sensor device(more than one if it is possible) to this to send different kind of values. Would it be possible? Any advise?

    Then I would like to make this device able to receive data from the gateway. What kind of device would be recommended? I saw some of them that could be useful in the specs but I am not sure.

    Thanks a lot for your answers

    Best regards,

    Manue

  • Hi Manue,

    Edvin will be out of office for some time, so I will help with this case.

    I assume the file he meant to add is this one:

    zigbee_dimmable_light_switch.h

    ManuCorrea said:
    I also would like to add a sensor device

    Knowing a bit more about what your goal is with the sensors will help with what advise I can give. Are you thinking of adding sensors as different Zigbee devices (or boards), or are you planning to implement all of this on the same device, the one you have implemented two switch endpoint on? How to implement this will also depend on the type of sensor device. For example, there is a cluster specifically for temperature measurements, so if that is what you want you can use that cluster library. I would recommend looking at what cluster libraries are available to see if you can use any of them in your application. The cluster libraries that are implemented in NCS v1.5.0 and their API can be found here. You can also check out the Zigbee Cluster Library specification.

    ManuCorrea said:
    Then I would like to make this device able to receive data from the gateway.

    I do not have much experience with zigbee2mqtt, but from what I can tell the gateway functions as the Zigbee coordinator. As they are both Zigbee devices you should be able to receive messages from the gateway to your device, but I do not know the gateway is implemented or what clusters it uses. What kind of data do you want to receive from the gateway, and do you know whether the gateway already has the functionality or cluster for this, or is it possible to implement it on the gateway?

    ManuCorrea said:
    What kind of device would be recommended?

     I am not sure if I understood what you meant by this. Do you mean what kind of cluster would be recommended, or something else?

    Best regards,

    Marte

Related