Calculating the Position of the Sun for a location baed on Date and time to lower Blinds

Hi,
I currently have an automation, which based on Sunset/Sunrise opens and lowers the Blinds.

Now based on the hotter summer time I would like to dynamic lower the West facing Blinds if the sun is moving into West, in order to prevent excessive heat up in the West rooms.

Has anyone, based on location , date and time, calculated the position of the sun?
There are websites e.g. Calculation of sun’s position in the sky for each location on the earth at any time of day but my knowledge of coding is a bit limited for this task.

You already have that data in HA, no need to calculate it.

The azimuth and elevation tell you where the sun is relative to your location.

1 Like

There’s a great thread here about setting up sensors to correlate the sun’s position to the plane of your windows. I use the variation in post #15, “hacking” the elevation variable to account for any static overhangs, awnings, or covered porches…

4 Likes

Here are some automations to get you started:

Opening your blinds (mine is for my awning, with some additional conditions to insure I am extending it when the temp requires it to help cool the house)

alias: Awning-Open if Temp above 70 or cooling the day before
description: ""
trigger:
  - platform: numeric_state
    entity_id: sun.sun
    attribute: azimuth
    above: 172
    below: 270
condition:
  - condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.home_wind_gust
        below: 20
      - condition: or
        conditions:
          - condition: numeric_state
            entity_id: sensor.temperature_high_forecast
            above: 70
          - condition: numeric_state
            entity_id: sensor.hvac_cooling_run_time_last_24hr
            above: 0
    enabled: true
action:
  - service: cover.stop_cover
    data: {}
    target:
      entity_id: cover.deck_awning
mode: single

Closing the awning:

alias: Awning-Close when Azimuth at 270
description: ""
trigger:
  - platform: numeric_state
    entity_id: sun.sun
    attribute: azimuth
    above: 270
    below: 360
condition: []
action:
  - service: cover.close_cover
    data: {}
    target:
      device_id: 9c72d07155cdae9e0d429e855138111e ***NOTE***: Awning
mode: single
2 Likes

Just to let you know, I have made a new post which has all the details to make it work with your blinds:

Automatic blinds / sunscreen control based on sun platform

This should be much easier to use.

1 Like