diff --git a/README.md b/README.md index b7ca355..9a1d44a 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,46 @@ Restart Home-Assistant and add the integration. ## Setup -Adaptive Cover supports (for now) three types of covers/blinds; Vertical and Horizontal and Venetian (Tilted) blinds. +Adaptive Cover supports (for now) three types of covers/blinds; `Vertical` and `Horizontal` and `Venetian (Tilted)` blinds. Each type has its own specific parameters to setup a sensor. To setup the sensor you first need to find out the azimuth of the window(s). This can be done by finding your location on [Open Street Map Compass](https://osmcompass.com/). -### Simulation +## Strategy + +This component supports two strategy modes: A `basic` mode and a `climate comfort/energy saving` mode that works with presence and temperature detection. + +### Basic mode + +This mode uses the calculated position when the sun is within the specified azimuth range of the window. Else it defaults to the default value or after sunset value depending on the time of day. + +### Climate mode + +This mode calculates the position based on extra parameters for presence, indoor temperature, minimal comfort temperature and maximum comfort temperature. +This mode is split up in two types of strategies. + +#### No Presence + +Providing daylight to the room is no objective if there is no presence. + +##### Below minimal comfort temperature: +If the sun is above the horizon and the indoor temperature is below the minimal comfort temperature it opens the blind fully or tilt the slats to be parallel with the sun rays to allow for maximum solar radiation to heat up the room. + +##### Above maximum comfort temperature: + +The objective is to not heat up the room any further by blocking out all possible radiation. All blinds close fully to block out light. + +If the indoor temperature is between both thresholds the position defaults to the set default value based on the time of day. + +#### Presence + +The objective is to reduce glare while providing daylight to the room. All calculation is done by the basic model for Horizontal and Vertical blinds. + +Tilted blinds will only defect from the above approach if the inside temperature is above the maximum comfort temperature. Than the slats will be positioned at 45 degrees as this is [founded optimal](https://www.mdpi.com/1996-1073/13/7/1731). + +### Simulation ![combined_simulation](custom_components/adaptive_cover/simulation/sim_plot.png) ### Blueprint This integration provides the option to download a blueprint to control the covers automatically by the provide sensor. -By selecting the option the blueprints will be added to your local blueprints folder. +By selecting the option the blueprints will be added to your local blueprints folder. \ No newline at end of file diff --git a/custom_components/adaptive_cover/calculation.py b/custom_components/adaptive_cover/calculation.py index 2483476..809eb28 100644 --- a/custom_components/adaptive_cover/calculation.py +++ b/custom_components/adaptive_cover/calculation.py @@ -25,6 +25,7 @@ class AdaptiveGeneralCover(ABC): win_azi: int h_def: int sun_data: SunData = field(init=False) + def __post_init__(self): """Add solar data to dataset.""" self.sun_data = SunData(self.timezone, self.hass) @@ -112,7 +113,7 @@ def calculate_percentage(self) -> int: @dataclass -class NormalCoverState(): +class NormalCoverState: """Compute state for normal operation.""" cover: AdaptiveGeneralCover @@ -180,7 +181,8 @@ def normal_type_cover(self) -> int: # glare does not matter if ( self.climate_data.is_presence is False - and self.climate_data.temp is not None and self.cover.sol_elev > 0 + and self.climate_data.temp is not None + and self.cover.sol_elev > 0 ): # allow maximum solar radiation if self.climate_data.is_winter: