Sun declination

With two values for azimuth and elevation you can define a spherical “rectangle” in the sky, within which the sun will shine in your window. This rectangle will NOT change with time, as it solely depends on the position of your window.

If you have a more complex shape because of buildings, trees or overhangs or whatever, your would need additional points to define it.

1 Like

That is exactly what I have been trying to say (but you probably put it more simply).

… and the sun and where the house is located.
The rectangle does not change but the time it would be reached and left by the sun. Check it out at suncalc.org or in → sun path chart.
In Rotterdam (N 52°) an azimuth of 150° is reached at approx 10:50h on Jun 21th and 9:45h at Dec 21th.

ps
That said, some usually don’t have to take care of the time when suns azimuth is used in an automation.

@seanomat is correct, your problem is that you are focussing in time as a trigger/condition, when it is really the position of the sun you should be focused on (and that is defined by azimuth and elevation).

1 Like

Nope, this is a misunderstanding. I never used the time as trigger nore did I advice someone to do so.
I asked Makis what his formular he used was good for, and I also told you, that I don’t understand what this might be good for…

So his answer (more or less) was that the azimuth (in degrees) does change every day - at least that is how I understood him.

Whereas I just explained (to point out that this complex formular might not be needed) that just the time when the sun beams hit a certain spherical “rectangle” changes every day.

My question still is: is there a situation when this formular has to be used? And why?

I have a similar process running in NodeRed.

Whenever I turn my heat wave boolean to on, every day between sunrise and sunset it will run a loop every 5 minutes in which it checks both the sun’s elevation as the azimuth. Depending on the outcome, it will open and close certain blinds and shutters throughout the day to keep the sun of my windows but also to let light in when the windows are no longer in the sun
.
It took a little tweaking to find the right values, but once it’s up and running it is zero maintenance.
I choose to have it based on a boolean, as I couldn’t find an automated process or value to have the system identify were in a heat wave.

I’ve made a quick 2D graph to illustrate.
Actually, as far as we are concerned, this is pure 2D.
The “hidden” coordinate is time. It’s irrelevant for the window, which never moves, but it is for the Sun, whose coordinates change all the time

What you want are the coordinates of the windows in “azimuth” (=X) and “elevation” (=Y) coordinates.
When the sun intercepts those coordinates (in t1 here), then activate your blinds (possibly taking the weather into consideration)

Hi and sorry if I confused you. As I said ended up to this formula empirically.
The x day of October 2020 I note down the azimuth value when the sunlight started to fall in my living room.
After a few days I note down again only the azimuth value and noticed that it has changed a little.
From the previous summer (July 2020) when I had tried to find a way to make this work (and give up) I have note down the azimuth value when my covers should close. Apparently the hours was different.
So for example in july the covers should close at 13:30 when azimuth value was ~178 and in October the covers should close at 11:00 when the azimuth value was ~145.
That is exactly what this sensor does.

image

My Azimuth sensor today is at 172.19 and right now Sun azimuth is at 104.78.
The automation says if My azimuth sensor is > than Sun Azimuth close the covers.

I have also some more conditions (eg the weather is sunny etc) but the logic is the above.
It is not so scientific or 100% accurate but for me at least it works

Hope that makes sense now?

Jeeez @koying I was just drawing a similar map to post.

As I have said, the sun shines in the room when it is between the right frame and the left frame, which each have a fixed azimuth, and when it is between the bottom frame and the top frame, which are each fixed elevations.

Just because the time that the sun is at the offiending co-ordinates varies at diffenet times of the year, doesn’t matter a damn. It doesn’t matter if it varies 5 minutes a day or 15 minutes a day.

In fact it won’t consistently move by a fixed number of minutes every day, because these are sinusoidal patterns and the differential over time is also sinusoidal. But it doesn’t matter, because all you really need to know is what point in the sky the sun shines in your room, not what time that is!

No it makes no sense. The sun’s azimuth is fixed for a given location and time. What is this azimuth you are calculating? In other words, the azimuth of what?

I am not sure if I can explain it better than my above post. Probably I have ended up calculating the time that the covers should close with 2 variables of Sun azimuth?

Thanks for trying to explain.
Still not clear, why would you close the cover in July at 178° and in October a 145°? There is no sun in your window in July when the sun’s at an azimuth of 145°?

no the is not in the particular window. It is facing the south

Take a look at @koying’s diagram. Lets call it northern hemisphere and from the observer the top of the window has an elevation of 45 and the bottom has an elevation of 20. The left side of the window has an azimuth of 160 and the right side an azimuth of 200. (All in degrees).

The trigger/condition is when the sun.sun azimuth is greater than 160 AND less than 200, AND the sun.sun elevation is greater than 20 AND less than 45. Easy to do in HA. Nothing to do with date.

1 Like

Indeed. Time is not a factor here. It’s baked in the azimuth and elevation calculated by sun.sun, which takes that parameter into consideration, and changes every, say, minute.

In HA terms, you just need something like

- id: '1621411103265'
  alias: Active blinds
  description: ''
  trigger:
  - platform: state
    entity_id: sun.sun
    attribute: azimuth
  - platform: state
    entity_id: sun.sun
    attribute: elevation
  condition:
  - condition: and
    conditions:
    - condition: numeric_state
      entity_id: sun.sun
      # window left
      above: 135.2
      # window right
      below: 137.8
      value_template: "{{ float(states.sun.sun.attributes.azimuth) }}"
    - condition: numeric_state
      entity_id: sun.sun
      # window bottom
      above: 35.8
      # window top
      below: 39.4
      value_template: "{{ float(states.sun.sun.attributes.elevation) }}"
  action:
  - service: script.turn_on_your_blinds
  mode: single

Ok. But where ever the sun is shining (in)to, there is sun in July at 145°, no?
In Athens in two hours :wink:

Yes, there is., but the sun is not inside my living room.

@nickrout @koying
Now I understand what you saying but can you help me find out how I can find out the correct values for my home please?

No. The azimuth is based on your location.
Check with the location of, say, Johannesburg :wink:

Don’t know what you want to say, sorry. Makis is in Greece if I got it right.

1 Like

Quite difficult to calculate.

Just, any day, check the values in sunsun` when it starts becoming annoying for you and when it stops, and iterate to refine the values…

1 Like