I have a D1 Mini running WLED controlling a short strip of WS2812B LEDs set up next to my bed.
WLED has a “nightlight” feature which makes the lights fade out over a set period of time which is cool and works well, I like to set it to red and activate nightlight mode when I’m going to sleep.
I’d like to do the opposite in the morning, at a particular time the light will turn on blue and increase in brightness to 100% over a period of time, such as 30 minutes.
I’ve tried to do this as an automation, and also as a script, but I’m a bit stuck and hoping someone could help.
First, I guess I need to know if the best way to do this is with an automation or a script?
Here is my current code for the script I’m trying to make work.
bedside_light_fade_up:
alias: Bedside Light fade up 20
mode: single
sequence:
- data:
brightness_pct: 5
rgb_color:
- 0
- 0
- 255
entity_id: light.wled_bedside_k
service: light.turn_on
- delay: 10 seconds
- data:
brightness_pct: 50
rgb_color:
- 0
- 0
- 255
entity_id: light.wled_bedside_k
service: light.turn_on
- delay: 10 seconds
- data:
brightness_pct: 80
rgb_color:
- 0
- 0
- 255
entity_id: light.wled_bedside_k
service: light.turn_on
When I run this script, the light turns on to 5% but nothing else happens, I’m stumped as to how to fix this.