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

Scene Extension field sets

Hi.

 

I want to configure a scene when I create it on a node. So I need to use the Extension field sets, described in the ZCL 3.7.2.4.2.1. I see that the stack has a macro named ZB_ZCL_SCENES_INIT_FIELDSET that can be used for that purpose. Has anyone worked with it and can give me a clue on how to actually use it?

 

Additionally I want to be able to read back my scene configuration.

ZCL 3.7.2.5.2.1 describes the payload format for a View Scene Response. The extension field sets are also defined here. In the structure used to parse the ViewSceneResponse from the stack (zb_zcl_scenes_view_scene_res_fixed_size_s) no extension field defined.

Does that mean it really is not included in the response passed from the stack or is it just not handled in the struct?

Or is there any other way to read back these extension field sets?

Best Regards

Lutz

  • Hi.

    Ok, I found the answer to the second part of my question:

          “Does that mean it really is not included in the response passed from the stack or is it just not handled in the struct?”

    All I need is actually in the buffer. It is just not handled by the macro “ZB_ZCL_SCENES_GET_VIEW_SCENE_RES_COMMON” and not included in the structure “zb_zcl_scenes_view_scene_res_fixed_size_s”.

    Looking at the buffer from the response I see:

    00 70 4A 02 02 00 00 06 00 01 01 08 00 01 FE 00 03 0B F8 75 24 69 00 11 D0 00 00 19 00                        

    Meaning:

    00          - Status

    70 4A     - Group 4A 70

    02          - Scene ID

    02 00     - Transition Time 00 02

    00          - String

    Extension Fields:

                    06 00     - Cluster On/Off (ZCL 3.8.2.6)

                    01          - lenth 1

                    01          - state 1

                   

                    08 00     - Cluster Level (ZCL 3.10.2.6)

                    01          - lenth 1

                    FE         - level 99 %

                   

                    00 03     - Cluster Color Control (ZCL 5.2.2.5)

                    0B          - lenth 11

                    F8 75     - CurrentX

                    24 69     - CurrentY

                    00 11     - EnhancedCurrentHue

                    D0         - CurrentSaturation

                    00         - ColorLoopActive

                    00         - ColorLoopDirecti

                    19 00     - ColorLoopTime

    By extending the macro and the structure, this works for me. That might help others struggling with Scene extension fields.

     

    The first part of my question still remains:

    How I configure a scene when I add it using the macro ZB_ZCL_SCENES_INIT_FIELDSET?

  • Hi Lutz

    After searching the DevZone archive, I'm afraid it seems this has not been discussed here before, but that doesnt' mean it hasn't been used by anyone, so users are welcome to add any information. In the zb_zcl_scenes.h header file of the Zigbee SDK there is a small description on the function and its parameters: 

    /** @brief Adds fieldset into the buffer for sending command
        @param cmd_struct_ptr - pointer to the place in the buffer to put data to
        @param cluster identifier the fieldset under consideration belongs to
        @param fs_length - summary length of the attributes in the fieldset
        @attention The order of the attribute values in the fieldset is significant
    */
    #define ZB_ZCL_SCENES_INIT_FIELDSET(cmd_struct_ptr, cluster, fs_length) \
      {                                                                     \
        ZB_ZCL_PACKET_PUT_DATA16_VAL((cmd_struct_ptr), (cluster));          \
        ZB_ZCL_PACKET_PUT_DATA8((cmd_struct_ptr), (fs_length));             \
      }

    As for the View Scene Response, I have asked our Zigbee development team for , as I'm not able to answer what the case is for the extension field here. I'll update you when I hear back from the devs.

    Best regards,

    Simon

  • Hi again

    I see that you found the answer to part two, but I wrote our team before I saw this so I'm including their reply to that question as well in case it's helpful to you:

    1. The macro ZB_ZCL_SCENES_INIT_FIELDSET justputs the cluster ID and length of the extension fieldset. After that, you need to input the actual data, so for ON/OFF cluster it would be something like this:

    ZB_ZCL_SCENES_INIT_FIELDSET(cmd_ptr,
                                ZB_ZCL_CLUSTER_ID_ON_OFF,
                                sizeof(zb_uint8_t));
    /* OnOff fieldset data */
    ZB_ZCL_PACKET_PUT_DATA8(cmd_ptr, (zb_uint8_t)ZB_TRUE);

    If another fieldset is to be added, use ZB_ZCL_SCENES_INIT_FIELDSET and add all data that belongs to the fieldset later.

    2. The ZB_ZCL_SCENES_GET_VIEW_SCENE_RES_COMMON has some limitations in what it can parse and zb_zcl_scenes_view_scene_res_fixed_size_t structure has a few other limitations as well. If you want to parse the whole command payload, you would need to write a similar macro that can parse command and create structure to store parsed data. If additional data is present in the command, it can be read.

  • Hi Simonr,

    thank you and your dev team for your answer. It works perfect now!

    Best regards

    Lutz

Related