-
Notifications
You must be signed in to change notification settings - Fork 195
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
Trouble connecting to strip light #580
Comments
Yeah, I'd try using different versions. In order from most likely to work to least likely, try: 3.3 3.5 3.4 and 3.2 d = tinytuya.BulbDevice(DEVICEID, "192.168.1.19", DEVICEKEY, version=3.3)
print(d.status()) |
Aha, 3.5 works, just didn't see that version listed anywhere in my searches.
Turning off and on works, and so does setting a solid color. I assume that if I want to address individual leds I'll have to play with the payload?
|
If you're changing the color in a loop or something then adding d = tinytuya.BulbDevice(DEVICEID, "192.168.1.19", DEVICEKEY, version=3.5, persist=True) |
Kind of, was trying to find if I could custom animate it (to serve as some display ambient light)
Ah yeah I do have that. Seems to hang regardless if I change it faster than every 10ms. For slower times it takes considerably longer than "sleep time*iteration count", but it works. At that point its probably just my connection, the hardware or something of the sorts and not a library issue. |
I don't think even the app or cloud controls could move that fast. If you need quick transitions, you should look to scene settings (see https://github.com/jasonacox/tinytuya/blob/master/examples/bulb-scenes.py). It requires you to know in advance what color shape you want, but it will allow faster transitions. |
Music mode could be another option though I don't know if this particular device supports it. This device looks interesting so I went ahead and ordered one myself, should be here Monday. |
No worries, it was given as a gift so I figured I might as well toy with it.
Works well for what it is, though its probably a tad expensive. It does support music mode (if a bit shoddily due to the mic positioning), and then some: {
"modelId": "e1kem6ns",
"services": [
{
"actions": [],
"code": "",
"description": "",
"events": [],
"name": "",
"properties": [
{"abilityId": 20, "accessMode": "rw", "code": "switch_led", "description": "", "extensions": {"iconName": "icon-dp_power", "attribute": "643"}, "name": "Switch", "typeSpec": {"type": "bool"}},
{"abilityId": 21, "accessMode": "rw", "code": "work_mode", "description": "", "extensions": {"iconName": "icon-dp_mode", "attribute": "640"}, "name": "Mode", "typeSpec": {"type": "enum", "range": ["white", "colour", "scene", "music"]}},
{"abilityId": 24, "accessMode": "rw", "code": "colour_data", "description": "Type: String;\\nValue: 000011112222;\\n0000: H (Hue: 0-360, 0X0000-0X0168);\\n1111: S (Saturation: 0-1000, 0X0000-0X03E8);\\n2222: V (Brightness: 0-1000, 0X0000-0X03E8)", "extensions": {"iconName": "icon-yanse", "attribute": "512"}, "name": "Color Light", "typeSpec": {"type": "string", "maxlen": 255}},
{"abilityId": 26, "accessMode": "rw", "code": "countdown", "description": "", "extensions": {"iconName": "icon-dp_time2", "attribute": "640"}, "name": "Countdown", "typeSpec": {"type": "value", "max": 86400, "min": 0, "scale": 0, "step": 1, "unit": "s"}},
{"abilityId": 27, "accessMode": "wr", "code": "music_data", "description": "Type: String;\\nValue: 011112222333344445555;\\n0: Change method, 0 means direct output, 1 means gradual change;\\n1111: H (Hue: 0-360, 0X0000-0X0168);\\n2222: S (Saturation: 0-1000, 0X0000-0X03E8);\\n3333: V (Brightness: 0-1000, 0X0000-0X03E8);\\n4444: White light brightness (0-1000);\\n5555: Color temperature value (0-1000)", "extensions": {"iconName": "icon-dp_mic", "attribute": "640"}, "name": "Music Rhythm", "typeSpec": {"type": "string", "maxlen": 255}},
{"abilityId": 28, "accessMode": "wr", "code": "control_data", "description": "Type: String;\\nValue: 011112222333344445555;\\n0: Change method, 0 means direct output, 1 means gradual change;\\n1111: H (Hue: 0-360, 0X0000-0X0168);\\n2222: S (Saturation: 0-1000, 0X0000-0X03E8);\\n3333: V (Brightness: 0-1000, 0X0000-0X03E8);\\n4444: White light brightness (0-1000);\\n5555: Color temperature value (0-1000)", "extensions": {"iconName": "icon-setting", "attribute": "1024"}, "name": "Adjustment", "typeSpec": {"type": "string", "maxlen": 255}},
{"abilityId": 51, "accessMode": "rw", "code": "dreamlight_scene_mode", "description": "Specifically for the colorful light strip scene", "extensions": {"iconName": "icon-dp_mode", "attribute": "640"}, "name": "Colorful Scene", "typeSpec": {"type": "raw", "maxlen": 128}},
{"abilityId": 52, "accessMode": "rw", "code": "dreamlightmic_music_data", "description": "Specifically for the local music rhythm of the colorful light strip", "extensions": {"iconName": "icon-dp_mic", "attribute": "128"}, "name": "Colorful Local Music Rhythm", "typeSpec": {"type": "raw", "maxlen": 128}},
{"abilityId": 61, "accessMode": "rw", "code": "paint_colour_data", "description": "Specifically for dimming and coloring of the colorful light strip. The protocol only displays color light and color card mode. If the adjustment mode is white light, then byte 5 is 00 (paint bucket), bytes 6 and 7 are brightness, bytes 8 and 9 are color temperature;\\nIf the adjustment mode is a combination mode, then byte 5 is 00, bytes 6-11 are HSV.", "extensions": {"iconName": "icon-dp_circle", "attribute": "512"}, "name": "Color Mixing", "typeSpec": {"type": "raw", "maxlen": 128}}
]
}
]
} In any case my original issue is solved, so this would be fine to close. |
That property list is interesting, which endpoint did you grab them from? |
Saw it mentioned in an issue here and over at HA. In tuya's dev platform go to |
I have a device similar to the one described in this thread, and I've been working on a script to send commands with minimal sleep time between them. However, I've noticed that the device tends to go offline after a while, which disrupts the process. Here's a brief overview of what I've been doing: I'm using tinytuya to control the device. I generate the payload using the tinytuya function: payload = device.generate_payload(tinytuya.CONTROL, sorted_commands). After generating and sending the payload, I ping the device to check connectivity. Based on the ping time, I dynamically adjust the sleep interval for each command. Currently, I'm alternating between using the exact ping time for some commands and adding a small additional delay for others to maintain stability. Despite these measures, the device still goes offline occasionally. Has anyone found a reliable way to send commands with minimal delay without causing the device to disconnect? Any insights or suggestions would be greatly appreciated! Sorry if this is the wrong place to comment this. |
@CmdrAvegan can you give us the device name (and URL if you can) and version (e.g. 3.4)? I wish we knew the trick to make these more stable. I do wonder if there is a way to simulate this using the SmartLife app w/o it using the cloud. If it also causes the devices to become unstable, we confirm our suspicion that the local API is brittle on the 3.4 devices. If it doesn't, we should investigate to see if the app is doing something different (some new message?) that helps the devices remain stable. |
The device name is "Chasing Strip Light" it's using version 3.5 Here's the URL: https://www.feit.com/products/20-ft-smart-color-chasing-led-strip-light-tape20-chase Mapping:
|
Having some issues getting a LED strip to play with this library. The device seems completely unresponsive to anything but the app.
A normal scan returns 0 devices found. As for a force scan, it remains unmatched:
I know for a fact that this is the device I want to connect to, since the MAC address shown in
devices.json
matches the one fromIf I try to connect to it manually with the information from
devices.json
it also doesn't seem to work either. (Current Status: {'Error': 'Unexpected Payload from Device', 'Err': '904', 'Payload': None}
)Am I using the wrong device type? Are strip lights supported?
Device is: https://www.amazon.com/Lanmonlily-Corner-Million-Control-Bedroom/dp/B0DB1739S4
The text was updated successfully, but these errors were encountered: