Read WLED effect using Automation

I have setup some basic automations for testing where when a PIR detects movement it will turn on an LED strip (controlled via WLED), set it to Red for 3 seconds, then turn it off again.

What I would like to do if it is already turned on though is to check what effect is being used (e.g. Colortwinkles), set it to to Red for 3 seconds, then set it back to the original pattern.

Is there any way I can do this?

You can do this using scene.create service. In your automations just add the first action as calling serivce scene,create. In the service data tab add this

scene_id: wled
snapshot_entities: light.wled

Please change the entity name to yours.

Then make the final action to call the service scene.turn_on and make the service data like below.

entity_id: scene.wled

This is restore the original state of the light including the effect. If you need any more help Please share the automation yaml.

That seems to be just the trick - thank you!

Just need to sort out slightly different automations now, depending on whether or not the lamp is already on when the automation is triggered.

2 Likes

sheminasalam I know this is 3 years old, but I stumbled on while researching the same thing and it works great! Thanks!