Step 1: Set up the Gentle Wake routine in SmartThings. I called mine “Wake With Bedroom Corner Lights”. I recommend an incandescent light for this, I can’t get LEDs to start anywhere near as dim as an incandescent.
Step 2: Authorize your new thing (the SmartThings routine you created) in SharpTools (http://sharptools.boshdirect.com) (if you need help with SharpTools, the developer is extremely helpful)
Step 3: Build your flow
- Set Flow Name: “Start Morning Lights Before Alarm”
- Trigger: Time
- Weekdays: set as appropriate, I have M-F checked
- Time: set as appropriate, I set it to 5am
- Option: Allow in device idle/doze - CHECKED
- Option: Like alarm clock - UNCHECKED (It works fine without this. I tried having it checked, and I get a persistent alarm clock icon in my notification bar when all alarms are off, so I keep it unchecked)
- Condition: Expression: global_me_home (this is tied to my presence routine, if I’m not home, I don’t want my bedroom lights turning on. You can skip this or base it on SmartThings default “Home” mode if that works for you)
- Action: Init Variable Next Alarm
- Variable: next_alarm
- Action: Script (check if there's an alarm set, then set some variables for later use - I have my lights start 7 minutes before the alarm, change the 7 in the last line of code to whatever you want as your lead-in)
Code: Select all
if (next_alarm == null) { delayMins = 999; } else { nextMins = ("{next_alarm,dateformat,HH}" * 60) + "{next_alarm,dateformat,mm}"; curMins = ("{getDate(),dateformat,HH}" * 60) + "{getDate(),dateformat,mm}"; delayMins = nextMins - curMins - 7; }
- Condition (I use a 2 hour window starting with the 5am trigger time)
Code: Select all
Expression: delayMins > 0 AND delayMins < 120;
- Action: Sleep
- Duration: {delayMins}m
- Action: Plugin: "A Thing"
- Device Type: Gentle Wake Up Controller
- Device: Wake With Bedroom Corner Lights
- Command: on
I’ll probably fiddle with the ramp-time a bit, maybe start it a bit earlier and spread out the dim up time, but I really like having the light start to wake me up before my alarm sounds.