Adaptive Cover for Home Assistant
Almost a year ago @langestefan posted this helpful community post to create a template sensor that automatically controls your blinds or sunscreen based on the position of the sun in the sky. You can find the post here.
I’ve created a blueprint for it, but it is very limited. So now I have built this awesome integration that can control your blinds whether they are vertically aligned, horizontally oriented, or even on an angle, or can tilt.
The Integration
The primary goal of the integration is to preserve visual comfort by reducing glare from direct sunlight. Additionally, it aims to reduce energy consumption by climate control.
A smart home should not only be able to control your blinds based on inputs like the position of the sun but should also help with the indoor climate by being energy efficient and controlling the temperature inside. Therefore, I added a climate mode that can adjust the position based on personal preferences, weather conditions, inside/outdoor temperatures, and presence. The algorithm is based on a scientific paper that studies the perfect position for adjustable tilted blinds.
Here’s a flow chart showing the decisions to produce the position state based on the inputs and selected mode(s):
Entities
The integration provides entities dynamically based on the modes and/or variables that are configured.
These entities are always available:
Entities | Default | Description |
---|---|---|
sensor.{type}_cover_position_{name} |
Reflects the current state determined by predefined settings and factors such as sun position, weather, and temperature | |
sensor.{type}_control_method_{name} |
intermediate |
Indicates the active control strategy based on weather conditions. Options include winter , summer , and intermediate |
sensor.{type}_start_sun_{name} |
Shows the starting time when the sun enters the window’s view, with an interval of every 5 minutes… | |
sensor.{type}_end_sun_{name} |
Indicates the ending time when the sun exits the window’s view, with an interval of every 5 minutes. | |
binary_sensor.{type}_manual_override_{name} |
off |
Indicates if manual override is engaged for any blinds. |
binary_sensor.{type}_sun_infront_{name} |
off |
Indicates whether the sun is in front of the window within the designated field of view. |
switch.{type}_toggle_control_{name} |
on |
Activates the adaptive control feature. When enabled, blinds adjust based on calculated position, unless manually overridden. |
switch.{type}_manual_override_{name} |
on |
Enables detection of manual overrides. A cover is marked if its position differs from the calculated one, resetting to adaptive control after a set duration. |
button.{type}_reset_manual_override_{name} |
on |
Resets manual override tags for all covers; if switch.{type}_toggle_control_{name} is on, it also restores blinds to their correct positions. |
When climate mode is setup you will also get these entities:
Entities | Default | Description |
---|---|---|
switch.{type}_climate_mode_{name} |
on |
Enables climate mode strategy; otherwise, defaults to the standard strategy. |
switch.{type}_outside_temperature_{name} |
on |
Switches between inside and outside temperatures as the basis for determining the climate control strategy. |
Installation
HACS (Recommended)
Add GitHub - basbruss/adaptive-cover: An Adaptive Cover component for HomeAsisstant to control covers based on the sun's position as custom repository to HACS. Search and download Adaptive Cover within HACS.
Restart Home-Assistant and add the integration.
Manual
Download the adaptive_cover folder from the github. Add the folder to config/custom_components/.
Restart Home-Assistant and add the integration.
Graphs
Features Planned
-
Manual override controlspart ofv1.10
-
Time to revert back to adaptive controlpart ofv1.10
-
Reset buttonpart ofv1.10
-
Wait until next manual/none adaptive change
-
Algorithm to control radiation and/or illumination