RGB strip turns on before color change? (old color shows briefly)

I’m seeing an issue with turning on an RGB strip through an automaton. It seems as if Home Assistant is commanding the Tasmota controller to turn on, and then commands it to change the RGB color. For example, if the LEDs were previously red, and my automaton is set to turn them on in blue, the LED strip will turn on and will briefly be red before switching to blue.

Might there be a configuration issue here?

The YAML for the action is quite simple:

service: light.turn_on
data:
  rgb_color:
    - 0
    - 255
    - 0
  brightness: 255
target:
  device_id: 40a85e67fae76f87c908595877b90e34

I’ve tried to work around this by adding an initial command to the light to set a different color at brightness 0, followed by the same color at brightness 255, but that does not help.

Thanks!

What happens when you go to the Tasmota web interface for the device and turn it on with RGB settings from there? It could be a device limitation if you get the same issue.

In the Tasmota interface, if the LEDs are off, dragging the slider to a new color and dropping the slider will turn the lights on with the new color. No old color flashing observed.

The same holds true from the Tasmota’s web console. A command like Color #ff0000 will turn the LEDs on as red, with no flashing of the previous color.

I just did what I should have done at the start, and had a look at the MQTT messages. A turn on message looks like:
{"POWER":"ON","Dimmer":100,"Color":"FF0000","HSBColor":"0,100,100","Channel":[100,0,0]}

So, presumably this is a Tasmota issue, not a Home Assistant issue. Sorry to waste your time, @parautenbach , but your question did (indirectly) help me find where to look next. :slightly_smiling_face:

Having looked further into this, it appears that it is a Home Assistant issue. I’ve filed a bug report.

It appears that Home Assistant sends the commands to the Tasmota device in the incorrect order. It will send a command like NoDelay;Dimmer 100;NoDelay;HsbColor1 0;NoDelay;HsbColor2 100, where the Dimmer command comes first. If this command is reordered to NoDelay;HsbColor1 0;NoDelay;HsbColor2 100;NoDelay;Dimmer 100 and posted to the MQTT command topic, the LEDs will turn on with the correct color.

Anyway, thanks again, @parautenbach . Your answer, and then my investigations while writing a follow-up post, led to the actual problem.

1 Like

Not at all! You uncovered important things here.

BTW, a workaround for now would be to publish your own MQTT message with an MQTT switch.

1 Like

Ah, that is interesting. I haven’t seen the MQTT switch. I’ll have to look into it!

Thanks!

1 Like