Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,19 @@ This mode is split up in two types of strategies; [Presence](https://github.com/

### Vertical

| Variables | Default | Range | Description |
| ----------------- | ------- | ----- | ------------------------------------------------------------------------------------------- |
| Window Height | 2.1 | 0.1-6 | Length of fully extended cover/window |
| Glare Zone | 0.5 | 0.1-2 | Objects within this distance of the cover recieve direct sunlight. Measured horizontally from the bottom of the cover when fully extended |
| Variables | Default | Range | Description |
| ----------------------- | ------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Window Height | 2.1 | 0.1-6 | Length of fully extended cover/window |
| Glare Zone | 0.5 | 0.1-10 | Objects within this distance of the cover recieve direct sunlight. Measured horizontally from the bottom of the cover when fully extended |
| Glare Height Adjustment | 0.0 | -6 - 6 | The vertical distance from the bottom of the closed blind to the shaded area. Will be negative value for 2nd story windows in tall rooms and postive value when shaded area is higher than base of window |

### Horizontal

| Variables | Default | Range | Description |
| -------------------------- | ------- | ----- | ---------------------------------------------- |
| Awning Height | 2 | 0.1-6 | Height from work area to awning mounting point |
| Awning Length (horizontal) | 2.1 | 0.3-6 | Length of the awning when fully extended |
| Awning Angle | 0 | 0-45 | Angle of the awning from the wall |
| Variables | Default | Range | Description |
| -------------------------- | ------- | ----- | ----------------------------------------------------------------- |
| Awning Height | 2 | 0.1-6 | Height from work area to awning mounting point |
| Awning Length (horizontal) | 2.1 | 0.3-6 | Length of the awning when fully extended |
| Awning Angle | 0 | 0-45 | Angle of the awning from the wall |
| Glare Zone | 0.5 | 0.1-2 | Objects within this distance of the cover recieve direct sunlight |

### Tilt
Expand Down
4 changes: 3 additions & 1 deletion custom_components/adaptive_cover/calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,14 @@ class AdaptiveVerticalCover(AdaptiveGeneralCover):

distance: float
h_win: float
shaded_height_delta: float

def calculate_position(self) -> float:
"""Calculate blind height."""
# calculate blind height
blind_height = np.clip(
(self.distance / cos(rad(self.gamma))) * tan(rad(self.sol_elev)),
(self.distance / cos(rad(self.gamma))) * tan(rad(self.sol_elev))
+ self.shaded_height_delta,
0,
self.h_win,
)
Expand Down
9 changes: 8 additions & 1 deletion custom_components/adaptive_cover/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
CONF_PRESENCE_ENTITY,
CONF_RETURN_SUNSET,
CONF_SENSOR_TYPE,
CONF_SHADED_HEIGHT_DELTA,
CONF_START_ENTITY,
CONF_START_TIME,
CONF_SUNRISE_OFFSET,
Expand Down Expand Up @@ -170,7 +171,12 @@
),
vol.Required(CONF_DISTANCE, default=0.5): selector.NumberSelector(
selector.NumberSelectorConfig(
min=0.1, max=2, step=0.1, mode="slider", unit_of_measurement="m"
min=0.1, max=10, step=0.1, mode="slider", unit_of_measurement="m"
)
),
vol.Required(CONF_SHADED_HEIGHT_DELTA, default=0.0): selector.NumberSelector(
selector.NumberSelectorConfig(
min=-6, max=6, step=0.1, mode="slider", unit_of_measurement="m"
)
),
}
Expand Down Expand Up @@ -580,6 +586,7 @@ async def async_step_update(self, user_input: dict[str, Any] | None = None):
CONF_FOV_RIGHT: self.config.get(CONF_FOV_RIGHT),
CONF_ENTITIES: self.config.get(CONF_ENTITIES),
CONF_INVERSE_STATE: self.config.get(CONF_INVERSE_STATE),
CONF_SHADED_HEIGHT_DELTA: self.config.get(CONF_SHADED_HEIGHT_DELTA),
CONF_SUNSET_POS: self.config.get(CONF_SUNSET_POS),
CONF_SUNSET_OFFSET: self.config.get(CONF_SUNSET_OFFSET),
CONF_SUNRISE_OFFSET: self.config.get(CONF_SUNRISE_OFFSET),
Expand Down
1 change: 1 addition & 0 deletions custom_components/adaptive_cover/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
CONF_TILT_DEPTH = "slat_depth"
CONF_TILT_DISTANCE = "slat_distance"
CONF_TILT_MODE = "tilt_mode"
CONF_SHADED_HEIGHT_DELTA = "height_adjustment_shaded_area"
CONF_SUNSET_POS = "sunset_position"
CONF_SUNSET_OFFSET = "sunset_offset"
CONF_SUNRISE_OFFSET = "sunrise_offset"
Expand Down
2 changes: 2 additions & 0 deletions custom_components/adaptive_cover/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
CONF_OUTSIDETEMP_ENTITY,
CONF_PRESENCE_ENTITY,
CONF_RETURN_SUNSET,
CONF_SHADED_HEIGHT_DELTA,
CONF_START_ENTITY,
CONF_START_TIME,
CONF_SUNRISE_OFFSET,
Expand Down Expand Up @@ -692,6 +693,7 @@ def vertical_data(self, options):
return [
options.get(CONF_DISTANCE),
options.get(CONF_HEIGHT_WIN),
options.get(CONF_SHADED_HEIGHT_DELTA),
]

def horizontal_data(self, options):
Expand Down
8 changes: 6 additions & 2 deletions custom_components/adaptive_cover/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"data": {
"set_azimuth": "Window Azimuth",
"window_height": "Window Height",
"distance_shaded_area": "Shaded area",
"distance_shaded_area": "Shaded Area",
"height_adjustment_shaded_area": "Shaded Area Height Adjustment",
"default_percentage": "Default Position",
"max_position": "Maximum Position",
"fov_left": "Field of view left",
Expand All @@ -58,6 +59,7 @@
"set_azimuth": "Adjust Azimuth",
"window_height": "Specify window height in meters",
"distance_shaded_area": "Distance from cover to shaded area in meters",
"height_adjustment_shaded_area": "Distance from the bottom of the closed blind to the shaded area",
"default_percentage": "Default cover position as a percentage",
"max_position": "Maximum adjustable cover position as a percentage",
"fov_left": "Field of view angle to the left of the window center",
Expand Down Expand Up @@ -258,7 +260,8 @@
"data": {
"set_azimuth": "Window Azimuth",
"window_height": "Window Height",
"distance_shaded_area": "Shaded area",
"distance_shaded_area": "Shaded Area",
"height_adjustment_shaded_area": "Shaded Area Height Adjustment",
"default_percentage": "Default Position",
"max_position": "Maximum Position",
"fov_left": "Field of view left",
Expand All @@ -278,6 +281,7 @@
"set_azimuth": "Adjust Azimuth",
"window_height": "Specify window height in meters",
"distance_shaded_area": "Distance from cover to shaded area in meters",
"height_adjustment_shaded_area": "Distance from the bottom of the closed blind to the shaded area",
"default_percentage": "Default cover position as a percentage",
"max_position": "Maximum adjustable cover position as a percentage",
"fov_left": "Field of view angle to the left of the window center",
Expand Down
4 changes: 4 additions & 0 deletions custom_components/adaptive_cover/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"set_azimuth": "Window Azimuth",
"window_height": "Window Height",
"distance_shaded_area": "Glare Zone",
"height_adjustment_shaded_area": "Shaded Area Height Adjustment",
"default_percentage": "Default Position",
"min_position": "Minimum Position",
"max_position": "Maximum Position",
Expand All @@ -61,6 +62,7 @@
"set_azimuth": "Adjust Azimuth",
"window_height": "Specify window height in meters",
"distance_shaded_area": "Objects within this distance from the cover recieve direct sunlight. Distance measured horizontally from the bottom of the cover when the cover is fully extended.",
"height_adjustment_shaded_area": "Distance from the bottom of the closed blind to the shaded area",
"default_percentage": "Default cover position as a percentage",
"min_position": "Minimum adjustable cover position as a percentage",
"max_position": "Maximum adjustable cover position as a percentage",
Expand Down Expand Up @@ -272,6 +274,7 @@
"set_azimuth": "Window Azimuth",
"window_height": "Window Height",
"distance_shaded_area": "Glare Zone",
"height_adjustment_shaded_area": "Shaded Area Height Adjustment",
"default_percentage": "Default Position",
"min_position": "Minimum Position",
"max_position": "Maximum Position",
Expand All @@ -294,6 +297,7 @@
"set_azimuth": "Adjust Azimuth",
"window_height": "Specify window height in meters",
"distance_shaded_area": "Objects within this distance from the cover recieve direct sunlight. Distance measured horizontally from the bottom of the cover when the cover is fully extended.",
"height_adjustment_shaded_area": "Distance from the bottom of the closed blind to the shaded area",
"default_percentage": "Default cover position as a percentage",
"min_position": "Minimum adjustable cover position as a percentage",
"max_position": "Maximum adjustable cover position as a percentage",
Expand Down