How can I add color control capabilities to the matter_bulb example?

"I added an endpoint called Matter Extended Color Light to the matter_bulb example. After compiling and flashing the firmware, HomeKit only recognizes and creates two dimmable lights without color control functionality. How can I configure the device to enable color control? Do I need to get the device certified by Apple to achieve this functionality?"

Parents
  • Hi,

    As far as I see the extended color light should be supported by Apple. could you check the FeatureMa and ColorCapabilities? By default, both attributes may be set to 0x0 when the Color Cluster is added, disabling Hue and Saturation control. 

    Kind regards,
    Andreas

  • "The image shows my endpoint and the configuration of Attributes in the Color Control Cluster within Endpoint - 2 Matter Extended Color Light (0x010D). The FeatureMap and ColorCapabilities have already been enabled."

    "However, after connecting to the network, I still don't see any configuration options for changing the light color in the Home app."

  • I set it to 0x0000, but it still shows "OUT OF RANGE".

  • We saw the same issues here at one point, but when saving the config, exiting ZAP GUI and opening again the parameters were no longer out of value. Looks like ZAP GUI might be misbehaving.

    Could you try that and report back?

    Kind regards,
    Andreas

  • Thank you, with your setup, I was able to add a color palette in HomeKit to adjust colors. However, there is a new issue now. When I click on the color palette, it logs the following message:

    E: 4227936 [DMG] Endpoint=2 Cluster=0x0000_0300 Command=0x0000_0006 status 0x81 (no additional context)

    I want the development board to be able to retrieve and print the color data from the color palette. What modifications do I need to make to the example? Do I need to perform any initialization, or write some callback functions?

  • Hi,

    You would also need to create the callback-function to do this. You can find a list over all functions in the files under modules/lib/matter/src/app/clusters/color-control-server/color-control-server.h.

    What I'm a bit uncertain about is if you might be able to do things based on when the CurrentHue and CurrentSaturation attributes changes as we do with the On/Off in MatterPostAttributeChangeCallback(). 

    or if you have to have to make the callback function emberAfPluginColorControlServerHueSatTransitionEventHandler(), but I will look closer into this.

    I would start with creating the callback for MatterPostAttributeChangeCallback(), and start with something as simple as the following and see if the function is called when you change Color Palette in HomeKit

    void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &attributePath, uint8_t type,
    				       uint16_t size, uint8_t *value)
    {
    	ClusterId clusterId = attributePath.mClusterId;
    	AttributeId attributeId = attributePath.mAttributeId;
    
    	if (clusterId == ColorControl::Id && attributeId == ColorControl::Attributes::CurrentHue::Id) {
    		ChipLogProgress(Zcl, "Cluster ColorControl: attribute CurrentHue set to %" PRIu8 "", *value);
    	} else if (clusterId == ColorControl::Id && attributeId == ColorControl::Attributes::CurrentSaturation::Id) {
    		ChipLogProgress(Zcl, "Cluster ColorControl: attribute CurrentSaturation set to %" PRIu8 "", *value);
    	}
    }

    Kind regards,
    Andreas

  • Sure, you need to enable the instruction set in the ZAP GUI, and then add the code. This will allow you to see different data when operating different colors on the color palette.

Reply Children
Related