This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to implement custom cluster in Home Automation profile



Hello All,

i am working on some zigbee project and i got some doubts. if anyone can help me to solve this then it will be very helpful for me.

my doubts are - 

1) from zstack-home developers guide i understand that we can add our own custom attribute in a project as per our need. but can we implement and add our own custom clusters in a home automation profile ? if yes then plz tell me what is the procedure or steps to do that? i dint want to implement private profile...i just want to implement and add my own custom cluster in existing HA profile that's it.....

2) can two application profile is possible in a same same device or on a same endpoint simultaneously? if yes then plz tell me what is the procedure or steps to do that?

3) if suppose i hav 2 ZED and 1 ZC out of that 2 ZED one is having HA profile and other is having SE profile then is this possible to bind and communicate between both ZED via ZC... i mean to say is this possible that ZC can route/send/receive msg from HA ZED  to SE ZED and vice versa ? if yes then plz tell me what is the procedure or steps to do that?

plz anyone help me to clear this doubt...

Thanks & Regards,

Maneesh Singh

  • 1. Yes and I have show you the steps to do it in my replies in your another post.

    2. No

    3. No.

  • maneesh singh said:
    1) from zstack-home developers guide i understand that we can add our own custom attribute in a project as per our need. but can we implement and add our own custom clusters in a home automation profile ? if yes then plz tell me what is the procedure or steps to do that? i dint want to implement private profile...i just want to implement and add my own custom cluster in existing HA profile that's it.....

    Yes you can add your own commands to zcl_general, just pick an existing req/rsp and copy this. However it would be a lot easier just to create an MSP attribute and use the foundation read/write attr to manipulate them. 

    maneesh singh said:
    2) can two application profile is possible in a same same device or on a same endpoint simultaneously? if yes then plz tell me what is the procedure or steps to do that?

    Same device yes, same enpoint no. You specify the Profile ID in the simple descriptor when you register the endpoint with afRegister(), seevoid zclHA_Init( SimpleDescriptionFormat_t *simpleDesc ), the simple desc is defined in zcl_xxx_data.c:

    SimpleDescriptionFormat_t zclSampleLight_SimpleDesc =
    {
      SAMPLELIGHT_ENDPOINT,                  //  int Endpoint;
      ZCL_HA_PROFILE_ID,                     //  uint16 AppProfId;
    #ifdef ZCL_LEVEL_CTRL
      ZCL_HA_DEVICEID_DIMMABLE_LIGHT,        //  uint16 AppDeviceId;
    #else
      ZCL_HA_DEVICEID_ON_OFF_LIGHT,          //  uint16 AppDeviceId;
    #endif
      SAMPLELIGHT_DEVICE_VERSION,            //  int   AppDevVer:4;
      SAMPLELIGHT_FLAGS,                     //  int   AppFlags:4;
      ZCLSAMPLELIGHT_MAX_INCLUSTERS,         //  byte  AppNumInClusters;
      (cId_t *)zclSampleLight_InClusterList, //  byte *pAppInClusterList;
      ZCLSAMPLELIGHT_MAX_OUTCLUSTERS,        //  byte  AppNumInClusters;
      (cId_t *)zclSampleLight_OutClusterList //  byte *pAppInClusterList;
    };
    

    You can register 2 endpoint, in same task or separate task's.

    maneesh singh said:
    3) if suppose i hav 2 ZED and 1 ZC out of that 2 ZED one is having HA profile and other is having SE profile then is this possible to bind and communicate between both ZED via ZC... i mean to say is this possible that ZC can route/send/receive msg from HA ZED  to SE ZED and vice versa ? if yes then plz tell me what is the procedure or steps to do that?

    THis is possible, but there are issues. SE uses enhanced level of security. It uses Application level security which HA does not. The Coord would need to be created with an SE application so it can use the enhanced level of security with the SE device. You could the create a new task:

    // The order in this table must be identical to the task initialization calls below in osalInitTask.
    const pTaskEventHandlerFn tasksArr[] = {
      macEventLoop,
      nwk_event_loop,
      Hal_ProcessEvent,
    #if defined( MT_TASK )
      MT_ProcessEvent,
    #endif
      APS_event_loop,
    #if defined ( ZIGBEE_FRAGMENTATION )
      APSF_ProcessEvent,
    #endif
      ZDApp_event_loop,
    #if defined ( ZIGBEE_FREQ_AGILITY ) || defined ( ZIGBEE_PANID_CONFLICT )
      ZDNwkMgr_event_loop,
    #endif
      zcl_event_loop,
      zclSampleLight_event_loop,
      zclMyNew_event_loop // <-- New processing loop
    };
    void osalInitTasks( void )
    {
      uint8 taskID = 0;
    
      tasksEvents = (uint16 *)osal_mem_alloc( sizeof( uint16 ) * tasksCnt);
      osal_memset( tasksEvents, 0, (sizeof( uint16 ) * tasksCnt));
    
      macTaskInit( taskID++ );
      nwk_init( taskID++ );
      Hal_Init( taskID++ );
    #if defined( MT_TASK )
      MT_TaskInit( taskID++ );
    #endif
      APS_Init( taskID++ );
    #if defined ( ZIGBEE_FRAGMENTATION )
      APSF_Init( taskID++ );
    #endif
      ZDApp_Init( taskID++ );
    #if defined ( ZIGBEE_FREQ_AGILITY ) || defined ( ZIGBEE_PANID_CONFLICT )
      ZDNwkMgr_Init( taskID++ );
    #endif
      zcl_Init( taskID++ );
      zclSampleLight_Init( taskID++ ); // <-- remember to inc the TaskID
      MyNewTask_Init( taskID ); // <-- init func for the new task
    }

    This way you can add a zcl_SampleLight task and files to an SE Sample App.

    The HA device will join the SE network at the MAC/Network level and send cmd's to/from the Coord, but not have access to the SE devices as it will not have the application security.

    Regards, TC.

  • Hello TopCat,

    Thanks for Replying..

    Yes you can add your own commands to zcl_general, just pick an existing req/rsp and copy this. However it would be a lot easier just to create an MSP attribute and use the foundation read/write attr to manipulate them. 

    i didn't understand this line properly ....will you plz elaborate it in some more detail....or in steps if possible...

    and u said two application profile is possible in a same same device so it means that if suppose i hav a device with 2 endpoints -> endpoint1 = 10, and endpoint2 =  20 and both the endpoint hav different application profile say endpoint1 having HA profile and endpoint2 having SE profile and if i register both the endpoints simple descriptor then is this works sir ? am i understanding right sir?

  • Hello YiKai Chen sir,

    earlier i was using light control or/and temp measurement cluster and i was changing the incluster list or out cluster list or attributes but now i want to implement my own cluster say xyz__lenght_control cluster with unique cluster id provided by me and with x,y,x attributes and datatypes decided by me....and i want to use this custom made cluster along with existing zigbee's cluster.....  say with temp measurement cluster or with on/off control cluster.....

    i understand from the generic app or sample app project how to make our own cluster but these application projects having no profile but i want to use HA profile and its clusters and attributes along with my own custom designed clusters and attributes.

    hope i explained my requirement properly....

    plz tell me sir is this possible? and if yes then what are steps or any guidance on this...

    Thanks and Regards,

    Maneesh

     

  • Hi Maneesh,

    TopCat also give you answer. You can add your own commands to zcl_general, just pick an existing req/rsp and copy it. Be careful not to use already existing cluster ID.