Sun-Aware Roller Blind Control with Lux, Weather & Manual Override
I’ve created a Home Assistant blueprint for automatically controlling a roller blind based on the actual position of the sun, rather than fixed times.
The idea is simple: instead of saying “close the blind at 11:00”, the automation knows where the sun is relative to the window and closes the blind only when direct sunlight can actually reach it.
Inspiration
This blueprint is inspired by the excellent Sun-Aware Shutter Control blueprint by r3mcos3.
The original blueprint provided the inspiration for using the sun’s azimuth and elevation to determine when direct sunlight reaches a facade. I wanted to take that idea in a more window-focused direction, where each automation instance controls a single cover and its actual viewing direction.
This version therefore takes a somewhat different approach, adding configurable sun geometry, optional illuminance and weather conditions, selectable active periods, timed manual override, and cooldown handling.
Import Blueprint
Or import it manually from the GitHub Gist.
Requirements
Home Assistant 2026.9 or newer is required.
This blueprint requires the current Sun integration available in Home Assistant 2026.9+. The 2026.9 release completed the recent rebuild of sun-based automation triggers and conditions, including the dedicated golden-hour and blue-hour triggers and conditions used by this blueprint.
It will not work correctly on older Home Assistant releases.
Required
-
Home Assistant 2026.9+
-
The built-in
sun.sunintegration -
A
coverentity for the roller blind
Optional
-
Illuminance sensor
-
Weather entity
-
Timer helper for timed manual override
Features
-
Sun-position based control — reacts to the actual solar azimuth and elevation instead of fixed times -
Configurable window direction — define the direction the window faces -
Configurable sun window — choose how many degrees on either side of the window direction count as direct sunlight -
Minimum sun elevation — ignore low-angle sunlight below a configurable elevation -
Optional illuminance threshold — only close when the measured light level is high enough -
Optional weather filtering — close only in sunny or partly cloudy conditions, or only when sunny -
Selectable active period — always, daylight, golden-hour daylight, or blue-hour daylight -
Timed manual override — temporarily prevents the automation from interfering after a manual adjustment -
Cooldown — prevents rapid open/close cycles -
Position awareness — avoids sending unnecessary commands when the cover is already at the target position -
Automatic reopening — opens the blind again when direct sunlight is no longer reaching the window -
Designed for individual windows — each instance can have its own orientation and settings
How it works
The blueprint compares the current solar azimuth with the direction of the window.
For example, if a window faces 60° (ENE) and the sun window is set to 60°, the automation considers the sun to be on the window when its azimuth is within approximately 0–120°.
The calculation correctly handles the 0°/360° boundary.
The minimum sun elevation is evaluated separately. This means that even when the sun is within the correct azimuth range, the blind will not close if the sun is below the configured elevation threshold.
The basic decision is therefore:
Sun on the window + sufficient light + allowed weather → close
Sun no longer on the window → open
Additional conditions such as the active period, manual override and cooldown can prevent either action when appropriate.
Window direction
The Facade / Window Azimuth input describes the direction the window faces, rather than the orientation of the wall itself.
A useful way to determine it is to stand directly in front of the window and look straight through it. The direction you are looking is the value to use.
For example:
-
North =
0° -
East =
90° -
South =
180° -
West =
270°
Intermediate directions can be entered as well.
The blueprint then calculates the angular difference between this direction and the current solar azimuth.
Sun window
The Sun Window determines how far the sun may be from the exact window direction and still be considered relevant.
For example:
-
Window direction:
60° -
Sun window:
30°
The sun is considered to be on the window between approximately 30° and 90°.
A larger value provides a wider protection zone, while a smaller value makes the automation more directional.
Minimum sun elevation
The Minimum Sun Elevation is independent of the selected active period.
For example, with a minimum elevation of 10°, the automation will ignore the sun while it is below 10° above the horizon, even if its azimuth is within the configured window.
This is useful for avoiding unnecessary blind movements caused by very low morning or evening sunlight.
Active periods
The automation can be configured to operate:
-
Always — no time-of-day restriction
-
Daylight — from sunrise to sunset
-
Golden-hour daylight — starts at the beginning of the morning golden hour and remains active through daylight
-
Blue-hour daylight — starts at the beginning of the morning blue hour and remains active through daylight
These settings determine when the automation is active. They do not replace the minimum sun-elevation setting.
In other words, selecting Golden-hour daylight does not mean that the blind will close during golden hour. The sun must still meet the configured azimuth and minimum-elevation conditions.
Illuminance
An optional illuminance sensor can be used as an additional condition.
When configured, the blind will only close when the measured illuminance is at or above the selected threshold.
This can help with situations where the sun is technically in the correct position but clouds or other conditions make the actual light level too low to justify closing the blind.
Weather
An optional weather entity can be used to prevent unnecessary closing during cloudy conditions.
Three modes are available:
-
Always — ignore weather
-
Sunny or partly cloudy
-
Sunny only
Weather is treated as an additional condition for closing. It does not by itself determine when the blind should open.
Manual override
If a manual override timer is configured, a manual change of the cover can temporarily suspend automatic control.
The override is activated when the cover is manually changed through Home Assistant with a user context. While the override is active, the automation leaves the cover alone until the timer expires.
This is useful when you want to temporarily take control without disabling the automation itself.
If no timer helper is configured, the manual override feature is simply disabled.
Cooldown
The optional cooldown prevents the blind from being moved again immediately after a previous movement.
This is particularly useful on partly cloudy days, when changing sunlight conditions could otherwise cause repeated open/close commands.
Set the cooldown to 0 to disable it.
Example
For a window facing approximately 60° ENE, a reasonable starting configuration might be:
Window direction: 60°
Sun window: 60°
Minimum elevation: 10°
Close position: 0%
Open position: 100%
This is only an example — the optimal values depend on the actual window orientation, surrounding buildings and how much direct sunlight you want to block.
Notes
This blueprint is intentionally focused on one window / one cover per automation instance.
That makes it possible to give every window its own orientation, lux sensor, weather conditions and operating parameters instead of treating an entire side of a building as one unit.
Feedback, bug reports and suggestions are very welcome.