Roof blind shade template

Hello everyone, I have been using home assistant for a while now, but now I want to automate my roof window blinds because it gets very hot in the storage room on warm, sunny days.

Up until now I used a simple automation that used the interior temperature as a trigger.

Which worked so far.

Now I have expanded my hardware and I am able to move the blinds individually to a desired position, which could now enable me to control a good balance between shading and sufficient light.

I would like to create a way to regulate the shading of the roof windows depending on the azimuth, so that, for example, there is no shading if the azimuth is below 128 and above 207 on March 18th.

I have already determined the values ​​for the individual directions and days.

I was also able to limit these values ​​in the template editor: azimuth within two values ​​and date within two days, for example between July 1st and July 15th

{% set start = now().replace(day=1, month=7).date() %}
{% set end = now().replace(day=15, month=7).date() %}
{% set low, high = [start, end] | min, [start, end] | max %}
{% set current = low <= now().date() <= high %}
{{ not current if start > end else current }}

{{ states('sensor.sonne_solar_azimuth')|float >= 202 and states('sensor.sonne_solar_azimuth') | float < 308 }}

Here are the values ​​I determined

My idea is that I will end up with 4 sensors, one each for north, east, south and west, which will give me true or false for the current day (now).

Example:
Wednesday July 3rd 3:30pm → south = true
because azimuth for south is between 51 and 207

I am still relatively inexperienced with home assistant automations using templates,
or creating a template sensor that gives me this result back, but unfortunately I am too inexperienced here too.

You might want to take a look at the Adaptive Cover HACS integration, I think it will simplify your system quite a bit as it already supports using awnings, which for all intents and purposes yours would be. It may not work well for a skylight, I don’t know, but it would be worth playing with to see if it does.

Hello CO_4X4,
thank you for your answer and the link to the repository.
I know of such repositories and blueprints, similar to this CCA “ha-blueprints/blueprints/automation at main · hvorragend/ha-blueprints · GitHub”.

They are all well made.
Unfortunately, I miss the individuality throughout the year, but I don’t want to reject it and will also test your suggestion.
Regardless, I would still like to try it myself to improve my skills with templates.