Home Assistant light transitions

So I am trying to transition light colors over a period of time and I'm not quite sure what would be the best way to do this. I was looking into this but I can seem to find a good example of it in use. Any advice or guidance would be helpful/

How much have you achieved so far?

Can you turn your light on/off from home Assistant?
Can you set a light to a single colour?
What kind of smart light is it?
Does this tutorial work for you?


The node-red-contrib-schedex node might satisfy your use case.

Here is an example of one way to use it. See the link provided above for a complete list of "named" times that are supported by the schedex node. Specific time (i.e. 23:15) may also be used to trigger an event in the schedex node.

I have a light by the carport door that comes on with 100% brightness at sunset (sunset: sun disappears below the horizon, evening civil twilight starts). At Night (night starts when it is dark enough for astronomical observations), the light dims to 50%. One hour after Night, the light goes to 10%. At Nautical Dawn (nautical dusk: evening astronomical twilight starts), the light turns off. There are four sequences, each triggered by a schedex node, in my Lights flow that implement the four events.

A schedex node supports both on and off events. The node also has payload properties for on and off events. This makes it very easy to trigger an event in home assistant because the schedex payload can carry all of the information required to call the home assistant call service node (i.e. msg.payload.data.entity_id, msg.payload.data.value, msg.domain, msg.service, etc.).

Maybe what you are trying to do is transition the color of some LED lights in your house. You could try this.

Use a boolean in home assistant (i.e. input_boolean.ledLights) to trigger a node-red sequence that would turn the lights on and cycle through LED color changes.

The sequence will:
0) turn on the lights

  1. Set the LED color
  2. start a delay using the time value specified in the delay node
  3. loop back to #1

This will be an infinite loop that will run until the value of input_boolean.ledLights changes to false.

Create a second node-red sequence that will trigger when the state of input_boolean.ledLights changes to false. This sequence will send msg.reset to the delay node, which will cancel the delay and turn off the lights.

If you want to get fancy, you could have an input_number.ledColorDuration in home assistant that you could use to set the duration of the delay. Modify the loop to get the duration before starting the delay.

The sequence would change to:
0) turn on the lights

  1. Set the LED color
  2. get the color duration
  3. start a delay using the msg.delay value that is set from the payload in #2 above. NOTE: from the delay help: msg.delay sets the delay, in milliseconds, to be applied to the message. This option only applies if the node is configured to allow the message to override the configured default delay interval. There are 60,000 milliseconds in a minute. You may need to do some math using 60,000 and the value that is in input_number.ledColorDuration to avoid having to enter really big numbers in home assistant (i.e. if the value in input_number.ledColorDuration is minutes, that value will have to be multiplied by 60,000 to set the value of msg.delay that goes to the delay node.).
  4. loop back to #1

If you want to get super fancy, you could use a node-red sequence with a schedex node to turn on and turn off input_boolean.ledLights so that the entire process needs not human interaction.

Hope this is helpful.