Help in automation Yeelight sunrise animation

Hello,
just starting to play with HA.
I would like to make an automation like this:
"
-At 5.30 AM
-switch on my Yeelight RGB bulb
-start with color green and low brightness
-in 15 minutes
-go slow to white with max brightness.
"

I already make some simple automations but I really don’t know how to make this.
Any help is really appreciated.

Thanks

I think you’ll need 2. One to switch it on at 5:30 and one to transition to white…

Something like this:

- action:
  - data:
      brightness_pct: 30
      entity_id: light.yeelight-bulb
      color: green
    service: light.turn_on
  alias: Turn Lounge Light On at 5:30am
  condition: []
  id: '1'
   trigger:
  - at: 07:15:00
    platform: time
- action:
  - data:
      brightness_pct: 100
      entity_id: light.yeelight-bulb
      color: white
      transition: 900
    service: light.turn_on
  alias: Turn to full brightness and white after 15 minutes
  condition: []
  id: '2'
  trigger:
  - state: 
    entity_id: light.yeelight-bulb
    from: off
    to: on
1 Like

Thanks David,
I will try this road this evening.

Only one question:
where did you find the keyword “brightness_pct” ?
I can’t find it in the documentation!

@boggiano You can do it in 1 automation:

- alias: Turn Lounge Light On at 5:30am
  trigger:
    - platform: time
      at: "05:30:00"
  action:
    - service: light.turn_on
      data:
        brightness_pct: 30
        entity_id: light.yeelight-bulb
        color: green
    - service: light.turn_on
      data:
        brightness_pct: 100
        entity_id: light.yeelight-bulb
        color: white
        transition: 900

Then you don’t need to worry about a second action firing every time you turn the light on.

Thanks @petro: it worked! :grinning:
Not sure why using a group (made of three RGB Yeelight), every bulb acts with different behavior. (slight differences)

Can you, please, explain more about the parameter “transition” : it’s not clear to me!

Thanks!

I have no clue! I just got it from @DavidFW1960. According to the docs:

Number that represents the time (in seconds) the light should take to transition to the new state.

also, here’s a link to said docs:

1 Like

It’s in the documentation for the light component.

1 Like

Hi, I have a problem. I used this code: https://www.tsmithcreative.com/blog/2017/hass-winter-automations/

At sunrise my light turns on, but it doesn’t make the transition to the next state. Can someone help me out.

automations.yaml

  • action:

    service: script.upstairs_sunrise
    

    alias: Sunrise
    condition:

    condition: time
    weekday: 
      - mon
      - tue
      - wed
      - thu
      - fri
    

    trigger:

    at: "10:27:00"
    platform: time
    

scripts.yaml

upstairs_sunrise:
alias: Upstairs Sunrise
sequence:

# Turn the lights to low brightness at a very warm temperature
- service: light.turn_on
  data:
    entity_id: light.yeelight_color1_34ce008042b2
    transition: 60
    brightness: 51
    kelvin: 2000

# Wait 5 seconds
- delay: 00:00:05

# Over ten minutes, turn the lights a little brighter and to a
# cooler-than-soft-white color.
- service: light.turn_on
  data:
    entity_id: light.yeelight_color1_34ce008042b2
    transition: 60
    brightness: 63
    kelvin: 3000

# Wait 5 seconds
- delay: 00:00:05

# Finally, over fifteen minutes, shift the lights to a cool white at 90%.
- service: light.turn_on
  data:
    entity_id: light.yeelight_color1_34ce008042b2
    transition: 60
    brightness: 230
    kelvin: 4200

thanks