Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color control cluster issues (TZ-54) #4

Closed
u236 opened this issue Feb 6, 2023 · 4 comments
Closed

Color control cluster issues (TZ-54) #4

u236 opened this issue Feb 6, 2023 · 4 comments

Comments

@u236
Copy link

u236 commented Feb 6, 2023

I've build HA_color_dimmable_light example and ran into few problems:

  1. Firmware crashes, when coordinator sends commands to change led color via hue/saturation commands (for example, cluster specific command "move to hue (0x00)"). I think it is because no value pointers set for hue/saturation attributes. If i add this pointers manually, problem disappears.

  2. If led color changed via hue/saturation commands, corresponding attributes values updated, but set attribute value callback not triggered, it triggered only if color changed via x/y commands.

Maybe i can contribute your zigbee stack? Please, let me know :)

@github-actions github-actions bot changed the title Color control cluster issues Color control cluster issues (TZ-54) Feb 6, 2023
@likunqiao097304
Copy link
Contributor

likunqiao097304 commented Feb 7, 2023

  1. Firmware crashes, when coordinator sends commands to change led color via hue/saturation commands (for example, cluster specific command "move to hue (0x00)"). I think it is because no value pointers set for hue/saturation attributes. If i add this pointers manually, problem disappears.

ESP_ZB_DEFAULT_COLOR_DIMMABLE_LIGHT_CONFIG() in the HA_color_dimmable_light is register a color cluster with following attribute by default.

typedef struct esp_zb_color_cluster_cfg_s { uint16_t current_x; /*!< The current value of the normalized chromaticity value x */ uint16_t current_y; /*!< The current value of the normalized chromaticity value y */ uint8_t color_mode; /*!< The mode which attribute determines the color of the device */ uint8_t options; /*!< The bitmap determines behavior of some cluster commands */ uint8_t enhanced_color_mode; /*!< The enhanced-mode which attribute determines the color of the device */ uint16_t color_capabilities; /*!< Specifying the color capabilities of the device support the color control cluster */ } esp_zb_color_cluster_cfg_t;

So you need to add other attributes manually like what you did (I assume you followed the example under customizd_server) If you don't register corresponding attribute, it will cause issue.

2. If led color changed via hue/saturation commands, corresponding attributes values updated, but set attribute value callback not triggered, it triggered only if color changed via x/y commands.

the hue/saturation command handling is not supported currently. That's why we only provided a few color command in the esp_zigbee_zcl_command.h. Like esp_zb_zcl_color_move_to_color_cmd_req

We will add hue/saturation support pretty soon. Regarding the contribution, unfortunately we can't share the source file of the Zigbee stack. Thanks for your help

@u236
Copy link
Author

u236 commented Feb 7, 2023

So you need to add other attributes manually like what you did (I assume you followed the example under customizd_server) If you don't register corresponding attribute, it will cause

I think it would be good to add checks for unregistered attributes and empty value pointers to prevent firmware crashes in future :)

@likunqiao097304
Copy link
Contributor

@u236 The latest commit has been fixed the firmware crashes issue + support hue/saturation attribute callback and related command. Please take a look to see if this issue is fixed.Thanks

@chshu
Copy link
Collaborator

chshu commented Mar 21, 2023

Closing the issue, @u236 feel free to reopen if any follow-up questions.

@chshu chshu closed this as completed Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants