I was under the impression that the tosmata firmware for LED controllers would implement the transition parameter to create smooth dimming from one brightness value to another. I am using the Arilux LC01 Module flashed with Sonoff Tosmata firmware.
It seems that is not the case because brightness changes are instant.
Tried the following service call to light.turn_on as well, which was suggested here
Reading the Tosmata commands documentation, I found some interesting ones: fade - enable/disable fading speed - Transition speed when turning off, does not work reliably for turning on. works with power off command. power off uses the specified speed value, however, power on uses a shorter fade interval. I am not sure what vlaue it is using, though it appears to be relative to speed, but shorter.
The firmware maintains a dimmer variable which stores its value even when the device is turned off.
wakeup - turn on and fade to current dimmer value WakeupDuration - transition duration in seconds (like speed but for turning on) Sleep - sleeps controller, which causes choppyness in led fading, set to 0 (off)
Note: that Speed is not referring to wall clock time. If your controller sleeps for 250ms each cycle, then a 1s sleep setting will actually result in a “speed” of 4 seconds.
So the firmware does support smooth fading. Now to find a way to integrate it into Home Assistant.
In case you’re still looking to solve that.
At least in Tasmota 0.9 which I installed for a LED installment today, speed is a value between 0…20. This makes a very nice fade in/out. Happy with it!!
I’m not 100% if I use that code anymore, but it should be straight forward:
Fade 0 = do not use fade (default) 1 = use fade
See also SetOption91
and:
Speed 1..40 = set fade speed from fast 1 to very slow 40 + = increase speed - = decrease speed
The Speed value represents the time in 0.5s to fade from 0 to 100% (or the reverse). Example: Speed 4 takes 2.0s to fade from full brightness to black, or 0.5s to move from 75% to 100%.
That’s all needed.
EDIT: Yes. Just tested it. Set FADE 1 and SPEED 4 and it fades in/out for 2s.
For some reason, the Sonoff B1 RGB bulb fades twice. It looks like it fades the two white leds (warm and cool) separately and subsequently. Both for on and off. There is only a single MQTT command, I checked. So it must be in the Tasmota firmware, I conclude.