Make WLED controlled leds fade in or fade out

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.

Not sure if it helps, but a while ago i wrote a
Soft starter for NodeRed,
It will be easy to adjust the steps/timer :wink:

Very much appreciated!
I guess I’m gonna try and learn to use NodeRed, I’d been putting it off, but seems as good a time as any to jump in.
Suggestions of helpful resources welcome.

i suggest Google? :thinking:

1 Like