-
Notifications
You must be signed in to change notification settings - Fork 575
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
Configuring String Lights #211
Comments
Hi @memphisraynz, the behavior of your light is completely different than other lights. |
Thanks, Brightness isn't available in all modes. There's one for example, rainbow multi colour that it doesn't affect. |
@rospogrigio, @postlund it could be great to give access to set DP via an HA service. This may help users using that as workaround for non standard implementation. |
I don't know if it would be of any help. |
The goal is to give you the ability to choose the mode. |
@ultratoto14 Yes, we should have a set-service of some sort. That was part of my "debug"-PR a while back, but I decided to scrap that and aimed for a set-service instead. Unless you want to give it try to implement, I can try to do it when I have some time. Should be fairly simple. |
@postlund great, at the moment, i just have time to write messages, no real time to dev, but it's great to ear you. |
Hi, hopefully not pushing anyone here, appreciate the replies. Say if I left it in Mode 1, which is just a single colour. Is there I could alter the brightness and colour from HA? I set colour to 107 as well as a test, but HA logs keep asking to set color_mode, ever value i put in there either makes the light unavailable or results in an error of unknown DPS. If I need to wait or its not possible thats fine. |
@memphisraynz what is your HA config for the light ? |
Hi,
I had been playing with the colour and mode, but disabled with because they throw errors |
When you put in single color mode, you can change the color with the tuya app ? What are the changing DP, did you give the full dump ? We need more data, we think about putting in place a device database to implement different devices like yours but at the moment, it may not be possible to support yours as it is so different. |
Hi, ########### **** deviceInfo returned OK **** TuyaDebug (Tuya DPs dump) [1.0.0] Device xxx at 192.168.1.119 key xxx protocol 3.3 dev_type type_0a: I figured that the colour must be a subset of one of the other DPs. Thanks for your time so far. |
Out of curisosity I changed; |
Sorry for spamming. |
This integration does not support your kind of device, i know it's frustrating but do not try to change DP ids to whatever, it will not work. What we need is completely picture of the data to understand how it works and then change the necessary code. For the moment, the supported tuya lights uses: id: 4 # This is usually true/false value indicating a switch
color_mode: 21 # this contains the hardcoded values "white","colour","scene" or "music"
brightness: 22 # this contains a value to control the brightness of the white color, two kind are managed "25-255" and "10-1000"
color_temp: 23 # this is the white color temp, this uses the same range as brightness
color: 24 # this is the color value, two kind of encoding supported, 12 char length pure HSV, 14 char length RGB and HSV
brightness_lower: 29 # this is setting up the min value for brigthness
brightness_upper: 1000 # this is setting up the max value for brigthness, and should respect DP 22 range
color_temp_min_kelvin: 2700 # this values are used to map the min and max mired for the color temp
color_temp_max_kelvin: 6500 #
scene: 25 # this is work in progress, i do not recommend to use them. So your device cannot be mapped, somewhere, you should have a DP with the chosen color stored. I do not know how you got your device key but if you have tuya-cli, you can try also with it :
Check if you have the same results as with test.py. |
Hi, |
So from what i've manage to establish. DPS [1] - Power For the scene, is it possible to allow for custom entries? |
Not for the moment, we plan to build a db with known devices data and scenes will be there to enhance the integration, but it will take time. |
Hello @memphisraynz, @postlund just merged a PR with a service to set the dp #236. id: 1
brightness: 107
brightness_lower: 10
brightness_upper: 64 Then, define an input select with the scene numbers or scene names, and add an automation that use the service to set the DPS 101 based on that input select. |
Hey thanks so much. |
I read the PR and replaced the init file wiht the new one and have the service available. My sons asleep now so I probably shouldn't play with it right now. |
Sorry to be a pain, I can't work out what needs to be added to the service call from reading the .py file. |
You can check here |
So really good results. I am able to change mode/scene using set_dp (101) |
Try to set your device to known colour with the app and get the DP values for let say red blue green. We can try decoding then |
Do you know how to use postman ? |
Funnily the colour 109, doesn't show when running test-py or tuya cli. It only showed when viewing the logs when using tuyagateway. The app only has a slider for colour, i'll see if I can get close to raw colours like reb blue green. Im familiar with postman, not the greatest but i use it occasionally. |
Hi @memphisraynz you can then try that if you have an iot.tuya trial account : Postman There is a postman collection which can let you call cloud APIs. You need to setup these environment variables:
{
"code": "colour_data_v2",
"value": "{\"h\":329,\"s\":1000,\"v\":1000}"
} It may help |
Cheers, |
Or maybe do you have also the color displayed in tuya app ? In that case, can you do a screenshot and get the RGB value of the 7gD using whatever picture editor ? |
Used your idea. To show you what Im working with: https://photos.app.goo.gl/MXHdXhVbyfd5W7hR9 |
While trying to set brightness at the moment, using the latest commits give an error. |
About
About the brightness issue. It's weird, do you have a stack trace in your logs. In the light the len is only used when the device supports color (meaning color dp have been set). |
The config at the moment is only Is this what your want? `Logger: homeassistant.components.websocket_api.http.connection [140490302897264] object of type 'NoneType' has no len() |
Are you sure you're on the last master version, line 303 is not the same as your stack |
I've just re downloaded the master branch and copied it over the existing install. I'll test in the morning once my boy is awake |
After a bit of stuffing around in postman I managed to get the device info. { From above the only things I've changed are what looks to be private info to xxx. The query {{url}}/v1.0/devices/{{device_id}}/status give just as little |
When I force dps 109 as colour_mode in the config I end up with the following error. |
@memphisraynz thanks for the tests. Do not try to force the color_mode or color config as your device is working differently and you will only get exception and even unavailable device. |
Cheers, I've removed the colour settings from the config. |
@memphisraynz did you try to change the DP 109 using the new service with a known value ? |
I did try and set the value using set_dp but nothing happened. |
Hi all, Please let me know what you need. I know Postman, etc but certainly don't know much about the TUYA API or how it works given I only installed this a few hours ago. Maybe there is a site/page I haven't found to explain how to decode it? I note that @memphisraynz is getting a My lights are both ARLEC from BUNNINGS (in Australia).
Random one while I'm here - Is there a site like the Tasmota Blakaddar Templates that lists device entities that you could copy and place into HA configs for localtuya... If not, maybe that can be a project for me after we get this working 😆 Device Information
{
"result": {
"active_time": 1641298195,
"category": "dc",
"category_name": "String Lights",
"create_time": 1641298195,
"gateway_id": "",
"icon": "smart/icon/ay1536534747810ekKBj/d0e71c1dec28c97d0d068504258efde5.png",
"id": "{ID_REMOVED}",
"ip": "159.196.159.232",
"lat": "-33.8834",
"local_key": "{KEY_REMOVED}",
"lon": "151.2027",
"model": "LVE1021HA VY",
"name": "RGB Bud Lights",
"online": true,
"owner_id": "{OWNER_REMOVED}",
"product_id": "lrkijachzdqxszbl",
"product_name": "LVE1021HA",
"sub": false,
"time_zone": "+11:00",
"update_time": 1641298209,
"uuid": "{UUID_REMOVED}"
},
"success": true,
"t": 1641302072361
} Specification of the Device
{
"result": {
"category": "dc",
"functions": [
{
"code": "switch_led",
"desc": "{}",
"name": "开关",
"type": "Boolean",
"values": "{}"
},
{
"code": "work_mode",
"desc": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}",
"name": "模式",
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
},
{
"code": "bright_value",
"desc": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}",
"name": "亮度值",
"type": "Integer",
"values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "temp_value",
"desc": "{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}",
"name": "冷暖值",
"type": "Integer",
"values": "{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "colour_data",
"desc": "{\"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}}",
"name": "彩光",
"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": "countdown",
"desc": "{\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}",
"name": "倒计时剩余时间",
"type": "Integer",
"values": "{\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "music_data",
"desc": "{\"maxlen\":255}",
"name": "音乐灯",
"type": "String",
"values": "{\"maxlen\":255}"
},
{
"code": "control_data",
"desc": "{\"maxlen\":255}",
"name": "调节",
"type": "String",
"values": "{\"maxlen\":255}"
}
],
"status": [
{
"code": "switch_led",
"name": "开关",
"type": "Boolean",
"values": "{}"
},
{
"code": "work_mode",
"name": "模式",
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
},
{
"code": "bright_value",
"name": "亮度值",
"type": "Integer",
"values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "temp_value",
"name": "冷暖值",
"type": "Integer",
"values": "{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "colour_data",
"name": "彩光",
"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": "countdown",
"name": "倒计时剩余时间",
"type": "Integer",
"values": "{\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
}
]
},
"success": true,
"t": 1641302341906
} Instruction Set of the Device
{
"result": {
"category": "dc",
"functions": [
{
"code": "switch_led",
"desc": "switch led",
"name": "switch led",
"type": "Boolean",
"values": "{}"
},
{
"code": "work_mode",
"desc": "work mode",
"name": "work mode",
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
},
{
"code": "bright_value",
"desc": "bright value",
"name": "bright value",
"type": "Integer",
"values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "temp_value",
"desc": "temp value",
"name": "temp value",
"type": "Integer",
"values": "{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "colour_data",
"desc": "colour data",
"name": "colour data",
"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": "countdown",
"desc": "countdown",
"name": "countdown",
"type": "Integer",
"values": "{\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "music_data",
"desc": "music data",
"name": "music data",
"type": "String",
"values": "{\"maxlen\":255}"
},
{
"code": "control_data",
"desc": "control data",
"name": "control data",
"type": "String",
"values": "{\"maxlen\":255}"
}
]
},
"success": true,
"t": 1641302298455
} |
I too would like to find out if this has gone anywhere. I have a set of Cafe Lights that I'd like to get working beyond on/off. Product: https://byjasco.com/enbrighten-wifi-seasons-color-changing-classic-led-cafe-lights-48ft-black-cord Also a DJ device:
Specifications:
Functions:
I'm new to all this but happy to provide any additional requested information. |
Is there any kind of bounty program for this project? I'll happily support getting this fixed. |
I have just purchased a set of strings lights (https://www.bunnings.com.au/arlec-rgb-colour-changing-grid-connect-smart-160-led-ball-lights_p0180228)
I have gone through the process and started trying to set them up in HA.
I am struggling to work out how to set them up, hoping you may be able to point me in the right direction.
Through the Smart Life app they can;
-Change colour
-Change brightness
-Change mode ( single colour, multiple colours, flashing.... 7 modes in total)
I couldn't work out how to do anything other than power on and off.
I performed a DP dump and worked out what the DP's do;
DPS [1] VALUE [False] (Power)
DPS [101] VALUE [1] (Mode 1-7)
DPS [107] VALUE [64] (Brightness 10-64)
DPS [108] VALUE [10] (Doesn't change)
any direction woul be great, thank you
The text was updated successfully, but these errors were encountered: