WiZ light bulbs issue with effect in scene

Hi, been on HA for a month+, learned alot in here. Thanks for sharing and helping.

First, did I find an issue?

When I create a scene with 4 wiz reflector lights (might happen with just one), it doesn’t save the effect selected.

  1. Create scene
  2. Add device wiz light
  3. Click device name
    (change/select color and white works)
  4. Select effect
  5. Choose Christmas, for example
  6. Close with top left X or back button in browser
  7. Click save scene
  8. Click device name
  9. Effect is still selected correctly
  10. Go back
  11. Exit scene
  12. Open scene
  13. Click device name
    Effect is not selected

Also, I opened the yaml configuration file and effect is either blank or removed. Hmm I believe it is saved in yaml file at step 7.

Where is the official place to report such an issue ?

Second,
If I was to create an automation/script to produce my own “effect”, which would probably have to run in a “loop” for an extended period of time, what would be the leanest approach for the server. I would also like for the lights to not be synchronized.

My first thought is to use timers or time/timedelta helpers for each bulbs and trigger an automation based on that. I would use trigger id’s to change colors and what not on the corresponding bulb.

Hmm, I would also need a way out. If I want to apply a different scene, I would need to stop the current running automated process.

Anybody did something like that?

Or, just thinking, I create multiple/many color scene for each bulb, no, all the bulbs. Then I change scene randomly at random time interval using only one timer/time helper.

Well, writing it down gives me some ideas. I still need a way out.

Maybe the way out is my best friend the Toggle helper. I would start/stop everything and skip the last few active timers/time with that too. Hmm, could I have an automation triggered by a scene activation? I’ll check that. I could use that to Toggle my helper automatically.

Let me know if you have better idea or how to fine tune these.

I’ll let you know which way I went and/or tried.

This must be due to an recent update as I used to have a old scene with an effect that worked. When updating it a few days ago it exactly shows the behavior you describe above…

Good to know somebody else can reproduce this.

I actually found a workaround. You can trigger an automation with your scene activation and then set the effect manually…

alias: TV Light
description: “”
triggers:

  • trigger: state
    entity_id:
    • scene.livingroomnightlight
      to: null
      conditions:
      actions:
  • action: light.turn_on
    metadata: {}
    data:
    effect: Night light
    target:
    device_id:
    - 8d0a38aec5e249c59032bb5412e75c27
    - 1e7c9da2ece7636f3c7afb1e37efdd2d
    - ca8eb1832d603d043c310789a0b0d97b
    - 6df2b8b8da4e5062c5cf7582eba7aa7c
    mode: single
1 Like

Thanks, that’s an option.

I decided to move all my scenes into a script. I have setup my own random timer and color changing themes. I just haven’t found a way to fade in fade out. Just broke the screen of my phone today. Hard to correct text and stuff.

Right now, I’ve come to realize that I can’t call a script recursively. In the example below, season will call scene Standard or Christmas or St-Patrick. I have a solution for this. Don’t think it’s complicated but keep this in mind, for anyone using this.

First time posting code. I’ll comeback to fix it if I didn’t do it the right way. Just not tonight.

alias: Deck Scenes
sequence:
  - variables:
      Day: "{{ scene_name == 'Day' }}"
      Night: "{{ scene_name == 'Night' }}"
      Standard: "{{ scene_name == 'Standard' }}"
      Season: "{{ scene_name == 'Season' }}"
      Christmas: "{{ scene_name == 'Christmas' }}"
      Patrick: "{{ scene_name == 'St-Patrick' }}"
      isChristmasOn: "{{ is_state('input_boolean.deck_wiz_scene_christmas','on')}}"
      isPatrickOn: "{{is_state('input_boolean.deck_wiz_scene_st_patrick','on')}}"
      isThemeOn: "{{ isChristmasOn or isPatrickOn}}"
  - alias: Clean Up WiZ Season Themes
    choose:
      - conditions:
          - condition: template
            value_template: "{{ Standard and isThemeOn}} "
        sequence:
          - action: input_boolean.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.deck_wiz_scene_christmas
            alias: Turn Off Custom Scene Christmas
          - alias: Turn Off Custom Scene St-Patrick
            action: input_boolean.turn_off
            metadata: {}
            data: {}
            target:
              entity_id:
                - input_boolean.deck_wiz_scene_st_patrick
        alias: Apply Standard over Season Theme
      - conditions:
          - condition: template
            value_template: "{{ isThemeOn and Patrick and not isPatrickOn }}"
        sequence:
          - action: input_boolean.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.deck_wiz_scene_christmas
            alias: Turn Off Custom Scene Christmas
        alias: Apply Different Season Theme
      - conditions:
          - condition: template
            value_template: "{{ isThemeOn and Christmas and not isChristmasOn }}"
        sequence:
          - alias: Turn Off Custom Scene St-Patrick
            action: input_boolean.turn_off
            metadata: {}
            data: {}
            target:
              entity_id:
                - input_boolean.deck_wiz_scene_st_patrick
        alias: Apply Different Season Theme
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ Day }}"
        sequence:
          - action: light.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: light.deck_wiz_potlights
        alias: Day
      - conditions:
          - condition: template
            value_template: "{{ Night }}"
            alias: Night
          - condition: template
            value_template: >-
              {% set n = now() %} {{((n.hour == 21 and n.minutes <= 45) or
              n.hour < 21)}}
            alias: Before 21h45
        sequence:
          - action: script.turn_on
            metadata: {}
            data:
              variables:
                scene_name: Season
            target:
              entity_id: script.deck_scenes
            alias: "Deck Scene: Season"
        alias: Night
      - conditions:
          - condition: template
            value_template: "{{ Standard }}"
            alias: Standard
        sequence:
          - action: light.turn_on
            metadata: {}
            data:
              kelvin: 3044
            target:
              entity_id: light.deck_wiz_potlights
        alias: Standard
      - conditions:
          - condition: template
            value_template: "{{ Season }}"
            alias: Season
        sequence:
          - choose:
              - conditions:
                  - alias: Christmas
                    condition: template
                    value_template: >-
                      {% set n = now() %} {{ ((n.month == 12 and n.day >= 15) or
                      (n.month == 1 and n.day <= 7)) }}
                sequence:
                  - alias: "Deck Scene: Christmas"
                    action: script.turn_on
                    metadata: {}
                    data:
                      variables:
                        scene_name: Christmas
                    target:
                      entity_id: script.deck_scenes
                alias: Christmas
              - conditions:
                  - alias: St-Patrick
                    condition: template
                    value_template: >-
                      {% set n = now() %} {{ n.month == 3 and 15 <= n.day <= 17
                      }}
                sequence:
                  - alias: "Deck Scene: St-Patrick"
                    action: script.turn_on
                    metadata: {}
                    data:
                      variables:
                        scene_name: St-Patrick
                    target:
                      entity_id: script.deck_scenes
            default:
              - alias: "Deck Scene: Standard"
                action: script.turn_on
                metadata: {}
                data:
                  variables:
                    scene_name: Standard
                target:
                  entity_id: script.deck_scenes
        alias: Season
      - conditions:
          - condition: template
            value_template: "{{ Christmas }}"
        sequence:
          - action: input_boolean.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.deck_wiz_scene_christmas
        alias: Christmas
      - conditions:
          - condition: template
            value_template: "{{ Patrick }}"
        sequence:
          - action: input_boolean.turn_on
            metadata: {}
            data: {}
            target:
              entity_id:
                - input_boolean.deck_wiz_scene_st_patrick
        alias: St-Patrick
fields:
  scene_name:
    selector:
      select:
        options:
          - Day
          - Night
          - Standard
          - Season
          - Christmas
          - St-Patrick
          - Halloween
    name: Scene Name
    description: Select the scene to apply
    default: Default
description: ""
mode: parallel
max: 10
 

And this is the automation that is triggered when the scene Christmas is selected or activated…

alias: Deck WiZ PotLight Christmas
description: ""
triggers:
  - trigger: state
    entity_id:
      - input_boolean.deck_wiz_scene_christmas
    id: activate_scene
    to: "on"
  - trigger: state
    entity_id:
      - input_boolean.deck_wiz_scene_christmas
    id: stop_scene
    to: "off"
  - trigger: event
    event_type: timer.finished
    event_data:
      entity_id: timer.deck_wiz_potlight_1
    id: _1
  - trigger: event
    event_type: timer.finished
    event_data:
      entity_id: timer.deck_wiz_potlight_2
    id: _2
  - trigger: event
    event_type: timer.finished
    event_data:
      entity_id: timer.deck_wiz_potlight_3
    id: _3
  - trigger: event
    event_type: timer.finished
    event_data:
      entity_id: timer.deck_wiz_potlight_4
    id: _4
conditions: []
actions:
  - variables:
      huesat: "{{ ((0,100), (60, 100), (120,100), (180,100), (240,100), (300,100)) }}"
      rgb_colors: "{{ ( (255,0,0), (0,255,0), (0,0,255), (255,255,0), (255,255,230) )}}"
  - if:
      - condition: trigger
        id:
          - activate_scene
    then:
      - repeat:
          count: 4
          sequence:
            - action: timer.start
              metadata: {}
              data:
                duration: "1"
              target:
                entity_id: timer.deck_wiz_potlight_{{ repeat.index }}
    alias: Activate Scene
  - alias: Change Light Color if Scene is active
    if:
      - condition: state
        entity_id: input_boolean.deck_wiz_scene_christmas
        state: "on"
    then:
      - action: light.turn_on
        target:
          entity_id:
            - light.deck_wiz_potlights
        data:
          brightness_pct: 0
          transition: 3
        enabled: false
      - action: light.turn_on
        metadata: {}
        data:
          brightness_pct: 95
          rgb_color: "{{ rgb_colors[range(0,5) | random] }}"
        target:
          entity_id: light.deck_wiz_potlight{{ trigger.id }}
        enabled: true
      - action: light.turn_on
        target:
          entity_id:
            - light.deck_wiz_potlights
        data:
          brightness_pct: 95
          transition: 3
        enabled: false
      - action: timer.start
        metadata: {}
        data:
          duration: "{{ range(5,11) | random }}"
        target:
          entity_id: timer.deck_wiz_potlight{{ trigger.id }}
        enabled: true
mode: parallel
max: 10

Hope this gives an idea to somebody else.

I found this workaround to get wiz lighting effects to work in scenes. Once you make a scene with a wiz light, go in the code editor for the scene then remove the following lines from the entity:

 color_mode: color_temp
      brightness: 201
      color_temp_kelvin: 2702
      color_temp: 370
      hs_color:
      - 28.391
      - 65.659
      rgb_color:
      - 255
      - 166
      - 87
      xy_color:
      - 0.526
      - 0.387
      rgbw_color:

this works for me.