Replies: 5 comments 2 replies
-
Hello bdf0506 and Jason! Jason Pardon the intrusion please. Great point and i gave up on the cloud API for color brightness adjustment. You can adjust brightness when white is the color.I am using cloud control not local tinytuya control.In Python i was going to try to convert HSV to HSL, adjust brightness then send it back as HSV to the device.IDK maybe Jason has an answer for this with their cloud section.Tuya API website in the device debug, as you pointed out brightness doesn't work in the debug screen. I am not currently using tinytuya with local IP addressing i am talking to the API cloud. Developed node server as a Plugin to Universal Devices home automation platform. Wanted to use tinytuya however calling devices from a stored json file I could not get to work without some customer human intervention.Highest Regards! On Oct 30, 2023, at 9:35 AM, bdf0506 ***@***.***> wrote:
I have a Tuya device that is ONLY using a hsv string for color + brightness. I'm unable to pass an integer for brightness to the device. Given that I don't always know what the current color is, without a complicated script, I'm trying to figure out a way where I can leave the bulb's color as is and only affect the brightness level.
For example, when I run a listener, this is what it shows. On the Tuya app all I did was change the brightness level, and the last 3 digits of the hex code change, and that's it.
Received Payload: {'protocol': 4, 't': 1698683535, 'data': {'dps': {'5': '00ef03e801c2'}}, 'dps': {'5': '00ef03e801c2'}}
Received Payload: {'protocol': 4, 't': 1698683539, 'data': {'dps': {'5': '00ef03e8021c'}}, 'dps': {'5': '00ef03e8021c'}}
Received Payload: {'protocol': 4, 't': 1698683544, 'data': {'dps': {'5': '00ef03e80280'}}, 'dps': {'5': '00ef03e80280'}}
For comparison, changing color but not changing brightness would give me this:
Received Payload: {'protocol': 4, 't': 1698683637, 'data': {'dps': {'5': '012d03e80280'}}, 'dps': {'5': '012d03e80280'}}
Received Payload: {'protocol': 4, 't': 1698683638, 'data': {'dps': {'5': '00ae03e80280'}}, 'dps': {'5': '00ae03e80280'}}
Received Payload: {'protocol': 4, 't': 1698683639, 'data': {'dps': {'5': '005e03e80280'}}, 'dps': {'5': '005e03e80280'}}
Within the Device Debugging panel of Tuya cloud, this is what I see for this bulb control:
I can't even get tinytuya to change the color properly (as it seems like it produces a hex code that is out of value or can't really be interpreted by the device), but for now, i'm looking for a way to get the brightness taken care of as that is more important to me. It appears this may be a "newer" way that Tuya bulbs might process colors and brightness levels moving forward.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi @bdf0506 - what bulb are you using? Can you send a link?
This looks more like a 3.1 SmartBulb device (Type "A"): https://github.com/jasonacox/tinytuya#version-31---light-type-rgb
The There is a Type C that uses DPS 2 for brightness, but that doesn't seem to line up with what you see. See code here. Can you check to see what bulb Type tinytuya is detecting? print(d.bulb_type) If the issue is how d.set_value(5,"00ef03e801c2") If we can figure out what is going wrong, we can explore adding code to |
Beta Was this translation helpful? Give feedback.
-
This is the device: https://www.amazon.com/dp/B099RSXLGH It is detecting it as bulb type A. In order to get it to respond, I had to set to version to 3.4. If I manually set it via something like I think the problem here is that it is type A, but it is expecting: I don't believe that the s and v ranges are valid for a type A bulb, these appear to be valid ranges for a type B bulb. tinytuya/tinytuya/BulbDevice.py Lines 126 to 127 in b18c444 |
Beta Was this translation helpful? Give feedback.
-
Thanks for the Amazon link, mine will be here Thurs. From what you posted it does look like a "Type B" that uses "Type A" DPs. |
Beta Was this translation helpful? Give feedback.
-
Hmm, I'm on the fence about modifying BulbDevice to support this. It does contain a bulb-like device, but it also has a bunch of other stuff. DPs 3-6 control the light portion of the device while 1, 8-20, and 101-105 control the other functions. DP 3 is the on/off switch
@jasonacox what do you think, modify BulbDevice or create new device? |
Beta Was this translation helpful? Give feedback.
-
I have a Tuya device that is ONLY using a hsv string for color + brightness. I'm unable to pass an integer for brightness to the device. Given that I don't always know what the current color is, without a complicated script, I'm trying to figure out a way where I can leave the bulb's color as is and only affect the brightness level.
For example, when I run a listener, this is what it shows. On the Tuya app all I did was change the brightness level, and the last 3 digits of the hex code change, and that's it.
For comparison, changing color but not changing brightness would give me this:
Within the Device Debugging panel of Tuya cloud, this is what I see for this bulb control:

I can't even get tinytuya to change the color properly (as it seems like it produces a hex code that is out of value or can't really be interpreted by the device), but for now, i'm looking for a way to get the brightness taken care of as that is more important to me. It appears this may be a "newer" way that Tuya bulbs might process colors and brightness levels moving forward.
Beta Was this translation helpful? Give feedback.
All reactions