Skip to Content

Master Bedroom | The light two hours before bed decides when you get sleepy

Warmer and dimmer means melatonin arrives sooner. This is about the whole room, not one lamp.
January 13, 2026 by
Master Bedroom | The light two hours before bed decides when you get sleepy
渥屋科技股份有限公司, 系統管理者
Master Bedroom

SMART HOME BUTLER · MASTER BEDROOM

The light two hours before bed decides when you feel sleepy

Switching the light off is not the start of sleep, it is the last step of it. What really sets your bedtime is whether the whole room has been winding down since eight in the evening.

2000K
Colour temperature for the last stretch
90 min
How long a white room pushes sleepiness back
5%
All the light a 2am trip needs

A bright white room tells your body it is noon

Besides the cells that let you see, your eyes carry a second, smaller group. They do not care what you are looking at. They report two things only: how bright it is, and how much blue is in the light. That report goes to the part of the brain that runs your body clock, and that is what decides whether melatonin gets released. Melatonin is what makes your eyelids heavy and your body ready to lie down.

The trouble is that a typical ceiling light sits somewhere between 4000K and 6000K. Translated into everyday terms, that is midday sun. You finish an episode, take a shower, walk into the bedroom and lie down, and every step of that journey has been telling your eyes that it is still daytime. Switching off at the last moment is like announcing that the sun has only just set. Melatonin starts from that moment, so of course you spend another half an hour to an hour turning over.

Colour temperature is measured in K, and the smaller the number the warmer the light. 5000K is midday, 3000K is late afternoon sun, 2000K is candlelight. You do not need to memorise any of that. One direction is enough: later in the evening, smaller number.

This is about the whole room, not one lamp

Plenty of people read "dim things down before bed" as turning the bedside lamp low. But the two hours before bed are spent in the whole room, not in the thirty centimetres around your pillow. The ceiling light hits your face, the desk lamp lights a screen, the cove lighting bounces off the wall, and the street lamp outside leaks in all night. Added together, that is the signal your body receives.

So this setup has four things to deal with: the ceiling light, the bedside lamp, the indirect lighting and the curtains. Skip any one of them and the other three lose most of their effect.

Colour temp (left axis) Brightness (right axis) White light left on (control) Control group — colour and brightness never move 22:00 melatonin starts White room: not until 23:30 About 90 minutes earlier 5000K 3500K 2000K 100% 50% 0% 20:00 21:00 22:00 23:00 00:00 Same room, same people. The only difference is whether the light followed the clock down. Lower K means warmer light. Brightness here is relative, not measured illuminance.
Both lines have to fall together. Dimming without warming, or warming without dimming, gets you part of the way at best. The grey pair is a room that keeps its white light on all evening, and sleepiness arrives a full hour and a half later.
You do not have to do all of it at once. Just taking the last hour from 4000K down to 2700K is enough for most people to notice a difference in the first week. The rest can come later.

What the four hours before bed should look like

Here is the same chart written out. This is someone who goes to bed at half past eleven, and what actually happens in the room.

  1. 20:00

    The descent begins

    Colour temperature moves from 4500K to 4200K, brightness from 100% to 92%. You will not notice this step at all, and that is exactly the point. Every step is small enough to be invisible; only four hours of them add up to something you can feel.

  2. 21:00

    The ceiling light steps back

    3600K, 78%. The main light starts handing over to the indirect lighting. Light now arrives bounced off walls and ceiling instead of aimed at your eyes, and that single change does more for eye comfort than the dimming itself.

  3. 22:00

    Your body gets the message

    2700K, 45%. The room reads as dusk. The curtains come down here, shutting out the street lamp and the illuminated sign across the road. Melatonin release starts around this point.

  4. 23:00

    Only the bedside is left

    2200K, 20%. The ceiling light is off, the indirect lighting is barely there, and the bedside lamp is enough to read by without glare. Your phone screen will suddenly look very bright, which is a good sign: the room genuinely is dark now.

  5. 02:30

    Up in the night

    The occupancy sensor sees someone leave the bed and brings the low-level lamp up to 5% at 2000K. Enough to see the floor, nowhere near enough to convince your body that morning has arrived. Two minutes with no movement and it switches itself off.

That last step is the one people skip. Plenty of homes get the evening right, then hit the ceiling switch at two in the morning. One burst of 4000K undoes four hours of careful winding down, and the whole thing has to start over.

Four things it takes care of

Sleepy sooner

Nothing forces you to sleep. Your body simply gets ready earlier, and the turning-over stretch after lights out gets noticeably shorter.

Nights stay nights

No white light in the face at 2am. You get back into bed and usually drop off within minutes instead of lying awake until dawn.

Easier on the eyes

Eyes are more sensitive late in the evening. Removing the direct, high colour temperature source cuts the strain from reading or scrolling.

Nothing to remember

Nobody has to dim anything, close the curtains, or feel for a switch in the dark. The whole sequence runs itself.

Before and after

MomentHow it goes nowHow it goes after
Two hours before bedCeiling light full on, midday colourA small step down every half hour, unnoticed
Getting into bedEverything off at once, eyes adjustingOnly the bedside glow left, the switch is a formality
The street lamp outsideLeaks in all night, nobody closes the curtainCurtains come down by themselves at ten
Bathroom at 2amCeiling light on, awake for an hourLow floor light, off again in two minutes
A partner on a later scheduleTheir light wakes you upThe room is already warm and dim, so it barely registers

What you need

Home Assistant treats every device in the house as an entity. Brand and model do not matter; what matters is the category it lands in. If you have the ones below, you can build this.

PurposeCategory in the systemRequired?
Ceiling lightlight, ideally colour adjustableYes
Bedside lamplightYes
Cove or shelf lightinglightNice to have
Knowing someone got upbinary_sensor occupancyFor night lighting
CurtainscoverNice to have
Getting alertsnotify phone appRecommended
What if the lights only dim and cannot change colour? Then build the brightness line alone. You get maybe seventy per cent of the benefit, which is still worth having. If you want the colour part later, the cheapest route is to change the bedside lamp and the indirect lighting only, leave the ceiling light as it is, and simply have it bow out earlier in the evening.
Where does the occupancy sensor go? Not in the middle of the ceiling. Put it on the path from the side of the bed to the door, roughly 60 to 90 centimetres off the floor. Then it catches you the moment your feet land, instead of waiting until you have reached the middle of the room.

How the system works

Broken apart, there are only two threads. One handles the four hours before bed, the other handles the trip in the night. They never interfere with each other, but they share the same set of lights.

THE EVENING Clock and sunset Worked out for you adalight blueprint One small step at a time Ceiling and indirect lighting Dimmer and warmer as the night goes on Bedside lamp and curtains One lamp at 2000K, curtains shut out the street Armed only after dark THE NIGHT Occupancy sensor Catches feet on the floor binary_sensor_trigger_light Night hours only Low floor light comes up 5% at 2000K, off again after two minutes
The top thread walks the room into night. The bottom one gives you just enough light when you get up. The dashed line means the night lighting is only armed while the evening mode is running, so walking into the bedroom in daylight never triggers it.

Use the ready-made logic in the middle

The hub ships with a set of tested automation blueprints. Think of a blueprint as a fill-in-the-blank form: the boxes are already drawn, you only supply the answers. The evening thread uses adalight, which exists precisely to walk a group of lights along with the clock.

Box to fillWhat goes in itSuggested
Which lightsCeiling, bedside and indirect, all selected together—
Start timeFour hours before you normally turn in20:00
Starting colour and levelHow the room looks when you first switch on4500K · 100%
Ending colour and levelHow it should look as you lie down2000K · 10%
Time between stepsShorter intervals feel smoother30 minutes

Fill in those five boxes and the whole evening is handled. You never write eight separate rules saying "at this time set that light to this level", and you never work out the intermediate values yourself.

Different homes, different numbers

Those are general defaults. If your schedule looks nothing like that, adjust as below.

Your situationStartEndWhy
In bed by 23:3020:002000K · 10%The general case, use it unless you have a reason not to
Not asleep until 01:0022:002000K · 10%Shift the whole thing two hours later, or it bottoms out far too early
Shift work, no fixed hoursFour hours out2000K · 10%Trigger it by voice or a phrase rather than tying it to the clock
You read in bed20:002200K · 25%Keep the bedside lamp higher, let everything else go all the way down
Young children at home18:302000K · 8%Children react more strongly to light, so start earlier and finish lower
If in doubt, start with 20:00 down to 2000K. Every one of these numbers can be changed later by saying so out loud. Nothing has to be rebuilt.

The trip at 2am, without waking yourself up

Evening light decides when you fall asleep. Night light decides whether you get back to sleep. Both matter, and the second one usually gets forgotten.

Your body is unusually sensitive to light in the small hours. The same lamp you would call ordinary at noon is enough at two in the morning to shut melatonin down on the spot. When someone says "one trip to the bathroom and I was awake for the rest of the night", the cause is rarely the bladder. It is the ceiling light.

The answer is the binary_sensor_trigger_light blueprint: occupancy triggers a light, but the light in question is the low one near the floor, held at 5% brightness and 2000K, switching itself off after two minutes of stillness. Three details carry the whole thing. The source has to be low, so it lights the floor rather than your face. The level has to be small enough to show outlines and nothing more. And it has to be limited to night hours, because walking in during the day should not set it off.

Four optional extras

Two blueprints cover the core. These are additions, so take whichever you actually want.

If you wantBlueprintWhat it does
The same thing in reverse each morningadalightBuild a second one going the other way: start dim at 2000K and reach 4000K at full over thirty minutes. Gentler than an alarm, and most people who try it never go back
Curtains that follow the lightslight_sync_cover_and_fanTies the curtains to the lights, so they close once the room drops below a given level. No separate schedule to maintain
To switch modes with a sentencevoice_trigger_thingsSay "bedtime" to Assist and the room jumps straight to the lowest step instead of waiting for the clock
A nudge when the curtains stay openentity_state_trigger_notifySends a phone notification if the curtains are still open past eleven. Sometimes something is jamming them, and it is better to know
No spoken announcements. A bedroom is the last place that should make noise, so every alert goes to the phone as a push notification. A voice saying "curtains still open" at midnight is a far worse problem than open curtains.

You do not have to set it up, just say the word

None of this needs clicking through by hand. The WOOWTECH hub ships with HA-MCP, which lets AI connect straight into your system, build the thing, and then go back and check that it really works.

YouSet up a warm evening mode in the master bedroom. Start winding down at eight and leave it around ten per cent by eleven.
pi agentFound three lights in there: ceiling, bedside and shelf lighting. I have built one rule that steps down every thirty minutes from 20:00, running 4500K to 2000K. I jumped it to the final step by hand and all three responded. There is also a curtain in that room — want it included?
YouYes. And I am up in the night fairly often.
pi agentCurtains are set to close at 22:00. For the night trip I am using the occupancy sensor by the door, active between midnight and six, bringing the shelf lighting to 5% at 2000K and dropping it after two minutes. The ceiling light stays off.

Prompts you can copy straight over

Every block below can be copied whole, using the button on the right. Pick the one closest to what you want rather than using all five.

The basic versionUse this if you just want it running
Set up a warm evening mode in the master bedroom.
From eight in the evening, have the lights in there get
gradually dimmer and warmer, so that by around eleven they
are at roughly ten per cent and about two thousand kelvin.
Keep it smooth, with no visible jumps between steps.
The full versionCurtains and night lighting included
Build me the whole warm evening setup for the master bedroom.
Starting at 20:00, bring the ceiling light, bedside lamp and
indirect lighting down together, one step every thirty minutes,
from 4500K and 100% all the way to 2000K and 10%.
At ten, close the bedroom curtains as well.
Then add night lighting: between midnight and six in the morning,
if the occupancy sensor sees movement, bring the low light near
the floor to 5% brightness at 2000K, and switch it off again after
two minutes of stillness. Never turn the ceiling light on for this.
No spoken announcements. If something needs telling me, use a phone
notification. Once it is built, test it yourself, confirm it really
works, and then tell me which devices you used.
Adjusted for your homeFor late nights and shift work
I am usually not asleep until about one in the morning, so having
the room fully dark by eight is far too early.
Shift the whole master bedroom warm evening sequence two hours later:
start stepping down at ten, and reach the darkest step at one.
Move the night lighting window as well, to two until eight.
Leave everything else exactly as it is.
Changing it laterOne sentence, no rebuild
The bedroom was too dark by ten last night while I was still reading.
Push the time it reaches the darkest step back by one hour, and raise
the minimum brightness of the bedside lamp alone from 10% to 25%.
Leave the ceiling light and the shelf lighting exactly as they are.
When something goes wrongAsk for last night in play-by-play form
Walk me through everything the bedroom lighting did last night.
Lay it out in time order, the clock time, the lamp that moved,
and the brightness and colour temperature it landed on.
If a step was skipped, mark it and say plainly why it never happened.
Change nothing for now, I want to read the list first and then decide.
One caution: the HA-MCP connection URL is the key to your home. Do not post it publicly, and do not give it to services you do not trust.

Common questions

Is reading under warm light bad for my eyes?
What matters is whether there is enough light, not how warm it is. A 2200K lamp reads perfectly well as long as the level is adequate. Straining under too little light is the real problem, and colour has little to do with it. Raise the minimum brightness on the bedside lamp alone and let everything else go all the way down.
I often go to bed after midnight. Is this still worth it?
Yes, but shift the whole schedule later. The point is not what time the dimming starts, it is that the last two hours before you lie down are dark. If your hours move around, trigger the mode with a phrase instead of tying it to the clock.
My lights only dim, they cannot change colour
Then build the brightness line on its own. You get around seventy per cent of the benefit, which is still worth having. To add colour later, the cheapest route is replacing the bedside lamp and the indirect lighting first, leaving the ceiling light alone but retiring it earlier in the evening.
Is 5% too dark to be safe at night?
It sounds low, but in a genuinely dark room it is plenty, because your eyes have already adapted. The dangerous version is a sudden burst of white light that leaves you unable to see anything for several seconds. If you would rather have more, take it to 10% or add a second low light along the hallway.
My partner and I keep very different hours
Bring the whole room down to the same baseline first, then let the later riser top up with the bedside lamp alone. They get light to use, and the earlier sleeper never catches the ceiling light. If the gap is really large, build two modes and switch between them with a sentence.
Do I have to rebuild it to change the timing?
No. Say "start the bedroom an hour later" or "take the darkest step up to 20%" and the assistant finds the existing rule and edits it rather than creating a new one.
two weeks later

Two weeks from now

You turn over fewer times after lights out, the trip in the night stops leaving you awake until dawn, and the morning needs one alarm instead of three.

And in those two weeks, you have not touched a light switch in the bedroom once.

Share this post