Looking for a configuration for color lights

Hi to all in the forum I already have my Merkury color lights working, but I need to modify my configuration. Right now the light turn on with the sunset with color purple, until 8:00pm and then change every 1 hour, but I need to modify it because the purple stay more time because is fall. I need a configuration that every color stay only 1 hour. Can somebody have this kind of configuration. Thanks with any help.

Which colors do you want in addition to purple?

Hi, right now I have the colors, purple, orange and yellow. Thanks

Is this what you want:

  • The light turns on at sunset with the color purple and remains that way until 8:00 PM.
  • At 8:00 PM it changes to another color (orange).
  • At 9:00 PM it changes color again (yellow).
  • At 10:00 PM the light turns off.

Currently that is the configuration that I have, what happens is that as each day the sunset is earlier each day, the purple color remains longer, what I need is that the colors are always only one hour. The lights turn off with the sunrise. Thanks

If you want the color changes to occur with respect to sunset then use the Sunset/Sunrise Trigger with an offset.

For example, this triggers 1 hour after sunset.

  trigger:
    platform: sun
    event: sunset
    offset: "01:00:00"

Thanks but that is not what I want. I want this;
This week for example:
Sunset start at 6:12PM
Purple 6:12PM
Orange 7:12PM
Yellow: 8:12PM
… One hour each color Until Sunrise
Next week
Sunset start at 5:50 PM
Purple 5:50PM
Orange: 6:50PM
Yellow: 7:50PM
…One hour each color Until Sunrise

Is this the only use for this light?

If so, trigger at sunset and switch it to purple. Then use a second automation that triggers when the light has been on for 1 hour, 2 hours, 3 hours etc and when the light has been on for an hour change it to orange, yellow etc

Yes that’s the only use.

What you want is exactly how what I showed you works.

This will trigger at sunset (6:12 PM)

  trigger:
    platform: sun
    event: sunset

This will trigger at sunset + 1 hour (7:12 PM)

  trigger:
    platform: sun
    event: sunset
    offset: "01:00:00"

This will trigger at sunset + 2 hours (8:12 PM)

  trigger:
    platform: sun
    event: sunset
    offset: "02:00:00"

This will trigger at sunset + 3 hours (9:12 PM)

  trigger:
    platform: sun
    event: sunset
    offset: "03:00:00"

etc
etc

The trigger will self-adjust for each day’s sunset.

Create multiple automations, each one triggering at sunset plus the desired offset and then setting the light’s color. For example, here is the automation for sunset + 2 hours.

- alias 'Sunset offset 2 hours'
  trigger:
    platform: sun
    event: sunset
    offset: "02:00:00"
  action:
    service: light.turn_on
    data:
      entity_id: light.your_light
      color_name: 'yellow'

It’s hard to write software when they make you tease out the information just to write the URS.
But now that I think about it … that’s pretty much every software project I’ve ever been involved with :man_shrugging:

Thanks I will tried it.