I'd like to pull in my awning if my house's shadow has reached a point where the awning has no use any more. The house is almost perfectly aligned in a North-South direction, the garden with the awning is in the east.

My home automation (fhem) offers a module that gives me a variety of astronomic parameters, based on my location and altitude:

 "SunAlt": -3.3,
  "SunAz": 309.5,
  "SunDec": 22.3,
  "SunDiameter": 31.5,
  "SunDistance": 151752013,
  "SunDistanceObserver": 151752409,
  "SunHrsInvisible": "08:10",
  "SunHrsVisible": "15:49",
  "SunLon": 72.7,
  "SunRa": "04:47",
  "SunRise": "05:16",
  "SunSet": "21:05",
  "SunSign": "Zwillinge",
  "SunSignN": 2,
  "SunTransit": "13:10",

Is it enough to target sun's altitude above the horizon? I would think so, but I'm not sure... Currently I'd withdraw the awning when sun's altitude goes below 54⁰.

Edit: Sorry, I seem to have written my question in a very unclear way. Here's more information:

I know my location, at least with GPS precision. Given that location, fhem's astro module gives me all kind of information about sun, moon,...

I have a patio that's to the east of my N-S aligned house. The house is a row house, so for my purpose it's long enough that only the roof is interesting for the shadow.

Sun shines onto the patio in the morning until (currently) something like 15:00. I tend to make shadow with the awning in the morning. After 15:00, the patio is in the shadow of the house and I don't need the awning any more and I would like to remove the awning automatically.

I looked at fhem's astro module exactly at the time when the shadow was far enough on the patio that I could remove the awning. I took the "Sun altitude" value (54⁰) and now the awning is removed when the sun reaches an altitude of 54⁰

This was some days ago and I think this might not be good enough: it seems as if the shadow is extending more and more until the awning is removed. Or the other way round: It seems that I have to adjust the 54⁰ to, maybe, 50⁰ now to get the right timing.

  • $\begingroup$ Depends on what you mean by "has no use any more" Perhaps if you showed how you calculated 54 degrees it would be clearer. Is 54 working for you? Is there a problem? On another note, It's amazing that someone has put in the time to provide "sun distance" in this software! $\endgroup$
    – James K
    Commented Jun 3, 2020 at 7:21
  • $\begingroup$ I think we need the relative dimensions of the awning and the space you're trying to shade with it. $\endgroup$
    – Mike G
    Commented Jun 3, 2020 at 10:53
  • $\begingroup$ Maybe a add a photo or two of your patio near the critical time of day? $\endgroup$
    – Mike G
    Commented Jun 3, 2020 at 15:09
  • 1
    $\begingroup$ Right, indeed I read the (initial) question quite differently. The answer to this question probably is answerd that not only the sun height but also angle it reaches a certain height changes daily. $\endgroup$ Commented Jun 3, 2020 at 15:19
  • $\begingroup$ Yep, you need two angles, because the sun's latitudinal position in the sky at a given hour varies throughout the year, and I think both of the angles affect the length of the shadow your roof produces. $\endgroup$ Commented Jun 3, 2020 at 17:17

2 Answers 2


You will need both the $SunAlt$, and $SunAz$ values. You'll also need to know the height of the part of your roof casting the shadow $H$, and the distance of the far edge of the patio from the roof peak causing the shadow, measured along the ground $D_p$.

The length of the shadow cast by the roof, is

$L = H * \cos(SunAlt)$

But that length won't be cast directly towards the far edge of the awning, so you need to account for the direction $SunAz$ also. $SunAz$ is usually measured with 0 being North, and 180 being South. But you want to know the length of the shadow cast from the West, so we need to subtract 270 degrees from $SunAz$. So the final distance $D$ from the peek of the roof to the edge of the shadow is

$D = L * \cos(SunAz - 270)$

Putting both equations together yields:

$D = H * \cos(SunAlt) * \cos(SunAz - 270)$

If $D$ is greater than $D_p$, then the patio is entirely in shade.

This applies only to the actual plane of the patio though, if a person is standing/sitting on the far edge, the sun will still be in their eyes, while their feet are in shadow. To account for this, just subtract the height of the person from $H$. And it should be obvious that there is no shade on the patio if $SunAz > 180$.

I tried to draw some diagrams, but my skills just aren't up to snuff.


Your original thought, that you could just specify the Sun's altitude was correct. The shadow will reach the end of your patio at the same altitude of the Sun every day. Considering where I think you live that will only be true for late April through late August. The Sun won't reach 54 degrees at other times: the shadow will come from the southeast corner of the house at the south end of your block (if all the houses on your block are the same).


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .