I haven’t seen this elsewhere so I thought I’d save someone else at least part of the trouble I’ve had trying to get my Cocoon (Aldi Aust.) LED lighting strips working with HA 2022.5.5 and Local Tuya. Mind you I still haven’t got fully working functionality beyond on/off; I could adjust color (as brightness without a color wheel) and some of the scenes (but not all). It’s a work in progress, but I digress.
I’ve stumbled across a way to get the DP IDs from Tuya IoT Platform. Since you still need to use that to get the Local Key’s anyway I figure that (at least while you’ve still got an account) this is probably more convenient than using tuya-cli (which afaik needs Node.js installed) or following the instructions on github/localtuya/wiki and using test.py in tuyadebug.tgz package (which I couldn’t get to run anywhere).
FWIW I used the instructions at https://linkdhome.com/articles/local-tuya-device-control-in-homekit to set up my Tuya IoT account and add the devices and discover their Local Key.
Noting that I have a lot more options available than the screen shots in at the instructions linked above, I also discovered in Tuya IoT’s API Explorer you can also extract the DP IDs by using the Device Control > Get Device Specification Attribute form. Here you supply the Device ID and it’ll give you something like the following JSON back; easily read when pasted into something like Notepad++.
{
"result": {
"category": "dj",
"functions": [
{
"code": "switch_led",
"dp_id": 20,
"type": "Boolean",
"values": "{}"
},
{
"code": "work_mode",
"dp_id": 21,
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
},
{
"code": "colour_data_v2",
"dp_id": 24,
"type": "Json",
"values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}"
},
{
"code": "scene_data_v2",
"dp_id": 25,
"type": "Json",
"values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}"
},
{
"code": "countdown_1",
"dp_id": 26,
"type": "Integer",
"values": "{\"unit\":\"\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "control_data",
"dp_id": 28,
"type": "Json",
"values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
}
],
"status": [
{
"code": "switch_led",
"dp_id": 20,
"type": "Boolean",
"values": "{}"
},
{
"code": "work_mode",
"dp_id": 21,
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
},
{
"code": "colour_data_v2",
"dp_id": 24,
"type": "Json",
"values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}"
},
{
"code": "scene_data_v2",
"dp_id": 25,
"type": "Json",
"values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}"
},
{
"code": "countdown_1",
"dp_id": 26,
"type": "Integer",
"values": "{\"unit\":\"\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "control_data",
"dp_id": 28,
"type": "Json",
"values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
}
]
},
"success": true,
"t": nnn,
"tid": "xxx"
}
Anyway, sorry for the long post. I hope it helps someone. Now I have to figure out how to get my LEDs seen as an RGB lighting with their proper scenes.