Sun-Aware Shutter Control 
Version 1.16.0 | Automatically close your shutters when the sun shines on your house — and open them again when it moves away!
This blueprint is currently in a testing phase. It has been tested in a single environment. Feedback and bug reports are very welcome!
The problem this solves
Every day the sun moves from one side of your house to the other. In the morning it shines on the front, in the afternoon on the back. Without automation you have to remember to close and open your shutters multiple times a day — this blueprint handles that for you automatically.
Features
Sun position tracking - Closes shutters when the sun shines on the front or back facade-
Automatic opening - Opens shutters once the sun moves away (optional)
Only when nobody is home - Optional toggle to disable all shutter operations when someone is home; the automation only acts when the house is empty
Presence-aware re-evaluation - Immediately re-evaluates shutter positions when the house becomes empty, without waiting for the next sun position update-
Smart manual override - Only triggers when a shutter is manually closed; a manual open never blocks the sun-close logic so the automation stays in control
-
Presence-aware override - Configure up to 2 person entities: when someone is home, manual operations are respected; when nobody is home, the automation takes full control regardless
-
Sunset reset - All overrides are automatically cleared at sunset so the next day starts fresh
-
Cloud detection - Optional weather integration (supports two entities as cross-check): shutters stay open when overcast, close again when it clears up. When two weather entities are configured, both must agree before shutters close — prevents false closes caused by a single unreliable source
-
Anti-oscillation cooldown - Minimum wait between moves, prevents rapid up/down on partly cloudy days
-
Position awareness - Skips the command if shutters are already at the target position
-
Configurable sun window - Control how many degrees of margin counts as "sun on facade"
-
Minimum elevation - Ignores low morning/evening sun below your threshold
-
Flexible positions - Set custom close position (e.g. 50% for partial shade)
-
Front and back separately - Independent shutter groups per facade side
How it works
The blueprint uses the sun.sun azimuth (compass direction 0–360°) and compares it to your house orientation. It fires automatically whenever Home Assistant updates the sun's azimuth — event-driven, no polling needed. Each time it calculates whether the sun is within the configured angle window of each facade:
Angle difference = ((sun azimuth − facade direction + 180) % 360) − 180
Sun on facade = angle difference < sun window AND elevation > minimum
This formula handles all compass directions correctly, including the North wrap-around (359° → 1°).
Decision logic per facade side
| Sun on facade | Weather allows | Override active | Someone home | Action |
|---|---|---|---|---|
| — | Close shutters | |||
| Do nothing (respect manual override) | ||||
| Close shutters (nobody home overrules) | ||||
| — | — | Open shutters (treat as no sun) | ||
| — | — | Open shutters | ||
| — | Do NOT open (respect manual close) | |||
| — | Open shutters (nobody home overrules) | |||
| — | any | — | Reset all overrides (daily reset) |
Finding your house azimuth
Go to suncalc.org, find your house and determine which direction your front door faces. North = 0°, East = 90°, South = 180°, West = 270°. The back facade is calculated automatically (front + 180°).
Requirements
- Home Assistant 2025.12.0+
-
- Cover entities (shutters/blinds as
coverdomain)
- Cover entities (shutters/blinds as
-
- Sun integration (built-in, no setup needed)
Optional
- Input Boolean helpers — for manual override detection (one per facade side). Create via Settings → Helpers → Create Helper → Toggle.
-
- Person entities — for presence-aware override behavior.
Configuration
| Input | Description | Default |
|---|---|---|
| Compass direction your front facade faces (0–359°) | 180° | |
| Cover entities on the front | — | |
| Cover entities on the back | — | |
| Degrees left/right of facade that count | 90° | |
| Minimum sun height above horizon | 10° | |
| Shutter position when sun shines (0% = fully closed) | 0% | |
| Open when sun moves away | On | |
| Position when automatically opening | 100% | |
| Input Boolean for front manual override | Optional | |
| Input Boolean for back manual override | Optional | |
| First household member for presence detection | Optional | |
| Second household member for presence detection | Optional | |
| When on, the automation only acts when the house is empty | Off | |
| Weather integration for cloud detection | Optional | |
| Second weather source as cross-check; both must agree before closing | Optional | |
| Always / Sunny+partly cloudy / Sunny only | Sunny or partly cloudy | |
| Minimum minutes between two movements (0 = disabled) | 20 min |
Manual override explained
Home Assistant records who initiated every state change. When a user manually closes a shutter (via app, dashboard or physical switch), the context contains a user_id — the blueprint detects this and activates the override, preventing the automation from re-opening it.
A manual open does not set the override by default. This means: if someone opens a shutter in the morning when it's cloudy and later the sun comes out, the blueprint will still close the shutter automatically. Exception: if a presence entity is configured and someone is home, a manual open also sets the override (the automation won't fight the user).
Override lifecycle
| Event | Override |
|---|---|
| User manually closes shutter | → ON (always) |
| User manually opens shutter while someone is home | → ON |
| Shutter returns to the open position | → OFF |
Sun sets (sun.sun → below_horizon) |
→ OFF (daily reset) |
Presence-aware behavior
Configure Person 1 and/or Person 2 (optional) to make the override presence-aware:
| Situation | Close? | Open? |
|---|---|---|
| Override OFF | ✓ | ✓ |
| Override ON + someone home | ✗ | ✗ (manual operation respected) |
| Override ON + nobody home | ✓ | ✓ (automation takes full control) |
Note: Voice assistant commands (Alexa/Google) don't carry a
user_idand won't trigger the override.
GitHub
Full documentation, examples, and troubleshooting: GitHub Repository
Changelog
- 1.16.0 - Added presence-aware re-evaluation: when a configured person entity changes state, the automation immediately re-evaluates — no waiting for the next sun update when the house becomes empty
- 1.15.0 - Added "Only when nobody is home" toggle: when enabled the automation skips all shutter operations whenever someone is home — occupants stay in full control
- 1.14.0 - Added optional second weather entity as cross-check: when both are configured, shutters only close when BOTH agree (AND-logic) — prevents false closes from a single unreliable weather source
- 1.13.0 - Override is now also bypassed on auto-open when nobody is home (mirrors close behaviour)
-
- 1.12.0 - Added sunset trigger: all overrides reset at the end of each day so the next morning starts fresh
-
- 1.11.0 - Fixed: override was reset too early when shutter was still closed, causing the automation to reopen a manually closed shutter
-
- 1.10.0 - Two separate person inputs (Person 1 + Person 2) replace the single presence entity
-
- 1.9.0 - Presence-aware override: when nobody is home the automation ignores the override and closes on sun
-
- 1.8.0 - Manual override only triggers on manual close (not open), so automation can still close after a manual open
-
- 1.7.0 - Added anti-oscillation cooldown and position check to prevent unnecessary motor activations
-
- 1.6.0 - Auto-open no longer fires at night — shutters closed in the evening stay closed
-
- 1.5.0 - Added optional weather/cloud detection: shutters stay open when overcast
-
- 1.4.0 - Replaced 5-minute polling with event-driven sun azimuth trigger
-
- 1.3.0 - Fixed: manually closing shutters at bedtime no longer causes them to be re-opened
-
- 1.2.0 - Translated all labels and descriptions to English
-
- 1.1.0 - Manual override detection with input_boolean helpers, auto-reset when sun moves away
-
- 1.0.1 - Added suncalc.org tip to description
-
- 1.0.0 - Initial release