Skip to content
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

Change light transition duration #292

Open
madjam002 opened this issue Jan 2, 2021 · 5 comments
Open

Change light transition duration #292

madjam002 opened this issue Jan 2, 2021 · 5 comments

Comments

@madjam002
Copy link

When turning a light on/off or changing the colours, different manufacturers seem to use different transition durations.

My Lvwit bulbs turn on/off instantly, but changing colours seems to take around 400ms.
Whereas my Aisirer bulbs turn on/off and change colour a lot slower (seems like around 800-1000ms).

It would be good if there was a way to configure a default transition duration, plus respect Home Assistant's turn_on/turn_off transition parameter. I've opened this issue to track this desired behaviour to see if anyone else is interested.

In terms of implementation, I'm new to decoding the Tuya DPS parameters, but it doesn't look like there is a way to configure the transition time using DPS parameters. I imagine the transition is defined in the MCU module itself as even when flashing the ESP chip with custom firmware the manufacturer transition is still present.

Instead I've been looking at the scene DPS parameter (following the conversation in #146), perhaps support for a transition duration could be implemented by using this instead. On my Aisirer bulb, the scene parameter is on DPS 25 and I've attempted to decode it.

Here is what I have found:

DPS 25: AA[BBCCDDEEEEEEEEEEEEFFFFFFFF]

AA: Appears to be the scene index that corresponds to which scene in the Tuya app the options will be saved under
e.g my app shows Night, Read, Working, Leisure, Soft, Colorful, Dazzling and Gorgeous. Night is 00, Read is 01, Working is 02, etc.

BB and CC: Transition time, where 28 appears to be the lowest value supported, 64 appears to be the highest that is configurable from the Tuya app, but 69 is the highest that I could get to function. 28 is the slowest transition speed, and 69 is the fastest. At first I thought they are different values, perhaps one is transition time and one is the time between colours before the transition starts, but after testing it seems as if it only works as a transition time and both BB and CC should be set to the same value.

DD: Transition mode. 00 is a static single colour that appears to use the default transition time from the MCU, 01 is "flash" which instantly sets the colour, 02 is "breath" which transitions between colours using the configured transition time above.

EE: Is the colour encoding, appears to be the same encoding as the colour DPS (mine is DPS 24). Should be all 0's when using white instead of colour.

FF: Appears to be white/warm white/cool white encoding. All 0's when using colours. I haven't decoded these values just yet.

Everything between the square brackets [] can be repeated to transition between multiple colours.

Using the above, it is possible to do some different transitions, for example (using 05 Colorful as the scene index):

05696901000003e801f400000000 - Instantly transition to red
0569690100f003e801f400000000 - Instantly transition to blue
05696902000003e801f400000000 - Fast transition to red
05282802000003e801f400000000 - Slow transition to red
0528280200000000000000000000 - Slow transition to off

I plan to spend some more time investigating, but using the above it seems like we are limited to the slowest and fastest transition time supported by parameters BB/CC. Setting it to 28 resulted in a transition of just over 1 second for me, and 69 was around 100ms.

@hmnd
Copy link

hmnd commented Jan 8, 2021

I was just looking at a way to set transition time and I would be very interested in having this implemented. Happy to help in any way I can.

@t0ny-peng
Copy link

Great finding! I'm also looking for a way to config the transition speed of mu Tuya light bulb.

@asasi83
Copy link

asasi83 commented Jun 10, 2021

Same here I need it for the aquarium so I can transition from daylight to night ... still no progress ill post if I manage to do something, @madjam002 thx for posting your findings m8!!!

@Thrasher2020
Copy link

I'd like to see this working too - I have a mix of lights in my living room and the Tuyas don't transition which makes the turn onoff look odd.

@dbullendsl
Copy link

Don't see any recent activity on this but thought I'd add my interest in getting transition settings working consistently with my Tuya bulbs.

SKULSHADY pushed a commit to SKULSHADY/localtuya that referenced this issue Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants