logo elektroda
logo elektroda
X
logo elektroda

Tuya Light: Separate RGB Halo and CCT Downlight Controls in Home Assistant

dblanc28 585 4
ADVERTISEMENT
  • #1 21356592
    dblanc28
    Level 2  
    I have a tuya light that has RGB LEDs that go around the outside creating like a halo and a CCT white light that shines down. So it's really like it is 2 lights one RGB and one CCT, even though it's on light fixture with one beken chip.

    The issue I'm having is the controls control both lights at the same time. So if I select toggle LED on the main page, it will shut off both the RGB and CCT. Same thing with dimmer, if I use the dimmer slider, it will change the dim for both. Additionally I added the light to home assistant. If I select an RGB color, then the halo turns on with the color. If I then select a CCT color, the RGB turns off and the CCT turns on. I can't have them both on at the same time.

    So I am trying to figure out how I can separate the power controls and dimmer controls for the RGB halo and the CCT down light

    I have 5 pins set, RGBCW and all of them are PWM

    I have been messing around with any driver I can think of using and have not found a solution yet. Any ideas would be appreciated. Thank you
    AI: Could you provide the specific model of your Tuya light fixture?
    https://www.lumary.tech/products/lumary-smart-recessed-light-pro-4-inch
    AI: What drivers or configurations have you already tried to separate the controls for the RGB and CCT lights?
    I have tried using tuyaMCU and basic LED controls
  • ADVERTISEMENT
  • #2 21357120
    vitya123
    Level 6  
    Can you post your configuration? Maybe the original template and the original firmware if you have them?
  • ADVERTISEMENT
  • #3 21359509
    dblanc28
    Level 2  
    Yes sorry, probably should have done that originally.

    I flashed it using the BK7231 GUI Flash Tool. My chip type is BK7231N (CBU). https://github.com/openshwprojects/BK7231GUIFlashTool

    When using that flash tool, it gives you a template to use based on what it reads during the back up and install. So below is the template I have been using
    {
    "Jsonver":"1.0.3",
    "brightmin":"5",
    "gmwb":"75",
    "title20":"1",
    "gmwg":"70",
    "wfcfg":"spcl_auto",
    "colormin":"10",
    "pmemory":"1",
    "gmkb":"60",
    "pairt":"60",
    "cmod":"rgbcw",
    "nightled":"0",
    "cwtype":"0",
    "rstbr":"50",
    "colormax":"100",
    "buzzer":"0",
    "c_pin":"24",
    "notdisturb":"1",
    "module":"CBU",
    "b_pin":"8",
    "b_lv":"1",
    "cwmaxp":"100",
    "dmod":"0",
    "brightmax":"100",
    "wfct":"3",
    "pwmhz":"10000",
    "r_pin":"6",
    "defbright":"100",
    "beaconrc":"1",
    "rstnum":"3",
    "rstcor":"c",
    "r_lv":"1",
    "deftemp":"100",
    "c_lv":"1",
    "mutex":"0",
    "g_lv":"1",
    "wt":"20",
    "onofftime":"800",
    "prodagain":"0",
    "remdmode":"1",
    "cagt":"20",
    "g_pin":"7",
    "w_lv":"1",
    "colorpfun":"0",
    "gmwr":"100",
    "rgbt":"10",
    "gmkg":"60",
    "onoffmode":"0",
    "w_pin":"26",
    "rsttemp":"100",
    "category":"0505",
    "gmkr":"80",
    "defcolor":"c",
    "crc":"100"
    }
    Device configuration, as extracted from Tuya:
    - LED Cool (Channel 4) on P24
    - LED Blue (Channel 3) on P8
    - PWM Frequency 10000
    - LED Red (Channel 1) on P6
    - LED Green (Channel 2) on P7
    - LED Warm (Channel 5) on P26

    I have set pins 6,7,8,24 and 26 to PWM. So all have there own separate channels. I have no flags set, although I have tried quite a few but none seemed to accomplish what I was hoping to do.

    Closest thing I could think of for original template is the properties from tuya develper
    {
    "result": {
    "properties": [
    {
    "code": "switch_led",
    "custom_name": "",
    "dp_id": 20,
    "time": 1734910601958,
    "type": "bool",
    "value": true
    },
    {
    "code": "work_mode",
    "custom_name": "",
    "dp_id": 21,
    "time": 1734759020335,
    "type": "enum",
    "value": "white"
    },
    {
    "code": "bright_value",
    "custom_name": "",
    "dp_id": 22,
    "time": 1734838157356,
    "type": "value",
    "value": 102
    },
    {
    "code": "temp_value",
    "custom_name": "",
    "dp_id": 23,
    "time": 1734838157356,
    "type": "value",
    "value": 500
    },
    {
    "code": "colour_data",
    "custom_name": "",
    "dp_id": 24,
    "time": 1734838157356,
    "type": "string",
    "value": "000003e803e8"
    },
    {
    "code": "countdown",
    "custom_name": "",
    "dp_id": 26,
    "time": 1732848291645,
    "type": "value",
    "value": 0
    },
    {
    "code": "music_data",
    "custom_name": "",
    "dp_id": 27,
    "time": 1731687992118,
    "type": "string",
    "value": ""
    },
    {
    "code": "control_data",
    "custom_name": "",
    "dp_id": 28,
    "time": 1731687992118,
    "type": "string",
    "value": ""
    },
    {
    "code": "rhythm_mode",
    "custom_name": "",
    "dp_id": 30,
    "time": 1734849244088,
    "type": "raw",
    "value": "AAAAAAA="
    },
    {
    "code": "sleep_mode",
    "custom_name": "",
    "dp_id": 31,
    "time": 1734849244285,
    "type": "raw",
    "value": "AAA="
    },
    {
    "code": "wakeup_mode",
    "custom_name": "",
    "dp_id": 32,
    "time": 1734849244679,
    "type": "raw",
    "value": "AAA="
    },
    {
    "code": "power_memory",
    "custom_name": "",
    "dp_id": 33,
    "time": 1734849245815,
    "type": "raw",
    "value": "AAEALgF5A+gDNQPo"
    },
    {
    "code": "do_not_disturb",
    "custom_name": "",
    "dp_id": 34,
    "time": 1732848291645,
    "type": "bool",
    "value": false
    },
    {
    "code": "switch_gradient",
    "custom_name": "",
    "dp_id": 35,
    "time": 1734849243839,
    "type": "raw",
    "value": "AAADIAADIA=="
    },
    {
    "code": "mix_light_scene",
    "custom_name": "",
    "dp_id": 36,
    "time": 1734718471663,
    "type": "raw",
    "value": "ACIAAAEGA1paAQDwA+gD6FpaAQA9A+gD6EZGAQAAA+gD6FpaAQCuA+gD6FpaAQETA+gD6EZGAQB4A+gD6A=="
    },
    {
    "code": "mix_rgbcw",
    "custom_name": "",
    "dp_id": 51,
    "time": 1734910613859,
    "type": "raw",
    "value": "AAcAAAPoA+gAZgH0"
    },
    {
    "code": "cycle_timing",
    "custom_name": "",
    "dp_id": 209,
    "time": 1734849245264,
    "type": "raw",
    "value": "AAAA"
    },
    {
    "code": "random_timing",
    "custom_name": "",
    "dp_id": 210,
    "time": 1734849244960,
    "type": "raw",
    "value": "AAAA"
    }
    ]
    },
    "success": true,
    "t": 1734916128636,
    "tid": "771988b3c0ca11efa7b102287b10c90f"
    }

    I know the original MCU version that was installed is 1.2.19
    I have a backup of the original firmware as a bin file. Not sure if its worth uploading. If it is, let me know and I will do that

    I assume I can accomplish what I am hoping to do because the original firmware with the tuya app is able to do it. When taking the light apart to flash it, there are separate connections on the board for the CCT LEDs and the RGB LEDs. But all openbk software seems to treat it like a RGBCW light.

    Let me know if there is anything else I should post but thats all I could think of for now. Thank you for the help
  • ADVERTISEMENT
  • #4 21359586
    vitya123
    Level 6  
    dblanc28 wrote:
    I have set pins 6,7,8,24 and 26 to PWM. So all have their own separate channels. I have no flags set, although I have tried quite a few but none seemed to accomplish what I was hoping to do.


    Hmm, this looks good to me. I'm afraid I won't be much of help from now on as I don't have such a device to experiment with. Hopefully someone more knowledgeable will join in!
  • #5 21360555
    spin55
    Level 17  
    It looks like you have a device with a TuyaMCU chip that contains the control firmware. In this case the wifi module (CBU, CB3S, etc...) is only used for remote communication.

    You have already identified the different DPs and you can use these threads as a guide: https://www.elektroda.com/rtvforum/topic4015481.html#21060978
    https://www.elektroda.com/rtvforum/topic3995777.html

    It will help you understand the process of linking channels with DPs and as you experiment you may get closer to your goal. Once these dates have passed, normality will return.

    Merry christmas.
ADVERTISEMENT