#Help Needed with Home Assistant Automation for WiZ Light Scene Setting

1 messages · Page 1 of 1 (latest)

clear cradle
#

Hi everyone,

I'm having trouble with a Home Assistant automation for my WiZ light strip. The automation is supposed to control the light strip with different actions based on button presses, but the scene setting isn't working as expected. Below is the code I'm using:

alias: Tasterautomatisierung Küche
description: Steuert die WiZ-Lichtleiste mit verschiedenen Aktionen.
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: 00e882aea1904b2a1b0c93ab9f25eb1b
      command: single
  - platform: event
    event_type: zha_event
    event_data:
      device_id: 00e882aea1904b2a1b0c93ab9f25eb1b
      command: double
  - platform: event
    event_type: zha_event
    event_data:
      device_id: 00e882aea1904b2a1b0c93ab9f25eb1b
      command: hold
condition: []
action:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ trigger.event.data.command == 'single' }}"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: light.kuchenbeleuchtung
                    state: "on"
                sequence:
                  - service: light.turn_off
                    target:
                      entity_id: light.kuchenbeleuchtung
              - conditions:
                  - condition: state
                    entity_id: light.kuchenbeleuchtung
                    state: "off"
                sequence:
                  - service: light.turn_on
                    target:
                      entity_id: light.kuchenbeleuchtung
                    data:
                      brightness: 255
                      scene_id: 11  # Warmweiß (Scene ID 11)
      - conditions:
          - condition: template
            value_template: "{{ trigger.event.data.command == 'double' }}"

#

        sequence:
          - service: light.turn_on
            target:
              entity_id: light.kuchenbeleuchtung
            data:
              brightness: 255
              scene_id: 12  # Tageslicht (Scene ID 12)
      - conditions:
          - condition: template
            value_template: "{{ trigger.event.data.command == 'hold' }}"
        sequence:
          - service: light.turn_on
            target:
              entity_id: light.kuchenbeleuchtung
            data:
              brightness: 50
mode: single

I've tried various adjustments, but nothing seems to work. Any advice or suggestions would be greatly appreciated!

Thanks in advance!

mental raven
#

Hi all, I've got the same issue and wasn't able to solve it so far, any possible solutions?

plush imp
#

According to the light.turn_on documentation in Dev Tools > Actions, scene_id is not a valid option for this action.

clear cradle
#

Over developertools you can see this, if you filter to your entitiy

#

And there you can see a effect_list where you can choose the right effect.

effect_list: Ocean, Romance, Sunset, Party, Fireplace, Cozy, Forest, Pastel Colors, Wake up, Bedtime, Warm White, Daylight, Cool white, Night light, Focus, Relax, True colors, TV time, Plantgrowth, Spring, Summer, Fall, Deepdive, Jungle, Mojito, Club, Christmas, Halloween, Candlelight, Golden white, Pulse, Steampunk, Rhythm

#

they are the same like in the app

mental raven
#

Thanks, already saw that, but did you use a scene or a script to switch to the effect mode?
The effect: ocean is stored in the scene, but it does not apply

clear cradle
#
alias: Tasterautomatisierung Küche
description: Steuert die WiZ-Lichtleiste mit verschiedenen Aktionen.
triggers:
  - event_type: zha_event
    event_data:
      device_id: 00e882aea1904b2a1b0c93ab9f25eb1b
      command: single
    trigger: event
  - event_type: zha_event
    event_data:
      device_id: 00e882aea1904b2a1b0c93ab9f25eb1b
      command: double
    trigger: event
  - event_type: zha_event
    event_data:
      device_id: 00e882aea1904b2a1b0c93ab9f25eb1b
      command: hold
    trigger: event
conditions: []
actions:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ trigger.event.data.command == 'single' }}"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: light.kuchenbeleuchtung
                    state: "on"
                sequence:
                  - target:
                      entity_id: light.kuchenbeleuchtung
                    action: light.turn_off
                    data: {}
              - conditions:
                  - condition: state
                    entity_id: light.kuchenbeleuchtung
                    state: "off"
                sequence:
                  - target:
                      entity_id: light.kuchenbeleuchtung
                    data:
                      brightness: 255
                      effect: Warm White
                    action: light.turn_on

#
      - conditions:
          - condition: template
            value_template: "{{ trigger.event.data.command == 'double' }}"
        sequence:
          - target:
              entity_id: light.kuchenbeleuchtung
            data:
              brightness: 255
              effect: Daylight
            action: light.turn_on
      - conditions:
          - condition: template
            value_template: "{{ trigger.event.data.command == 'hold' }}"
        sequence:
          - target:
              entity_id: light.kuchenbeleuchtung
            data:
              brightness: 50
            action: light.turn_on
mode: single
#

have to seperate it because of the 2k limitation of discord