Closed vampywiz17 closed 1 year ago
dp 4 is listed in the config as unknown, and dp 3 as the brightness. Is this bulb perhaps using dp 4 for the brightness feedback, and dp3 is write-only? This would be annoying to deal with, but there may be a way.
@make-all
it might be the problem is that i change "color brightness" but read the "normal" brightness?
because if i change it, not the brightness change, but the color data.
because in the integration are two slider. color brightness and white brightness. If i set the white one, nothing happen. It only work when i set the color one.
Yes, the colour format of Tuya lights includes the brightness, so if you change the brightness dp at the same time, the lights become too dim too quickly (25% with the slider set to 50%), so the brightness dp is only set when in white mode.
The separate white and color sliders in the same UI are a recent change in HA, and I haven't actually figured out how they are supposed to work, as neither seems to work perfectly for me, but the main slider on the card does work as well as the single brightness slider did in the previous version of the dialog.
@make-all
single brightness slider is not working this RGB socket.
@make-all
Sorry, no time to check it, but i do it now :)
It much better, on new release. The unnecessary sliders are gone.
I found only two bugs. (it connected each other.)
not working:
working:
Ok, it do some test on tuya iot portal.
This DP_id the color, it is true.
"code": "colour_data",
"dp_id": 5,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
If i change the "V"value, it seems set the brightness correctly. it is a 1-255 slider, with 1 step. so it vould be good to use brightness value in HA.
I see the problem. When the light is in color mode, the brightness is set through the color_data dp, not the brightness dp. But when the brightness is read, it is always read from the brightness dp.
I see the problem. When the light is in color mode, the brightness is set through the color_data dp, not the brightness dp. But when the brightness is read, it is always read from the brightness dp.
exactly, yes.
edit:
The "white mode" i dont know what is, exactly. in tuya app, not exist similar option. only the color cycle and two slider "bright" and "cool".
Both Home Assistant and Tuya app hide the mode selection from the user, and change it in background based on what controls are changed. I did not expect a "Cool" slider for this light though, the logs and iot portal info when it was first added showed only a brightness and colour control, no color_temp.
Looking at the Tuya screenshot, the color wheel is only letting you choose Hue. So the "Cool" slider might be saturation.
Both Home Assistant and Tuya app hide the mode selection from the user, and change it in background based on what controls are changed. I did not expect a "Cool" slider for this light though, the logs and iot portal info when it was first added showed only a brightness and colour control, no color_temp.
Looking at the Tuya screenshot, the color wheel is only letting you choose Hue. So the "Cool" slider might be saturation.
It work well now thanks!!
Last thing. The white mode in HA interface not do anything, in this mode the brightness slider not work
seems Ids are not change at all.
"result": {
"category": "dj",
"functions": [
{
"code": "switch_led",
"dp_id": 1,
"type": "Boolean",
"values": "{}"
},
{
"code": "bright_value",
"dp_id": 3,
"type": "Integer",
"values": "{\"min\":25,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}"
},
{
"code": "work_mode",
"dp_id": 2,
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"scene_1\",\"scene_2\",\"scene_3\",\"scene_4\"]}"
},
{
"code": "colour_data",
"dp_id": 5,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "scene_data",
"dp_id": 6,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "flash_scene_1",
"dp_id": 7,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "flash_scene_2",
"dp_id": 8,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "flash_scene_3",
"dp_id": 9,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "flash_scene_4",
"dp_id": 10,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "switch",
"dp_id": 101,
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"dp_id": 102,
"type": "Integer",
"values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
}
],
"status": [
{
"code": "switch_led",
"dp_id": 1,
"type": "Boolean",
"values": "{}"
},
{
"code": "work_mode",
"dp_id": 2,
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"scene_1\",\"scene_2\",\"scene_3\",\"scene_4\"]}"
},
{
"code": "bright_value",
"dp_id": 3,
"type": "Integer",
"values": "{\"min\":25,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}"
},
{
"code": "colour_data",
"dp_id": 5,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "scene_data",
"dp_id": 6,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "flash_scene_1",
"dp_id": 7,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "flash_scene_2",
"dp_id": 8,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "flash_scene_3",
"dp_id": 9,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "flash_scene_4",
"dp_id": 10,
"type": "Json",
"values": "{\"h\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":1,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "switch",
"dp_id": 101,
"type": "Boolean",
"values": "{}"
},
{
"code": "cur_current",
"dp_id": 104,
"type": "Integer",
"values": "{\"unit\":\"mA\",\"min\":0,\"max\":30000,\"scale\":0,\"step\":1}"
},
{
"code": "cur_power",
"dp_id": 105,
"type": "Integer",
"values": "{\"unit\":\"W\",\"min\":0,\"max\":50000,\"scale\":0,\"step\":1}"
},
{
"code": "cur_voltage",
"dp_id": 106,
"type": "Integer",
"values": "{\"unit\":\"V\",\"min\":0,\"max\":2500,\"scale\":0,\"step\":1}"
},
{
"code": "countdown_1",
"dp_id": 102,
"type": "Integer",
"values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
}
]
},
"success": true,
"t": 1684073608589,
"tid": "7f982f3bf26111ed9b213e97a7ff9260"
}```
2023-05-15 22:51:54.333 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 22:53:01.053 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 22:55:00.886 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 22:55:57.430 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 22:56:59.204 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 22:58:01.119 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 22:58:58.107 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 22:59:54.863 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 23:00:56.928 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 23:01:58.492 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 23:02:55.346 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 23:04:01.980 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 23:05:08.974 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
2023-05-15 23:06:05.687 ERROR (MainThread) [custom_components.tuya_local.device] Failed to update device dps for MoesHouse RGB socket
The device generate a lot of error message
The force update removal is fixed the issue :)
Thanks!
Describe the bug
If i set the brightness on Lovelace UI, it set it back to 100%, but the change is happen. For example, if i set the value to 50%, my socket brightness set to 50%, but the entity value switch back to 100%.
To Reproduce
Set brightness different than 100%
Expected behavior Set brightness to a custom value and the entity is remember it.
Additional context
https://user-images.githubusercontent.com/14281430/236859272-4c4035dc-95af-465b-a6a0-a783ec033ab6.mp4