alias: Close Kitchen Patio Blinds with PM sun and 25 degrees
initial_state: True
trigger:
platform: numeric_state
entity_id: sun.sun
value_template: '{{ state.attributes.elevation }}'
below: 58
condition:
condition: and
conditions:
- condition: time
after: '14:00:00'
before: '18:00:00'
- condition: numeric_state
entity_id: sensor.yr_temperature
above: 24.0
action:
- service: cover.set_cover_position
data_template:
entity_id:
- cover.kitchen_patio_blind_level
position: 30
which was in response to the sun shining through the kitchen window.
It works exactly as I wanted it to, and the elevation of 58 was based on trial and error over a couple of days.
The problem/challenge is that nature is not simple, and the reality now in August is that I need to determine when the blind comes down based on azimuth as well as elevation.
Does anyone have even the most basc idea of how to do this???
I thought I could avoid this by giving the automation a different trigger elevation dependant on the week, or fornnight, but I am not sure how that code would look, eg: “if it is week 26, then lower blind when elevation <58, if it is week 27, then lower blind when elevation <56 etc…”, otherwise, is there some way to build a look-up table combining elevation and azimuth that wuld allow the automation to trigger when a combination of those two values are met.
I hope you can see my problem and my ambition to solve it, sorry it’s complicated!
The direction your window faces will make the factor zero when the azimuth is the same as your window direction.
It will be negative on one side of that location, and positive on the other.
There may be some scientific method to determine what the unknown factor is, but it will take someone smarter than me to figure it out. This might be another case for trial and error.
My window faces 285, so I’m going to use your approach and see what I get.
I have two data points of when (time wise) the blind needs to come down, 1st June, as I remember from when I firstset this up, and today, from looking out of the window. I also have (through the power of the internet) the elevation/azimuth data for all of this year at this location, so I should be able to make a start on the division factor from those two days alone.
Short answer is yes, although I will have to monitor it for a few weeks to make sure the logic keeps up with the changing path of the sun throughout the year. Here is the automation, bear in mind the number “285” is the direction my window faces.
No, 285 is the direction the window faces, so the sun creeps round at 285 - 90.
The factor is pure observation, I looked at the moment t by email sun came through and then grabbed the azimuth and elevation from HA and derived the factor for that moment
for example in my case i observed that with an elavation of 48 and an azimuth of about 244 i would need to set my shutter position to 15. So my vaule should be 244?
285, in your version, will be the direction your window faces.
Wait until unwanted sun starts to come into your window, and at that moment get the current elevation and azimuth values from HA. Put these two into the equation and then work out what your “factor” (mine being 0.7) needs to be to make the equation sum to zero.