Creating and activating dynamic scenes with wled and playlist

I have a few WLED strips set around the house. I have managed successfully to create presets for them in the app, and they do show up in home assistant. One of the presets I have called “police” and I have it executed whenever my Alarmo smart home security is triggered.


Here is my script that is triggered by Alarmo:

alias: Alarm - Triggered action
sequence:
  - parallel:
      - metadata: {}
        data:
          scene_id: alarm_triggered_before_state
          snapshot_entities:
            - light.office_bed_wled
            - light.office_desk_wled
            - light.livingroom_cabinet_wled
            - light.diningroom_cabinet_wled
        enabled: true
        action: scene.create
      - metadata: {}
        data:
          target:
            - media_player.echo_hallway
          message: Alarm triggered! Possible intruder or apartment emergency!
        action: notify.alexa_media
  - metadata: {}
    data: {}
    action: light.turn_on
    target:
      entity_id:
        - light.office_bed_wled
        - light.office_desk_wled
        - light.livingroom_cabinet_wled
        - light.diningroom_cabinet_wled
  - target:
      entity_id:
        - select.wled_bed_preset
        - select.office_desk_wled_led_preset
        - select.livingroom_cabinet_wled_preset
        - select.diningroom_cabinet_wled_preset
    data:
      option: Police
    action: select.select_option
  - action: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: switch.closet_siren
mode: single
icon: mdi:alarm-light

Works like a charm. So far - perfect.

I create a BEFORE state for all my WLEDs called “alarm_triggered_before_state”

HOWEVER, when I stop the alarm I want all my WLEDs to go back to their previous state, before the alarm was triggered.

So this script is triggered:

alias: Alarm - Stopped action
sequence:
  - parallel:
      - action: switch.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: switch.closet_siren
      - metadata: {}
        data:
          target:
            - media_player.echo_hallway
          message: Alarm stopped! All security measurements have been deactivated!
        action: notify.alexa_media
      - metadata: {}
        target:
          entity_id: scene.alarm_triggered_before_state
        action: scene.turn_on
mode: single
icon: mdi:shield-home

Here comes the problem. I have no issues when the alarm is triggered and the correct effects are loaded and started into all WLEDs. BUT when I stop/cancel the alarm the WLEDs don’t go to their previous state (some that were OFF, became ON and some that were ON became OFF, and some were OK but the effect was still POLICE and not the one that was active before the script got triggered. And some get the right effect even but is much “faster” or “slower” or it blinks randomly unnaturally, like a bug.

So, is anybody here with more experience with WLEDs and creating dynamic scenes with them, so I can recall perfectly of WLED was ON or OFF and what effect was used before that and the right speed and etc.

Any help will be greatly appreciated! Thanks

Anyone? Does anybody has knowledge of this or is it new territory for everyone? WLED is so fun, especially with home assistant the possibilities are limitless. I hope someone can give me a hand on this one…

Hi Alex… I came across this post after searching for help on near enough the same matter. I’ve set up an Automation so that when my Front Doorbell picks up motion detection, my Wled lights perform an Alarm preset (red and blue flashing BPM) based on whether the lights were already on or off. I’m completely new to this so its take me ages to figure it out haha!
I did it as this…
I first created the scene ‘Alarm’ which was my Wled Light on Preset ‘Alarm’
Then Automation:
Create scene ‘scene.beginning’
Turn the the lights based on whether they’re on or off
Delay 1s (just so the lights were recognised properly)
Create another scene ‘scene.before’
Delay 1s
Activate ‘scene.alarm’
Delay for 10s
Activate ‘scene.before’ (so they went back to their original settings
Acivate 'scene.beginning (to make sure they either stay on or turn off)

It works great however I’ve found that the Wled lights remember the last effect, BUT not the last colour effect or speed so i’m kind of in the same boat as you!

If anyone knows a way this can be done i’d love to hear also…
after a lot of research i think i’ll just have to stick to a lamp on a solid colour rather than dynamic as the colour on my lamp goes back to what it was… must just be an led thing…
I think the only way round it would be if i kept my lights on a select preset and after the lights did the alarm mode, i could activate the select preset again… but i’m forever changing the different modes so thats not what i want haha!

1 Like

I still have not figure out anything in that matter. Maybe it is not very compatible with home assistant to that extend yet…