Wake up with Yeelight

You are right. It’s only working via service call now. When used in declared effect, it gets ignored. I’ve made PR with fix for that. https://github.com/home-assistant/home-assistant/pull/22159

1 Like

Works great now by the way, thanks a lot!

yeelight:
devices:
  10.1.1.29:
    name: Bedroom
    model: color2
custom_effects:
 - name: 'Sunrise'
   flow_params:
     count: 1
     action: stay
     transitions:
       - RGBTransition: [255, 0, 0, 50, 1]
       - TemperatureTransition: [1700, 180000, 10]
       - TemperatureTransition: [2700, 180000, 11]
       - TemperatureTransition: [3700, 180000, 12]
       - TemperatureTransition: [4700, 180000, 13]
       - TemperatureTransition: [6500, 180000, 100]'

And then automated as well:

- alias: Sunrise Lighting (bedroom)
  id: Sunrise_lighting
  trigger:
  - platform: time
    at: '06:30:00'
  condition:
  - condition: time
    weekday:
    - mon
    - tue
    - thu
    - fri
  action:
  - service: light.turn_on
    entity_id: light.bedroom
    data:
     effect: Sunrise
4 Likes

Great it works now, thanks for sharing :smiley:

I know this is a long time later, but I just tried using this custom effect… it isn’t working for me. The effect shows up and I can select it, the light changes to a dark orange (expected) but then after a while (time seems to vary) it jumps to white light and full brightness. Not sure if this is a HA 0.96.1 problem or not because I only just tried it after updating. Also, the first Yeelight that I tried this on seems to be permanently broken now… it wont change away from full white and if I try to change it too many times it goes offline and needs a power cycle to come back, albeit back to full white… Is this custom effect still working for you?

This custom effect works for me without problems on 0.96.1

There is something quirky either in the bulb itself, or the integration.

I have the following as an automation to turn a light on 45 minutes before sunset:

action:
    service: light.turn_on
    data:
      entity_id: light.yl_study_cb1
      transition: 60
      brightness: 220
      color_temp: 247

Which works. Except the light comes on slowly over a few seconds to about 50% brightness then jumps to 220 in one go.

bulb is running 1.4.2_0061 - just noticed 0075 is available.

sigh - dont upgrade - 1.4.2_0075 is trash. - Yeelight LED Bulb No "Fade In and Out" effect after update to 1.4.2_0075 - #62,来自 Lucamag - Yeelight Forum - loads of complaints. transitions are totally screwed.

I think this is the issue that music mode is supposed to fix. If you send more than 60 updates/minute, the bulb disconnects… Yeelight - Home Assistant

I’ve tried the transition on a couple of bulbs now and it seems to act the same on all which is very strange. Luckily I only upgraded the firmware on one of them before reading your comment about the new firmware being rubbish. Not sure what else to try though, I was really looking forward to this sunrise effect in the mornings

I’ve not tried the transition from EvanJ - I’ll try give it a go tomrrow.

just tested it on the 1.4.2_0075 bulb (with HA 0.95.4), and a faster version of the transition (10000ms/10seconds) - its trash.

light starts as red on ‘lowest brightness’ (eg not very low. lol)
gets brighter for 10 seconds then jumps to white once the temperature transition is called.

I think it is the lack of colour fidelity at low brightness that screws this up.

No matter what I do, there is a ‘jump’ as the brightness crosses a threshold of about 5-10%

@hekm77 - can you check the firmware version of your bulb(s)?

The firmware on my color bulbs (MJDP02YL) is 1.4.2_0070. The color flow is still smooth.

interesting. I still have a bulb with 1.4.2_0061 - will have to try on there.

and its nice. on 1.4.2_0061

so dont upgrade to 1.4.2_0075

1 Like

@sparkydave

I’ve just updated a colour bulb v1 to 1. 4.2.0076 via Singapore server.

Seems to be way better for colour flow, and the initial colour is now red to not a murky orange. so if you have a firmware with crappy transition, try the upgrade.

ok thanks! I’ll give it a try tomorrow when I get a chance. Just to check, are you using the exact transition code from the second post in this thread?

- name: 'Sunrise'
    flow_params:
      count: 1
      action: stay
      transitions:
        - RGBTransition: [255, 0, 0, 50, 1]
        - TemperatureTransition: [1700, 180000, 10]
        - TemperatureTransition: [2700, 180000, 11]
        - TemperatureTransition: [3700, 180000, 12]
        - TemperatureTransition: [4700, 180000, 13]
        - TemperatureTransition: [6500, 180000, 100]
1 Like

Thanks, that’s a fair bit different to what I had so I’m excited to test it out now

Good guys, thanks for sharing, since I have HA who was looking for these effects. And thanks to you I already have them. I am very grateful for your precious help.

Hi Jon,

I am now using your code for this effect which is working nicely, however it seems that I have to call the service twice to get it to start correctly. If the light is initially off and I call the light.turn_on service with the sunrise effect, the light simply turns on to the last known setting rather than the start of the sunrise. I have to call the service with the effect again to get the effect to start. Have you noticed this at all? The globe is running the latest firmware, v 1.4.2.0076

have to thank @EvanJ for the code

So I just tested (HA 0.95.4, Yeelight Colour bulb v1, 1.4.2.0076)

turn on light and set to purple. turn off light.
Call service light.turn_on with

{
  "entity_id": "light.yl_study_cb1",
  "effect":"Sunrise"
}

And the bulb goes to red and runs though the sequence - without starting at purple.

In the yeelight app I have the bulb “default state” set to not save state automatically - not sure if this is relevant. Cant think of anything else that might impact it.

Hi,
first of all, thanks for sharing your infos here. It helped me allready a lot!
I am trying to setup a sunrise automation for my Yeelight LED Ceiling Light Model No. YLXD01YL, not a bulb!
But I think the only differences that should be of relevance is that the colour range is restricted (2700K-6500K). Right? :grimacing:

I tried to adapt the code posted by @EvanJ for my case:

  custom_effects:
    - name: 'Sunrise'
      flow_params:
        count: 1
        action: stay
        transitions:
          - TemperatureTransition: [2700, 180000, 01]
          - TemperatureTransition: [6000, 180000, 90]

When I call the automation with the effect, it does not react as expected. It directly goes to a medium temperature value and does not change from there at all.

To be honest, I do not exactly know if I understand the parameters correctly. I guess the first ist the temperature, the second the time to reach the specified status from the current one and the third the brightness in percent? Is that correct?

To test the temperatures and brightness values for my lamp, I would like to manually trigger some values. Can someone recommend me a command for this?