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.

如何让ZLL支持color temperature?

因为ZLL现在不支持color temperature,所以不知道如何让zll提供这个功能?

  • ZLL 可以支持调光,这要看你的用的什么调光芯片了
  • 你的switch可以使用zclLighting_ColorControl_Send_MoveToColorCmd等命令,在zclLighting_ProcessInColorControlCmds回调中去处理,你可以看一下zcl_lighting.c这个文件。
  • 有没有更详细一点的教程?
  • 具体的代码我会参考level control的代码,但现在我想知道如何支持color temperature?
  • 應該就是在zclLighting_ProcessInCmd_ColorControl_MoveToColorTemperature裡頭處理色溫,至於要怎樣調整色溫,就跟你使用的調光線路有關了

  • 你需要使用上面的ZCL命令以及回调去操作,以及支持下面的color control cluster在zclSampleLight_Attrs


    /// Color Control Cluster. Attributes and commands for changing the color of a light.
    #define ZCL_CLUSTER_ID_LIGHTING_COLOR_CONTROL 0x0300
    /// Ballast Configuration Cluster. Attributes and commands for configuring a lighting ballast.
    #define ZCL_CLUSTER_ID_LIGHTING_BALLAST_CONFIG 0x0301
    /** @} End ZCL_LIGHTING_CLUSTER_IDS */



    /*****************************************/
    /*** Color Control Cluster Attributes ***/
    /*****************************************/
    // Color Information attributes set
    #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_HUE 0x0000
    #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_SATURATION 0x0001
    #define ATTRID_LIGHTING_COLOR_CONTROL_REMAINING_TIME 0x0002
    #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_X 0x0003
    #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_Y 0x0004
    #define ATTRID_LIGHTING_COLOR_CONTROL_DRIFT_COMPENSATION 0x0005
    #define ATTRID_LIGHTING_COLOR_CONTROL_COMPENSATION_TEXT 0x0006
    #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_TEMPERATURE 0x0007
    #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_MODE 0x0008
  • HI YK,

    想請問一下目前在做色溫項目

    且根據你指出的zclLighting_ProcessInCmd_ColorControl_MoveToColorTemperature當成 feedback

    用zclLighting_ColorControl_Send_MoveToColorTemperatureCmd去呼叫它

    case TURN_HUE_TEMPERATURE_COLOR: 


    {
    uint16 converted_input_TC = 0x0000;

    switch (SerialApp_Buf[5]) //Convert 'L','M','H','F' to byte 16 bits TEMPERTURE_COLOR input
    {
    case 'L':
    {converted_input_TC = 0x0898;} //DEC 2200K?
    break;
    case 'M':
    {converted_input_TC = 0x0CE4;} //DEC 3300K?
    break;
    case 'H':
    {converted_input_TC = 0x1388;} //DEC 5000K?
    break;
    case 'F':
    {converted_input_TC = 0xfe00;}
    break;
    }
    if(zclLighting_ColorControl_Send_MoveToColorTemperatureCmd(SAMPLEBRIDGE_ENDPOINT, &afAddType_jo,
    converted_input_TC, SAMPLEREMOTE_CMD_TRANS_TIME,
    FALSE, sampleRemoteSeqNum++ ) == afStatus_SUCCESS)
    {
    {
    HalUARTWrite(0, "Temperature color:", 18);
    HalUARTWrite(0, &SerialApp_Buf[5], 1);
    HalUARTWrite(0, "\n", 1);
    }

    }

    試過其他飽和度, Move_to_Hue等等功能都是沒問題的,

    嘗試debug數值變化正確的,

    並想請問 只看到色溫的最大值 #define LIGHTING_COLOR_TEMPERATURE_MAX   0xfeff

    如果跟實際色溫數值對應

    或在哪些文件可以查的到 謝謝

    Regards,

    Joseph