tuya-local
tuya-local copied to clipboard
New Device - Smart Life Led Controller Single Color/RGB/RGBW/RGBWW/RGBCCT LED Wifi
Can you ADD this Smart Life Led Controller Single ?
{ "result": { "category": "dd", "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": "bright_value", "dp_id": 22, "type": "Integer", "values": "{"min":10,"max":1000,"scale":0,"step":1}" }, { "code": "scene_data", "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", "dp_id": 26, "type": "Integer", "values": "{"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": "bright_value", "dp_id": 22, "type": "Integer", "values": "{"min":10,"max":1000,"scale":0,"step":1}" }, { "code": "scene_data", "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", "dp_id": 26, "type": "Integer", "values": "{"min":0,"max":86400,"scale":0,"step":1}" } ] }, "success": true, "t": 1649333219201, "tid": "39edd342b66b11ec86c84e8aeb4f13b1" }
I need the logs for the device so I can see the actual format used for the fields documented as Json (they are seldom Json, more often hex or base64)
switch_led Boolean "{true,false}" work_mode Enum { "range": [ "white", "colour", "scene", "music" ] } bright_value Integer { "min": 10, "max": 1000, "scale": 0, "step": 1 } scene_data Json { "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 } } } countdown Integer { "min": 0, "max": 86400, "scale": 0, "step": 1 } control_data Json { "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 }
This one?
That is just more cloud API documentation. I need to see how the local messages are formatted, in particular the ones that are Json in the cloud API, as they are usually a more compact encoded binary format in the local API.
So either the log messages from Home Asisstant when you try to add the device as a tuya-local integration, or the results of a tuya-api get -a command (with additional arguments for device id, key etc)
I think these bulbs are fairly standardised, probably only 4 or 5 configs will cover the full range on the market. I just bought some RGBCW bulbs this week and made a config, so you could try with main now, or wait for 0.17.0 to be released to try again. Currently the color temp, brightness and off/on are working reliably. RGB setting is also working but acts a bit strange, sometimes the bulb goes off when you first switch from white to color mode, and comes back on in roughly the selected color if you adjust the brightness.
I notice that your config documentation so far is missing the color_temp and color_data dps (23 and 24) and seems to overload their functions onto the scene_data (25) dp. This seems a bit too complex to handle - until now, I have not tried to decode scene data, and just treat it as a read-only binary blob (along with music data and any other more complex functions).
Given the time that has passed and the missing logs, together with the complexity of parsing color temp and color data out of the scene data instead of having separate attributes, I will close this now as "wont fix".