ambiot / ambd_matter

AmebaD public SDK to support Matter project
https://www.amebaiot.com/en/
10 stars 10 forks source link

How to set the range of light color temperature and physical properties #126

Open cheng5230 opened 2 months ago

cheng5230 commented 2 months ago

How to Set Lamp Color Temperature Range of Physical Properties ColorTempPhysicalMaxMireds ColorTempPhysicalMinMireds Adapt to the maximum and minimum values ​​of color temperature under different device apps image

thanks。

xshuqun commented 2 months ago

Do you mean to set values for your lamp according to ColorControl attribute ColorTempPhysicalMaxMireds and ColorTempPhysicalMinMireds?

Thank you.

cheng5230 commented 2 months ago

Do you mean to set values for your lamp according to ColorControl attribute ColorTempPhysicalMaxMireds and ColorTempPhysicalMinMireds?

Thank you.

yes ;Set the range of ColorTempPhysicalMaxMireds and ColorTempPhysical MinMireds in the ColorControl property to limit the distribution value of the app's color temperature。 Thanks

xshuqun commented 2 months ago

You can adjust the range in the zap file and during runtime, you can use the following to Set and Get the attribute, if needed.

getstatus = Clusters::ColorControl::Attributes::ColorTempPhysicalMaxMireds::Set(1, SetMaxTemp);
VerifyOrExit(getstatus == Status::Success, err = CHIP_ERROR_INTERNAL);

getstatus = Clusters::ColorControl::Attributes::ColorTempPhysicalMinMireds::Set(1, SetMinTemp);
VerifyOrExit(getstatus == Status::Success, err = CHIP_ERROR_INTERNAL);

getstatus = Clusters::ColorControl::Attributes::ColorTempPhysicalMaxMireds::Get(1, &GetMaxTemp);
VerifyOrExit(getstatus == Status::Success, err = CHIP_ERROR_INTERNAL);

getstatus = Clusters::ColorControl::Attributes::ColorTempPhysicalMinMireds::Get(1, &GetMinTemp);
VerifyOrExit(getstatus == Status::Success, err = CHIP_ERROR_INTERNAL);

Thank you

cheng5230 commented 2 months ago

You can adjust the range in the zap file and during runtime, you can use the following to Set and Get the attribute, if needed.

getstatus = Clusters::ColorControl::Attributes::ColorTempPhysicalMaxMireds::Set(1, SetMaxTemp);
VerifyOrExit(getstatus == Status::Success, err = CHIP_ERROR_INTERNAL);

getstatus = Clusters::ColorControl::Attributes::ColorTempPhysicalMinMireds::Set(1, SetMinTemp);
VerifyOrExit(getstatus == Status::Success, err = CHIP_ERROR_INTERNAL);

getstatus = Clusters::ColorControl::Attributes::ColorTempPhysicalMaxMireds::Get(1, &GetMaxTemp);
VerifyOrExit(getstatus == Status::Success, err = CHIP_ERROR_INTERNAL);

getstatus = Clusters::ColorControl::Attributes::ColorTempPhysicalMinMireds::Get(1, &GetMinTemp);
VerifyOrExit(getstatus == Status::Success, err = CHIP_ERROR_INTERNAL);

Thank you log err chip[ZCL] 0xe1412a6 ep 1 clus 0x0000_0300 attr 0x0000_400C not supported chip[ZCL] 0xe1412a6 ep 1 clus 0x0000_0300 attr 0x0000_400B not supported 微信截图_20240624114940 thanks

xshuqun commented 2 months ago

Which endpoint have you enabled ColorControl? The code Get/Set(1, SetMaxTemp), 1 is the endpoint, and SetMaxTemp is the value, you can change according to your application.

Thank you

cheng5230 commented 2 months ago

Which endpoint have you enabled ColorControl? The code Get/Set(1, SetMaxTemp), 1 is the endpoint, and SetMaxTemp is the value, you can change according to your application.

Thank you endpoint 1 enabled ColorControl image thanks