Trying to get 4 shutter automations into one and shading like in FHEM

Folks, I try to get my shutter automation"s" into one single automation.

I currently have 4 automations with no shading option, so I also want to add the sun shading to this single big automation, if possible.

But I dont see if this is possible, hence I ask here, and since we got a bunch of shutters and awnings, its going to get a bit crowded by the shutters alone if I keep my “one automation per step” style up.

I also struggle with the climacell_hourly max for 14:00:00, I see it in lovelace, but cant get it in automations or yaml code.

I have sonoff Dual R2 tasmota controlled electric shutters (0-10% is only the lamellaes geting stretched, from 10% on there is an opening on the bottom of the shutter, at 98% the shutters vanish from the window),

They all

  • pre-open on sun.sun elevation -6° and sun.sun rising to 20 %
  • fully open when first daylight is detected (>1 Lux from WH2900 weather station) or when elevation is >5° (in case snow on sensor or battery dead of WH2900) and sun.sun rising to 100%
  • pre-close on < 1 Lux for 5 min. from WH2900 or -5° elevation and sun.sun rising false to 20%
  • fully closed on -12° elevation and sun.sun rising false to 0%

Here is my code from automations.yaml, they are working just fine, I deleted all devices from each except the first to keep it a bit shorter. (they just go on with cover_2, cover_3 etc. I start at North and go clocwise, so cover_2 is east facing etc.

(I may need to reconsider the pre-close for when the WH2900 sensor is dead for what ever reason and then probably reports constantly 0, it may starts closing the shutter at noon when sun.sun rising switches over to false. Haven’t tried that one yet. Probably need to add a condition, not before Elevation is < +5° or so. Does somebody have experience with that issue on the WH2900 (ecowitt integration via MQTT)

- id: '1642887933217'
  alias: shutter - open to 20% at -6° and rising
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sun.sun
    attribute: elevation
    above: '-6'
  condition:
  - condition: state
    entity_id: sun.sun
    state: true
    attribute: rising
  action:
  - device_id: 15ee956a205e5fcb8c951520eed6eb72
    domain: cover
    entity_id: cover.tasmota_cover_1
    type: set_position
    position: 20
  mode: single
- id: '1642888136771'
  alias: shutter - close to 20% at Lux <1 or rlevation < -5 and not rising
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.solar_radiation
    for:
      hours: 0
      minutes: 5
      seconds: 0
    below: '1'
  - platform: numeric_state
    entity_id: sun.sun
    attribute: elevation
    below: '-5'
  condition:
  - condition: and
    conditions:
    - condition: state
      entity_id: sun.sun
      state: false
      attribute: rising
    - condition: numeric_state
      entity_id: sun.sun
      attribute: elevation
      below: '5'
  action:
  - device_id: 15ee956a205e5fcb8c951520eed6eb72
    domain: cover
    entity_id: cover.tasmota_cover_1
    type: set_position
    position: 20
  mode: single
- id: '1642888195982'
  alias: shutter - close to 0% at -12° and not rising
  description: ''
  trigger:
  - platform: numeric_state
    attribute: elevation
    entity_id: sun.sun
    for:
      hours: 0
      minutes: 0
      seconds: 0
    below: '-12'
  condition:
  - condition: state
    entity_id: sun.sun
    state: false
    attribute: rising
  action:
  - device_id: 15ee956a205e5fcb8c951520eed6eb72
    domain: cover
    entity_id: cover.tasmota_cover_1
    type: set_position
    position: 0
  mode: single
- id: '1642888694478'
  alias: shutter - open to 100% at Lux >1 or elevation > 5 and rising
  description: ''
  trigger:
  - platform: numeric_state
    above: '1'
    entity_id: sensor.solar_radiation
  - platform: numeric_state
    entity_id: sun.sun
    attribute: elevation
    above: '5'
  condition:
  - condition: state
    entity_id: sun.sun
    state: true
    attribute: rising
  action:
  - device_id: 15ee956a205e5fcb8c951520eed6eb72
    domain: cover
    entity_id: cover.tasmota_cover_1
    type: set_position
    position: 100
  mode: single

For the shading I tried to follow this one

how to automation for blinds in here

But I could not get my forecast value from Climacell_hourly for say 14:00:00, its there in lovelace, but I cant get it in the automation. Yes Im still novice with HA, have been running a FHEM for years, but never got a nice front end done. So the WAF (wife acceptance factor) was negative and that’s a sure project killer. She saw HA at a friends home and he told me how easy the front end was. Here I am.

Also I’m at a loos for the shutter position calculation. in FHEM there was a template, where you would enter the window height, the direction the window is facing (if its roof, also its angle deviation from vertical) and the wall thickness and where the shutter comes down measured from outside wall, the inside windowsill width (but I think that was in the wall thickness included) etc. and it would calculate the position for the shutter from that data and move all shutters individually on a given interval (say 4 mins or so) to the now new position. That fit almost perfect right out of the box. a bit tuiking and it was awesome. It had to fit, as we did not have a way to modify the shutter manually, due to missing front end… the WAF was still negative on FHEM, for the missing option to control them manually, but at least she did not kick my but every day, only so often when she wanted a shutter at an other position and could not move it.

(I also would need a switch for each shutter to activate night closing and shading individually)

I do not need to replicate this, I only got windows with shading requirements going straight to 90°, 180° and 270°, all vertical.

But I am pretty sure, there are lots of folks who live in plenty hotter areas, and would love such an easy template. put in all windows, and your conditions, and its moving like a miracle.

For starts I would be pretty happy if I would have to calculate or measure the opening % for each window in regard to elevation during the next summer and hardcode a table with all angles into HA for each window. I do not expect them to change that much in the next 40 years :slight_smile: if so we absolutely do have other problems to worry about :-D.

(I also could let FHEM handle the shading, but my VM capability is limited on my server, so I would like to switch of FHEM, its eating on my memory just for the shading…, and all interactions from HA would be nixed 4 minutes later by the next shading position from FHEM)

For Azimuth I would choose direction of window +/- 45° as sufficient range to activate shading.

My location has a max of 65,5° of elevation and a min elevation of about 17°. So my rule of thump would be upward of 35° of noon elevation I would generally activate the shading module.

Then I would like to use the climacell hourly 14:00 forecast to check if the day gets warmer than say 25°C, better maybe check for the highest temp of the day.

If so I would query the azimuth from -45° to +45° from the window in question every full ° (about every 4 minutes) if:

  • current cloud cover is more than 60%
  • if yes → go to 100% (open) (no shading required)
  • if no → check for indoor temp from WH2900, over 22°C and Daikin AC is off (or if Daikin A/C is on then shading is active if indoor is over 18°C)
  • move shutter to position according to calculation based on direction, size, width and sun elevation.

So every 4 minutes the shutters move, to new shading position or open up all the way.

Of course below -45° and above +45° azimuth relative to window its all open too.

Anybody has something like this?

Regards
Manne

Continued searching the community, found this one, but its way over my current HA ability to integrate it…

https://community.home-assistant.io/t/some-help-needed-in-combining-multiple-window-cover-automations-based-on-azimuth-into-one-single-automation

edit:

after I found that my azimuth sensor was named difrently, stupid, I know, the code is now working. @Guesswho620 said he will post his up todate over there, but well, this one is working just fine:

automation working copy paste for west windosw, just make sure your azimuth sensor has the same name and put your shutter entidy in

easiest way: create new blank automation, top right corner switch to YAML, and just paste his code, change the sensor and entity to yours, done

and here is the calculations for east, south and west together, but not as an copy paste automation

1 Like

I tried to get all the variables and here is my drawing for it:

First we need the global variables:

  • forecast out door temperature for the day
  • global indoor temp limit with no AC
  • global indoor temp limit with AC of room
  • global indoor temp limit with global AC status
  • global flat/house indoor temp for if no room temp entity available
  • cloud level status in %
  • cloud level to activate shading
  • sun elevation
  • sun azimut
  • wind speed sensor
  • rain event sensor
  • LUX sensor
  • global switch shading: on / off for for time x / off permanent
  • global switch nightly shutters: on / off for time x / off permanent

now we need window facts for each window.

  • window number
    • friendly name
    • roller shutter entity
    • window related switch shading: on / off for for time x / off permanent
    • window related switch nightly shutters: on / off for time x / off permanent
    • room temp entity (if not available, use globale indoor temp)
    • sensor for room AC-Status (if not available use global if not available assume AC off)
    • room temp limit without AC
    • A/C status (always shade when on “cooling”)
    • direction the window is facing in decimal ° compass direction
    • deviation from vertical if e.g. roof window
    • height of window in mm
    • width of wall including inside window sill in mm
    • acceptable width of sun streaks (AWS) in mm
    • depth of the shutter from outside wall
    • azimut deviation from window direction to start shading (would be mostly negative)
    • azimut deviation from window direction to stop shading (would be mostly positive)
    • minimum elevation that is required for shading (max elevation will be calculated for each window by wall thickness (width of window) and AWS) out side of those two limits shutter will be at 100%
    • start shading in % of roller shutter
    • fully shaded in % of roller shutter
    • max shading position (e.g. to prevent lock out from terrace doors or animals from their doors)
    • two step opening in morning? (y/n)
      • offset for non working days (y/n)
      • offset time
      • step one opening on lux > xx
      • step one opening lux duration
      • step one opening fallback elevation
      • step one opening in %
      • step two opening on lux > xx
      • step two opening lux duration
      • step two opening fallback elevation
      • step two opening in % (100% usually)
    • two step closing in evening y/n
      • step one closing on lux < xx
      • step one closing lux duration
      • step one closing fallback elevation
      • step one closing in %
      • step one closing ignore max shading position to prevent lockout of animals y/n
        • time offset after step one to close to 0%
      • step one closing ignore
      • step two closing on lux < xx
      • step two closing lux duration
      • step two closing fallback elevation
      • step two closing in % (0% usually)
      • step two closing ignore max shading position to prevent lockout of animals y/n
        • time offset after step two to close to 0%
    • awning over window (y/n)
      • prefer awning over shutter for shading (y/n)
      • fall back to shutter on wind speeds over
      • fall back to shutter on rain (y/n)
      • entity of awning
      • start shading with awing %
      • 100% of awning shades 100% (including AWS) on sun elevation °
      • fall back if awning cant shade 100% (y/n)
      • % when to fall back if awning cant shade 100%

Now we need an automation, that runs every time the azimuth changes 1 full degree and considers all these values to come to a conclusion for the roller shutter or awing of each window and sets their cover.set_cover_position and then move on to the next one.

i work on the algebra for the cover position right now.

I think this is the algebra string for calculation the shutter position

@finity & @123

I made a template test code with all the math inside to simulate the sun (kind of, not the compound curves the sun really does, just linear movement, but it should be good enough for testing the roller shutter math), but I cant get the code to work with for x in range etc.

Ive spent now 100 times the time on the python code compared to working out the math…

could one of you take a look and point out where im wrong?

{#Code to simulate azimuth and elevation for testing a roller shutter template#}

{% set a = 0.5 %} {#  enter azimuth increments (how fast and detailed it runs) #} 
{% set b = 67  %} {# enter max elevation (for the location you want to test) #} 
{% set c = b - 80 %} {# no input here, calculates the lower elevation #}
{% set d = 80 / 180 * a %} {# no input here, calculates the elevation per azimuth increment#}

These are the Variables the code will run with
Upper Elevation: {{ b }}
Lower Elevation: {{ c }}
Set Increments: {{ a }}
Elevation step per increment:  {{ d }}

{% for x in range(a, 360, a) -%}
  {% if x <= 180 -%} 
    {{ set y = (x*d/a)+c }}
  {%- else -%}
    {{ set y = ((x-(2*(x-180)))*d/a)+c }}
  {%- endif-%}

    {% set test = {  "azimuth": x,  "elevation": y } %}
  {{ x + 1 }}
  {{ event.wait(0.001) }}
{%- endfor %}

Results: {# values should change ever second from azimuth 0,5 -> 360 and print the elevation fitting to the printed azimuth as well #}
Azimuth: {{ test.azimuth }}
Elevation: {{ test.elevation }}

could I have a lovelace card monitor and record stuff created in the devtools.template

Otherwise I would need also a hint how to make this output a “sensor” that I could monitor and reference in the next code to test the roller shutter algorithm.

got it to work, sort of

{#Code to simulate azimuth and elevation for testing a roller shutter template#}

{% set e = 20 %} {#  enter azimuth increments #} 
{% set b = 67  %} {# enter max elevation #} 
{% set c = b - 80 %} {# no input here, calculates the lower elevetion#}
{% set d = 80 / 180 * e %} {# no input here, calculates the elevation per aimuth increment#}

Set Variables
Upper Elevation: {{ b }}
Lower Elevation: {{ c }}
Set Increments: {{ e }}
Elevation step per increment:  {{ d }}

{% for x in range(e, 360, e) -%}
{% set azimuth = x %}
{% if x <= 180 -%}
  {% set elevation = (x*d/e)+c %}
{%- else -%}
  {% set elevation = ((x-(2*(x-180)))*d/e)+c %}
{%- endif %}
Azimuth is {{ azimuth }} Elevaton is {{ elevation }}
{%- endfor %}

Result: {# should change ever second from azimuth 0,5 -> 360 and print the right elevation as well #}
{#Azimuth: {{ test.azimuth }}
Elevation: {{ test.elevation }} {##}

but it prints a long table, what i want is it to change the state of the two “test devices” and wait for a second, then refresh the result…
type or paste code here

The following comments are for your original, non-functional example (not the most recent one you posted).

The scope of a Jinja2 variable within a for-loop is limited to the for-loop. That means when you assign a value to the variable y inside the for-loop, outside the for-loop the variable y will not have the assigned value.

To mitigate this behavior you have to use namespace which allows for the definition of variables that retain their value outside the for-loop after they have been modified inside the for-loop. I employed it in the example below.

I’m unfamiliar with event.wait(0.0001) and apparently so is the Jinja2 interpreter. I removed it.

I think the biggest obstacle is that fact that range requires integer values and you have supplied it with a float. I changed the value of a to 1 (if you absolutely require a float then you will have to redesign it … somehow).

This executes on my system without errors but whether it produces useful data is something you’ll have to decide.

{% set a = 1 %} {#  enter azimuth increments (how fast and detailed it runs) #} 
{% set b = 67  %} {# enter max elevation (for the location you want to test) #} 
{% set c = b - 80 %} {# no input here, calculates the lower elevation #}
{% set d = 80 / 180 * a %} {# no input here, calculates the elevation per azimuth increment#}

These are the Variables the code will run with
Upper Elevation: {{ b }}
Lower Elevation: {{ c }}
Set Increments: {{ a }}
Elevation step per increment:  {{ d }}

{% set ns = namespace(y=0.0, test={}) %}

{% for x in range(a, 360, a) -%}
  {% if x <= 180 -%} 
    {% set ns.y = (x*d/a)+c %}
  {%- else -%}
    {% set ns.y = ((x-(2*(x-180)))*d/a)+c %}
  {%- endif-%}
  {% set ns.test = {  "azimuth": x,  "elevation": ns.y } %}
  {{ x + 1 }}
{%- endfor %}

Results: {# values should change ever second from azimuth 0,5 -> 360 and print the elevation fitting to the printed azimuth as well #}
Azimuth: {{ ns.test.azimuth }}
Elevation: {{ ns.test.elevation }}

thanks, it for sure helps me on.

I now have a simulated “sun” that goes up and down and moves across the horizon. Its based on this in my templates.yaml

Now I will build the next stepp to set the position of the shutter in accordance to sun position by a calculation from the given conditions. I’ll be back

# Sun simulation
  - trigger:
      - platform: time_pattern
        # This will update every second
        seconds: /1
    sensor:
      # cycle throuch 1-360 rins and repeat
      - name: "test.sun_azimuth"
        unit_of_measurement: "°"
        state_class: measurement
        state: >
          {% set azimuth = states('sensor.test_sun_azimuth') | float %}
          {% if azimuth < 360 -%}
            {{ (azimuth + 1) | round(0) }}
          {%- else -%}
            {{ "0" }}
          {%- endif %}
  - trigger:
      - platform: time_pattern
        # This will update every second
        seconds: /1
    sensor:
      # cycle throuch 1-360 rins and repeat
      - name: "test.sun_elevation"
        unit_of_measurement: "°"
        state_class: measurement
        state: >
          {% set e = 1 %} {#  enter azimuth increments #} 
          {% set b = 67  %} {# enter max elevation #} 
          {% set c = b - 80 %} {# no input here, calculates the lower elevetion#}
          {% set d = 80 / 180 * e %} {# no input here, calculates the elevation per aimuth increment#}
          {% set x = states('sensor.test_sun_azimuth') | float %}
          {% if x < 180 -%}
            {{ ((x*d/e)+c) | round(2) }}
          {%- else -%}
            {{ (((x-(2*(x-180)))*d/e)+c) | round(2) }}
          {%- endif %}

On a side note: if you monitor this on lovelace with a gauge, its loading up the system pretty good… probably need to give HA some more resources from the host.

Why does the sensor’s value need to be computed every second when the sun barely moves in the sky within that time period?

I got a pretty straight forward devtools.templet running.

It moves the shutter correlation to the azimuth and elevation angels of a referenced sun device, in my case a test.sun device, as I want the day to not last 24h for testing purposes, but rather 60-90 seconds. the movement is also dependent on the window values like direction its facing, height, wall thickness and acceptable sun streak. There is still stuff missing, actually lots of stuff from my previous posted list is still missing, but I’m getting there. Considering this is my first try at python, Im kind of okay with my results.

Of course in devtools.template, it does nothing but generating a text output; but for my purposes right now this is equal to a moving shutter.

It also opens the shutter to 100% when no shading is required by the settings.
It slottes the shutter during dawn and dusk (-6° to 0° elevation, no matter the azimuth)
And it closes the shutter during night (< -6° elevation, no matter the azimuth)

If you have my sensors in your template.yaml from this post: click here, you could paste this code to devtoos.template and watch the output say what its doing.

I mainly post this here to document my progress and not lose my work when I stumble upon the next funny thing in HA like the fact that tan(what_ever) expects rad instead of angel. Yes I know now this is kind of standard :slight_smile: still while trying to make sens off the output I lost my previous progress.

{## Imitate available variables: ##}
{% set a = 180 %} {# direction the window is facing: default 180 = south #}
{% set b = 45 %} {# deviation from window direction shading is required: default 45 #}
{% set c = 0 %} {#deviation from vertical if e.g. roof window (a wall window is 0° deviation) #}
{% set d = 1000 %} {#height of window in mm #}
{% set e = 40 %} {#width of wall including inside window sill in mm #}
{% set f = 100 %} {#acceptable width of sun streaks (AWS) in mm #}
{% set g = 50 %} {#depth of the shutter from outside wall #}
{% set h = 98 %} {#start shading in % of roller shutter #}
{% set i = 5 %} {#fully shaded in % of roller shutter #}
{% set j = 68 %} {# formula needs to be build. from which elevation shading is no longer required because the wall itself provides shading #}
{% set k = 10 %} {# from which elevaiotn onward shading is required #}
{% set r = 2 * pi / 360  %} {#angle2radiant conversion factor#}
{#{% set s = "false" %} {# true for shading active #}
{% set x = states('sensor.test_sun_azimuth') | float(0) %} {# free #}
{% set y = states('sensor.test_sun_elevation') | float(0) %} {# free #}
{% set Z = 0 %}
Azimuth is: {{x}}      Elevation is: {{y}}
{% if (a-b) < x < (a+b) and x < j %} {#must also check for clouds and temp before setting s = ture#}
  {% set s = "true" %}
{% else %}  
  {% set s = "false" %}
{% endif %}
Shading required: {{ s }}
{% if s == "true" and y > k %}
  {% set z = ((d+e)*tan(y*r)/d*10) | float(0) | round(0) %} 
ACTIVE shading at {{ z }}% roller shutter position
{% elif s!= "true" and y > k -%}
  {% set cover_position = '100' | float(0) %} 
NOT shading at {{ cover_position }} % roller shutter position
{% elif y < -6 %}
{% set cover_position = '0' | float(0) %} 
Closed for night due to elevation < -6°. Elevaiont: {{y}} 
{% elif -6 <= y >= 0 %}
{% set cover_position = '10' | float(0) %} 
Slotted for dawn and dusk due to elevation -6° <-> 0° Elevaiont: {{y}} 
{%- endif %}

Hi, @mannebk

just curious if you got something working.

I tried the code from the other thread that you quoted in your first post, but seems to work only if you want those specific positions,for example, I tried to change the positions to instead of 0 and 100%, to say 20 and 90 and 80%…but was erratic.

This is what I was playing with, i just changed the positions from those of the orignal post:

    data:
      position: >
        {% if state_attr('sun.sun', 'azimuth') | float < 80 %}
          20  
        {% elif state_attr('sun.sun', 'azimuth') | float >= 80 and
        state_attr('sun.sun', 'azimuth') | float < 170 %}
          90
        {% elif state_attr('sun.sun', 'azimuth') | float >= 170 and
        state_attr('sun.sun', 'azimuth') | float < 220 %}
          {{ (((-2 * (state_attr('sun.sun', 'azimuth') | float )  + 440) / 10) | int) * 10 }}
        {% elif state_attr('sun.sun', 'azimuth') | float >= 220 and
        state_attr('sun.sun', 'azimuth') | float <= 250 %}
          20
        {% elif state_attr('sun.sun', 'azimuth') | float > 250 and
        state_attr('sun.sun', 'azimuth') | float <= 300 %}
          {{ ((( 2 * (state_attr('sun.sun', 'azimuth') | float )  - 500) / 10) | int) * 10 }}
        {% else %}
          80
        {% endif %}

with the above, it seems to only work for positions that set to an number i.e. 20%, but when the azimuth moves into a region where the variable formula is required

{{ (((-2 * (state_attr('sun.sun', 'azimuth') | float ) + 440) / 10) | int) * 10 }}

it doesn’t work well, so I supect this will only work if i use the positions in the orginal code.

Did you ever realize your code with the multiple variables and seasons? I also have a weather station in my backyard and included a condition that the lux value has to be a certain value for this automation to work. This way, I can not have it run during cloudy days…so this could simply that part.

indeed, i got it into one code. but its all fixed on elevation, no shading. Im still working on trying to understand how to pass variables and its values from one place in HA to an other or call it from mariaDB and how to push it there from the fontend and how to make a usable page to enter all required system, window, roller shutter and awning data. I want one place to set my windows data, and then a code that does its magic combining the data of each window with the formulas and the moving all roller shutters on a set interval to the new calculated positions.

I have the math to calculate the position ready, I have a test sun going up and down to simulate a day in a give time period, so you could see the shutters and awnings move through a day inside a 6 minutes or what ever you chose. great to see the codes working.

Now I need to figure out how to get that as a hacs feature or what ever into HA, but that is an erea that I have no clue about.

My intend of this code is mostly for shading. The goal is, uttermost opened shutters while still fulfilling the shading requirement to the specified requirement, due to constantly moving sun, the shutters would need to constantly move to the required new position, thats obviously not possible with 99.9% of equipment, as you cant control the speed its moves in. So i want the user to say, okay, move every xx minutes, and the code would update all positions on those intervals. I my self would go with 5 times per hour on a time trigger and the night opening and closing on elevation as trigger.

this is my current just on elevation based code for night closure

alias: 0_test_BK_RollerShutter
description: ''
trigger:
  - platform: numeric_state
    entity_id: sun.sun
    attribute: elevation
    above: '-6'
    id: preopen
  - platform: numeric_state
    entity_id: sun.sun
    attribute: elevation
    id: open
    above: '3'
  - platform: numeric_state
    entity_id: sun.sun
    attribute: elevation
    below: '3'
    id: preclose
  - platform: numeric_state
    entity_id: sun.sun
    attribute: elevation
    below: '-6'
    id: close
condition: []
action:
  - choose:
      - conditions:
          - condition: or
            conditions:
              - condition: trigger
                id: preopen
              - condition: trigger
                id: preclose
        sequence:
          - service: cover.set_cover_position
            data:
              position: 10
            target:
              device_id: e60c8eb701034371afaf2a019b0b8261
      - conditions:
          - condition: trigger
            id: open
        sequence:
          - service: cover.set_cover_position
            data:
              position: 100
            target:
              device_id: e60c8eb701034371afaf2a019b0b8261
      - conditions:
          - condition: trigger
            id: close
        sequence:
          - service: cover.set_cover_position
            data:
              position: 0
            target:
              device_id: e60c8eb701034371afaf2a019b0b8261
    default: []
mode: single

Intersting! This seems simpler, but it works. It moves the shades to a setpoint in one movement, rather than tracking with the azimuth, correct?

yep, just 4 set points, morning and evening, no shading. could be blown up to add some set points for shading.

Like shading of 50% if sun elevation is above 50° and azimuth in between whatever and lux is above 400w/m² and outside temp is above set indoor target temp.

I thought about adding a time trigger and generate the position from a value template, but then all the window stuff and the calculation is inside that very value template inside this very automation, it would be awfully complicated for anybody aside of myself to get this filled with his own data set.

1 Like

i found an error in my code :slight_smile: i fixed my code up there

the pre open and pre close need to be an or not and

Are there any news on this topic?
I am really interested.

1 Like

A long time ago, but now I have created my own solution for that: Cover Control Automation (CCA)