Simulate Sunrise with Yeelight Bedside Lamp and Sleep for Android

Narongdej Sarnsuwan
3 min readMay 5, 2019

--

I read from some articles online that waking up with sunrise is best for your body. I haven’t look into it, but it makes sense since ordinary people wake up at dawn. It should behave like a natural alarm clock for ancient people.

However, I’m the type of person that wakes up at 8–9 AM in a room full of curtains that no light can pass. The natural sunrise wouldn’t cut it for me. So I bought a Yeelight bedside lamp. Here’s how you can connect Yeelight’s bedside lamp with Sleep for Android application to create your artificial sunrise.

Connect your IFTTT account with Yeelight

IFTTT (If this then that) is a service that lets you connect multiple apps together. Fortunately, it has support for both Yeelight and Sleep for Android.

After you set up your light with your Mi-Account, go to this link and press “Connect.” If you don’t have an IFTTT account then sign up it’s free. After you logged in, you will redirect to the Mi-Account login page. Sign in with your Mi-Account and approve the connection.

Connect your Sleep for Android with IFTTT

Open the application and go to settings -> Integrations -> Advanced -> Services -> Toggle IFTTT

Press retrieve, and it should open an IFTTT webpage below for you to sign in. After you signed in, there should be a little toast saying IFTTT connected and If you click toggle IFTTT off and on again, the field has your IFTTT’s Maker key.

You’re all set. Now let us create our little Sun.

Create scenes

First, you have to create a scene in the Yeelight app (Not the Mi Home app, use the Yeelight app). Open up your app and go to the “Scene” tab. Press + and select an icon. Name your scene, select your device and select your preferred state. For the sunrise effect, I use “Turn on with scene” and choose the recommended Sunrise scene.

Create as many scenes as you want, here are some of my scenes

Ready for Bed light

In my room, if the bed light doesn’t turn on, then the room is entirely dark. I set the scene to turn the light on with moderate brightness so I can get myself safely to the bed.

Bedtime

Just turn the light off

Sunrise

Play the recommended “Sunrise” scene

Create IFTTT’s Applet

After you have created your scenes, we have to identify what condition it will trigger the scene.

Go to the IFTTT website and create a new applet. Click a big “this” link to choose a service. Choose Webhooks, and select Receive a web request

For the event name, type in your preferred event name. The full list of events is listed here. Get creative; for me I use:

time_to_bed_alarm_alert — Ready for Bed light
sleep_tracking_started — Bedtime
smart_period — Sunrise

After you type the name then press “that” link to choose an action. Find Yeelight and choose “set scene” and pick an appropriate scene.

Finally, set the applet name, click finish, and you’re all set.

Hopefully, you’ll wake up fresh and ready for anything on the next day. Just be sure not to turn wifi or cellular network on your phone off before you go to sleep or the trigger won’t happen.

--

--

Narongdej Sarnsuwan
Narongdej Sarnsuwan

Written by Narongdej Sarnsuwan

0 Followers

Co-Founder of The Gang Technology, and a software developer