Scene transition not obeying transition duration (athom tasmota light bulbs)

Hello,

I am trying to switch gradually between two scenes several times, as a visual signal to take out the bins. Different coloured lights will pulse according to the day, at certain times.

Scene transition, configured via UI, does not work correctly out of the box in my case. Instead of smoothly transitioning, the lights flick rapidly between the scenes.

The scenes control two Athom 15w bulbs pre-flashed with Tasmota and running Tasmota 11 (code copied from scenes.yaml, configured in UI):

- id: '1649346452151'
  name: Lounge Lights - Bins Wed1
  entities:
    light.islandnorth:
      min_mireds: 153
      max_mireds: 500
      effect_list:
      - None
      - Wake up
      - Cycle up
      - Cycle down
      - Random
      supported_color_modes:
      - color_temp
      - hs
      color_mode: hs
      brightness: 71
      hs_color:
      - 60
      - 100
      rgb_color:
      - 255
      - 255
      - 0
      xy_color:
      - 0.444
      - 0.517
      effect: None
      friendly_name: Island North
      supported_features: 36
      state: 'on'
    light.island_south:
      min_mireds: 153
      max_mireds: 500
      effect_list:
      - None
      - Wake up
      - Cycle up
      - Cycle down
      - Random
      supported_color_modes:
      - color_temp
      - hs
      color_mode: hs
      brightness: 69
      hs_color:
      - 30
      - 100
      rgb_color:
      - 255
      - 127
      - 0
      xy_color:
      - 0.612
      - 0.374
      effect: None
      friendly_name: Island South
      supported_features: 36
      state: 'on'
  icon: mdi:delete
- id: '1649346504459'
  name: Lounge Lights - Bins Wed2
  entities:
    light.islandnorth:
      min_mireds: 153
      max_mireds: 500
      effect_list:
      - None
      - Wake up
      - Cycle up
      - Cycle down
      - Random
      supported_color_modes:
      - color_temp
      - hs
      color_mode: hs
      brightness: 56
      hs_color:
      - 15
      - 100
      rgb_color:
      - 255
      - 63
      - 0
      xy_color:
      - 0.677
      - 0.319
      effect: None
      friendly_name: Island North
      supported_features: 36
      state: 'on'
    light.island_south:
      min_mireds: 153
      max_mireds: 500
      effect_list:
      - None
      - Wake up
      - Cycle up
      - Cycle down
      - Random
      supported_color_modes:
      - color_temp
      - hs
      color_mode: hs
      brightness: 66
      hs_color:
      - 60
      - 100
      rgb_color:
      - 255
      - 255
      - 0
      xy_color:
      - 0.444
      - 0.517
      effect: None
      friendly_name: Island South
      supported_features: 36
      state: 'on'
  icon: mdi:delete

The following script (also UI configured) calls the two scenes on repeat:

sequence:
  - repeat:
      count: '25'
      sequence:
        - service: scene.turn_on
          data:
            transition: 300
          target:
            entity_id: scene.lounge_lights_bins_wed
        - service: scene.turn_on
          data:
            transition: 300
          target:
            entity_id: scene.lounge_lights_bins_wed2
mode: single
icon: mdi:delete
alias: Bins Wed

The result is a flickery mess.

As you can see, the transition time is 300 seconds, the max allowed in the UI field. I started at 3s, but ended up setting it this high to test if it made a difference to the flickering (it did seem to, but only by < 1 second).

Its perhaps worth noting that these bulbs do support transition between states when used directly on the entities via light.turn_on.

I’ve checked out the following posts, but they do not address the same use case (or are orphaned):

There’s nothing in my logs related to this script except an “Alexa: THROTTLING_EXCEPTION” which I assume is because of the high number of repeat executions.

Any ideas if this is a bug or a config issue? If confirmed as the former, I’ll post an issue.

Also, I’m still on 2022.3.7.

PS. This is my first topic post. HA user since 18th August 2021, enjoying the wild ride…

This Problem has long been with Tasmota and I solved it by writing my own template-based mqqt device integrations. I made the Tasmota team aware and offered them my code. They were to smug to actually acknowledge the problem and use the code.

the new Tasmota integration also does not solve this problem.

I am not using tasmota for lights any more, zigbee devices work with less effort and live longer. with zigbee you are of course limited to what the device firmware is able to do for blending colors. it was still worth the change for me.

Thanks for that. I was afraid of just this when I read the first post I linked above.

Do you think its worthwhile opening a githib issue against the Tasmota integration?
EDIT: Nevermind, see below.

Looks like this didn’t fix it either

If you are comfortable sharing any of your template code to get me started, that would be much appreciated.

I told you so :slight_smile:

Lets see, I’ll dig for the config.

As said before, I moved on to zigbee a long time ago. These configs are just some examples and did work fine back then, but now they may not work any more. Good luck.

 platform: mqtt
  # this assumes Tasmota options as follows: 4=0, 17=1, 59=1 (as implied by 59=1)
  name: rgb_cct_01
  schema: template
  availability_topic: "tasmota/room1/light1/tele/LWT"
  command_topic: "tasmota/room1/light1/cmnd/backlog"
  state_topic: "tasmota/room1/light1/tele/STATE"
  json_attributes_topic: "tasmota/room1/light1/tele/STATE"
  payload_available: "Online"
  payload_not_available: "Offline"
  command_on_template: >
    setoption20 1;
    {%- if brightness is defined -%}
    dimmer {{ brightness |round |int * 100 // 255 }}; 
    {%- endif -%}
    {%- if color_temp is defined -%}
    ct {{ color_temp |round |int }}; 
    {%- endif -%}
    {%- if (white_value is not defined or white_value==0) and red is defined and green is defined and blue is defined -%}
    color2 {{ red |round |int }}, {{ green |round |int }}, {{ blue |round |int }}; 
    {%- endif -%}
    {%- if transition is defined -%}
    fade 1; speed {{ transition |round |int * 2 }}; 
    {%- endif -%}
    {%- if effect is defined -%}
    scheme {{ effect |round |int }}; 
    {%- endif -%}
    power on 
  #      {%- if white_value is defined and white_value >0 -%}
  #      white {{ white_value |round |int * 100 // 255 }}; 
  #      {%- endif -%}
  command_off_template: >
    {%- if transition is defined -%}
    fade 1; speed {{ transition |round |int * 2 }}; 
    {%- endif -%}
    power off 
  state_template: "{{ value_json.POWER | lower }}" 
  brightness_template: "{{ value_json.Dimmer |round |int  * 255 // 100 }}"
  #    white_value_template: "{{ value_json.White |round |int * 255 // 100 }}"
  color_temp_template: "{{ value_json.CT |round |int }}"
  red_template: "{{ value_json.Color.split(',')[0] |round |int }}"
  green_template: "{{ value_json.Color.split(',')[1] |round |int }}"
  blue_template: "{{ value_json.Color.split(',')[2] |round |int }}"
  effect_template: "{{ value_json.Scheme | int }}"
  effect_list:
    - 0
    - 1
    - 2
    - 3
    - 4
  qos: 1
  retain: false
  optimistic: false
    
  - platform: mqtt
    # this assumes Tasmota options as follows: 4=0, 17=1, 59=1 (as implied by 59=1)
    name: rgbw_01
    schema: template
    availability_topic: "tasmota/room3/light2/tele/LWT"
    command_topic: "tasmota/room3/light2/cmnd/backlog"
    state_topic: "tasmota/room3/light2/tele/STATE"
    json_attributes_topic: "tasmota/room3/light2/tele/STATE"
    payload_available: "Online"
    payload_not_available: "Offline"
    command_on_template: >
      setoption20 1;
      {%- if brightness is defined -%}
      dimmer {{ brightness |round |int * 100 // 255 }}; 
      {%- endif -%}
      {%- if white_value is defined and white_value >0 -%}
      white {{ white_value |round |int * 100 // 255 }}; 
      {%- endif -%}
      {%- if (white_value is not defined or white_value==0) and red is defined and green is defined and blue is defined -%}
      color2 {{ red |round |int }}, {{ green |round |int }}, {{ blue |round |int }}; 
      {%- endif -%}
      {%- if transition is defined -%}
      fade 1; speed {{ transition |round |int * 2 }}; 
      {%- endif -%}
      {%- if effect is defined -%}
      scheme {{ effect |round |int }}; 
      {%- endif -%}
      power on 
#      {%- if color_temp is defined -%}
#      ct {{ color_temp |round |int }}; 
#      {%- endif -%}
    command_off_template: >
      {%- if transition is defined -%}
      fade 1; speed {{ transition |round |int * 2 }}; 
      {%- endif -%}
      power off 
    state_template: "{{ value_json.POWER | lower }}" 
    brightness_template: "{{ value_json.Dimmer |round |int  * 255 // 100 }}"
    white_value_template: "{{ value_json.White |round |int * 255 // 100 }}"
#    color_temp_template: "{{ value_json.CT |round |int }}"
    red_template: "{{ value_json.Color.split(',')[0] |round |int }}"
    green_template: "{{ value_json.Color.split(',')[1] |round |int }}"
    blue_template: "{{ value_json.Color.split(',')[2] |round |int }}"
    effect_template: "{{ value_json.Scheme | int }}"
    effect_list:
      - "0"
      - "1"
      - "2"
      - "3"
      - "4"
    qos: 1 
    optimistic: false

  - platform: mqtt
    # this assumes Tasmota options as follows: 4=0, 17=1, 59=1 (as implied by 59=1)
    name: rgb_cct_02
    schema: template
    availability_topic: "tasmota/room2/light2/tele/LWT"
    command_topic: "tasmota/room2/light2/cmnd/backlog"
    state_topic: "tasmota/room2/light2/tele/STATE"
    json_attributes_topic: "tasmota/room2/light2/tele/STATE"
    payload_available: "Online"
    payload_not_available: "Offline"
    command_on_template: >
      setoption20 1;
      {%- if brightness is defined -%}
      dimmer {{ brightness |round |int * 100 // 255 }}; 
      {%- endif -%}
      {%- if color_temp is defined -%}
      ct {{ color_temp |round |int }}; 
      {%- endif -%}
      {%- if (white_value is not defined or white_value==0) and red is defined and green is defined and blue is defined -%}
      color2 {{ red |round |int }}, {{ green |round |int }}, {{ blue |round |int }}; 
      {%- endif -%}
      {%- if transition is defined -%}
      fade 1; speed {{ transition |round |int * 2 }}; 
      {%- endif -%}
      {%- if effect is defined -%}
      scheme {{ effect |round |int }}; 
      {%- endif -%}
      power on 
#      {%- if white_value is defined and white_value >0 -%}
#      white {{ white_value |round |int * 100 // 255 }}; 
#      {%- endif -%}
    command_off_template: >
      {%- if transition is defined -%}
      fade 1; speed {{ transition |round |int * 2 }}; 
      {%- endif -%}
      power off 
    state_template: "{{ value_json.POWER | lower }}" 
    brightness_template: "{{ value_json.Dimmer |round |int  * 255 // 100 }}"
#    white_value_template: "{{ value_json.White |round |int * 255 // 100 }}"
    color_temp_template: "{{ value_json.CT |round |int }}"
    red_template: "{{ value_json.Color.split(',')[0] |round |int }}"
    green_template: "{{ value_json.Color.split(',')[1] |round |int }}"
    blue_template: "{{ value_json.Color.split(',')[2] |round |int }}"
    effect_template: "{{ value_json.Scheme | int }}"
    effect_list:
      - "0"
      - "1"
      - "2"
      - "3"
      - "4"
    qos: 1 
    optimistic: false

  - platform: mqtt
    # this assumes Tasmota options as follows: 4=0, 17=1, 59=1 (as implied by 59=1)
    name: rgb_cct_03
    schema: template
    availability_topic: "tasmota/room2/light4/tele/LWT"
    command_topic: "tasmota/room2/light4/cmnd/backlog"
    state_topic: "tasmota/room2/light4/tele/STATE"
    json_attributes_topic: "tasmota/room2/light4/tele/STATE"
    payload_available: "Online"
    payload_not_available: "Offline"
    command_on_template: >
      setoption20 1;
      {%- if brightness is defined -%}
      dimmer {{ brightness |round |int * 100 // 255 }}; 
      {%- endif -%}
      {%- if color_temp is defined -%}
      ct {{ color_temp |round |int }}; 
      {%- endif -%}
      {%- if (white_value is not defined or white_value==0) and red is defined and green is defined and blue is defined -%}
      color2 {{ red |round |int }}, {{ green |round |int }}, {{ blue |round |int }}; 
      {%- endif -%}
      {%- if transition is defined -%}
      fade 1; speed {{ transition |round |int * 2 }}; 
      {%- endif -%}
      {%- if effect is defined -%}
      scheme {{ effect |round |int }}; 
      {%- endif -%}
      power on 
#      {%- if white_value is defined and white_value >0 -%}
#      white {{ white_value |round |int * 100 // 255 }}; 
#      {%- endif -%}
    command_off_template: >
      {%- if transition is defined -%}
      fade 1; speed {{ transition |round |int * 2 }}; 
      {%- endif -%}
      power off 
    state_template: "{{ value_json.POWER | lower }}" 
    brightness_template: "{{ value_json.Dimmer |round |int  * 255 // 100 }}"
#    white_value_template: "{{ value_json.White |round |int * 255 // 100 }}"
    color_temp_template: "{{ value_json.CT |round |int }}"
    red_template: "{{ value_json.Color.split(',')[0] |round |int }}"
    green_template: "{{ value_json.Color.split(',')[1] |round |int }}"
    blue_template: "{{ value_json.Color.split(',')[2] |round |int }}"
    effect_template: "{{ value_json.Scheme | int }}"
    effect_list:
      - "0"
      - "1"
      - "2"
      - "3"
      - "4"
    qos: 1 
    optimistic: false

1 Like

Many thanks!