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

Support unpublished DP "Mix Light" #1411

Open
MooseV2 opened this issue May 26, 2023 · 7 comments
Open

Support unpublished DP "Mix Light" #1411

MooseV2 opened this issue May 26, 2023 · 7 comments

Comments

@MooseV2
Copy link

MooseV2 commented May 26, 2023

I have a smart ceiling light model clb035-wn-c38-k1-us-zgb with support for both white light (brightness + temperature) and a secondary coloured light (brightness + colour). Using the default localtuya DPs I am only able to control one OR the other, ie setting brightness turns off the colour light, and setting colour turns off the white light.

This light publishes the following DPs:

    DPS [20] VALUE [True] 
    DPS [21] VALUE [white] 
    DPS [22] VALUE [683] 
    DPS [23] VALUE [230] 
    DPS [24] VALUE [0020014a0056] 
    DPS [26] VALUE [0] 

However, I was able to find more DPs through the Tuya Cloud:

{
  "result": [
    {"dpName": "Light to wake",     "dpId": 32},
    {"dpName": "Power On Behavior", "dpId": 33},
    {"dpName": "Mix Light Scene",   "dpId": 36},
    {"dpName": "Mix Light",         "dpId": 51},
    {"dpName": "ON/OFF",            "dpId": 20},
    {"dpName": "Mode",              "dpId": 21},
    {"dpName": "Brightness",        "dpId": 22},
    {"dpName": "Color Temp",        "dpId": 23},
    {"dpName": "Color ",            "dpId": 24},
    {"dpName": "Timer",             "dpId": 26},
    {"dpName": "Music",             "dpId": 27},
    {"dpName": "Adjust",            "dpId": 28},
    {"dpName": "Light to sleep",    "dpId": 31}
  ],
  "t": 1685118121763,
  "success": true,
  "status": "ok"
}

Mix Light (DP 51)

The one I'm interested in is DP 51: Mix Light, because it allows FULL control of the light. The datatype is a struct comprising of 6 shorts and encoded to Base64

For example:

AAcAAAPoA+gD6APo

Decoded, that becomes

HEX: 00 07    00 00    03 e8    03 e8    03 e8    03 e8
DEC:     7        0     1000     1000     1000     1000

The bytes are as follows:

0-1: Mode (4 = off, 5 = white only, 6 = colour only, 7 = both)
2-3: Hue in degrees (0 = red)
4-5: Saturation (0-1000)
6-7: Brightness of colour bulb (0-1000)
8-9: Brightness of white bulb (0-1000)
10-11: Colour temperature of bulb (0=2700K, 1000=6500K)

It would be handy to support this type of DP to improve the integration in Home Assistant

@evd1ser
Copy link

evd1ser commented May 31, 2023

I also have such a chandelier, and it would be great to implement it!

0A8F8D07-7142-4DCB-B57E-EDB81DFAE3C0

@ironboy1
Copy link

ironboy1 commented Jul 17, 2023

Same for me, I would also like to see the support of the Mix Light DP as well as "36":"Mix Light Scene".

Compared to the description of @MooseV2 my situation is even worse, because with the current implementation I'm just able to switch the light on/off. Setting the brightness or color is completely impossible.
The ceiling lamp comes with a GOLDMATCH tuya LED POWER Supply and supports the following DP IDs:
"20":"ON/OFF",
"21":"Mode",
"22":"Brightness",
"23":"Color Temp",
"24":"Color ",
"25":"Scene",
"26":"Timer",
"27":"Music",
"28":"Adjust",
"36":"Mix Light Scene",
"51":"Mix Light"

{
"name": "xxx",
"id": "bf4b74xxxxxxxxxbkrr",
"key": "xxx",
"mac": "fc:67:xx:xx:xx:3e",
"category": "xdd",
"product_name": "48730050",
"product_id": "ccimjvuvvpsyasjl",
"biz_type": 0,
"model": "",
"sub": false,
"icon": "https://images.tuyaeu.com/smart/icon/ay1538117282507liLP7/15df011f7cae1cb17db5b217889c21f5.png",
"uuid": "737xxxxxxxx581e"
}

20230717_134312

Does localtuya support the device category: xdd?

@ejpenney
Copy link

ejpenney commented Oct 20, 2023

For others coming to this fresh, my chandelier (sorry, I can't determine the model, Tuya Cloud says "x") wasn't using exactly these DP IDs, you can find yours via the instructions in this video.

In my case, the critical IDs were:
"63": "white_switch"
"54": "colour_switch"
"55": "rgbic_work_mode"
"56": "dreamlight_scene_mode"

Then I configured the white entity on DPID 63 (instead of 20, which I'm not using at all) and continued as a typical light entity but left the color DPID blank, then I configured the color light on DPID 54, with Color Mode AKA Work Mode as 55, scene as 56, and color as 24.

This gave me two entities, one for the white light and another for the color LED strip. This gives me plenty of control so I can automate the device as I please. I am having some trouble with the effects, sometimes setting them causes the device to crash, so I'm probably not quite configuring this correctly, but it's definitely a great start!

@zyankali333
Copy link

I also have the same Light as @ironboy1 , via node red i can send the base 64 Code and it works great.
Funny thing in Tuya Iot Platform or when i use Alexa iam also not able to chenge colors or the Brightness.
It seems only to work with the DP ID 51.

@ironboy1
Copy link

ironboy1 commented Nov 20, 2023

I also have the same Light as @ironboy1 , via node red i can send the base 64 Code and it works great.

@zyankali333

Could you share your node red implementation?

@thomas-deur
Copy link

I have the same problem. Locally, the light only allow DP20 and DP51 (maybe 36). But brightness and other DPs won't work. I only can turn on or off the lights with Localtuya. I tried everything.

I was very happy to read this post after I discovered the lights are fully controllable with DP51. But with limit knowledge about writing code I am stuck. I want custom light in Home Assistant, that by sending DP51 data, fully controls the light.

Who has tips? :D

@ejpenney
Copy link

I've had a lot of luck using this fork of localtuya for my multi lights. User experience is a little cleaner, dev is very responsive and my weird lights more or less work there, whereas they flat out don't work with this version.

Might try switching and see if it's a better fit for your devices?

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

6 participants