and beyond that, one may wants to prefer a awning thats mounted over the window if its not raining or windy or the awning wont cover enough of the window.
or has a roof window at an angle
or has shading by other objects and only requires shading in other azimuth degres.
and my want that it closes/open on dusk and dawn, probably on two steps, like pre open, open and pre close and close, depending on lux
and as well, one may want to asses the cloud level and the forecast temp and indoor temp or if an AC is running etc. pp
it would get quite complicated.
Here are all the variables I think would be likely needed.
User input mainly, but also some sensor values.
First we need these global variables:
- forecast out door temperature for the day
- global indoor temp limit with no AC
- global indoor temp limit with AC of room
- global indoor temp limit with global AC status
- global flat/house indoor temp for if no room temp entity available
- cloud level status in %
- cloud level to activate shading
- sun elevation
- sun azimut
- wind speed sensor
- rain event sensor
- LUX sensor
- global switch shading: on / off for for time x / off permanent
- global switch nightly shutters: on / off for time x / off permanent
now we need window facts for each window.
- window number
-
-
-
- window related switch shading: on / off for for time x / off permanent
-
- window related switch nightly shutters: on / off for time x / off permanent
-
- room temp entity (if not available, use globale indoor temp)
-
- sensor for room AC-Status (if not available use global if not available assume AC off)
-
- room temp limit without AC
-
- A/C status (always shade when on “cooling”)
-
- direction the window is facing in decimal ° compass direction
-
- deviation from vertical if e.g. roof window
-
-
- width of wall including inside window sill in mm
-
- acceptable width of sun streaks (AWS) in mm
-
- depth of the shutter from outside wall
-
- azimut deviation from window direction to start shading (would be mostly negative)
-
- azimut deviation from window direction to stop shading (would be mostly positive)
-
- minimum elevation that is required for shading (max elevation will be calculated for each window by wall thickness (width of window) and AWS) out side of those two limits shutter will be at 100%
-
- start shading in % of roller shutter
-
- fully shaded in % of roller shutter
-
- max shading position (e.g. to prevent lock out from terrace doors or animals from their doors)
-
- two step opening in morning? (y/n)
-
-
- offset for non working days (y/n)
-
-
-
- step one opening on lux > xx
-
-
- step one opening lux duration
-
-
- step one opening fallback elevation
-
-
-
- step two opening on lux > xx
-
-
- step two opening lux duration
-
-
- step two opening fallback elevation
-
-
- step two opening in % (100% usually)
-
- two step closing in evening y/n
-
-
- step one closing on lux < xx
-
-
- step one closing lux duration
-
-
- step one closing fallback elevation
-
-
-
- step one closing ignore max shading position to prevent lockout of animals y/n
-
-
-
- time offset after step one to close to 0%
-
-
-
- step two closing on lux < xx
-
-
- step two closing lux duration
-
-
- step two closing fallback elevation
-
-
- step two closing in % (0% usually)
-
-
- step two closing ignore max shading position to prevent lockout of animals y/n
-
-
-
- time offset after step two to close to 0%
-
-
-
- prefer awning over shutter for shading (y/n)
-
-
- fall back to shutter on wind speeds over
-
-
- fall back to shutter on rain (y/n)
-
-
-
- start shading with awing %
-
-
- 100% of awning shades 100% (including AWS) on sun elevation °
-
-
- fall back if awning cant shade 100% (y/n)
-
-
- % when to fall back if awning cant shade 100%
First we need some code that puts that all into perspective.
Then we need an automation, that runs every time the azimuth changes 1 full degree and considers all these values to come to a conclusion for the roller shutter or awing of each window and sets their cover.set_cover_position and then move on to the next one. Rinse and repeat.
The algebra part is pretty straight forward:
Wall thickness + indoor window sill + acceptable sun stake - position of roller shutter in the wall = one part of the triangle (a)
The other one (b) we get with
tan(alpha) * a = b
where alpha is the elevation
b is the position inside the full window height for the roller shutter to archive good shading by the owners specification.
so we could easily calculate a percentage from that.
100 / windows height * b = % to be closed (x)
Now we need to calculate the roller shutter position, we got a no shading value (c), probably 98%, and a full shading value (d), probably at about 15% so we have
c - d = e (100% distance from no to full shading)
e * x + c = roller shutter position in %
Now we need to calculate from what elevation on the roller shutter could be fully open. but this could also be entered by the user, since there could be a balcony or a roof eaves that shades the window in a different way than just the wall and its thickness.
What do you say @123 doable?
of course we need a variable block for global and each window and some automation that would consider the rest of the global variables like the temps and clouds and so on.
I think I got the algebra for the opening position inside this string
edit says: forget about this, the formula is all wrong, im working on it in the thread linkt with the 4 in 1 automation to posts further down. The solution will be there when I am finished with the roller shutter stuff.
set a = #deviation from vertical if e.g. roof window
set b = #height of window in mm
set c = #width of wall including inside window sill in mm
set d = #acceptable width of sun streaks (AWS) in mm
set e = #depth of the shutter from outside wall
set f = #start shading in % of roller shutter
set g = #fully shaded in % of roller shutter
set shutter_shading_pos = ((tan('sun.azimuth' + a) * 0,01 * (c + d) * b * (f - g)) + g)