Manage cover with sun position (elevation and azimuth)

Hi there!

I’m trying to implement the template in my HA, it doesn’t work and I get an error with the var configuration.

I installed the variables integration, is there anything I need to do in my config.yaml afterwords?

Hello @Sacha005

Please update the Blueprint, I had mad error on it

Hello @Lvydree

Did you add the variable to your config file ?

https://github.com/snarky-snark/home-assistant-variables#configuration

Hi @mougeat

Thx for providing this blueprint. I have tilted shutters, would it be possible to add the option to set the tilt position as well?

Bild_2022-06-19_090600797

Hey there,

Yes, I’ve added the following line in my config.yaml file

var:

And I have the boolean here:

I’m really confused… :confused:

Hello @Ivydree

Yes, I now, the use of variable was not clear. I have updated the Prerequisites

You will have to add fallowing lines to configuration.yaml

var:
  cover_NAME_OF_YOUR_COVER: #Replace NAME_OF_YOUR_COVER with the entity_id without cover. for exemple my entity_id is cover.bureau, the variable will be cover_bureau
    friendly_name: "NAME YOU WOULD LIKE TO USE"
    initial_value: 0
    icon: mdi:bug
1 Like

Hello @Convicte

Yes, the cover.set_possition service is a good idea. I did not use it because, I do not know the position of my cover :frowning: So I have to work with time)

I also use the var. integration to memorise the position (closed or not) also if it is half closed

1 Like

Hello @Edwin_D
No your are not crazy :wink: measuring is better than predicting. I made this blueprint because I do not want to by device to measure and also because the position of my house did not change in the time. I know wenn the sun is shining in my house and wenn it stop.

Hi there,
Thanks for the clarification. Makes absolute sense in your case!
This said, for those with the ability to read/write possition attribute, it would by far more intuitive for shutters of varying sizes.

In such a situation, the whole faffing about with var also doesn’t seem necessary, since at any given time position can be read from the latest state payload of the shutter, under attribute current_possition.

Finally, just in case someone stumbles upon it and finds it more convenient, here is an overview of how I went about doing it in Node-Red, which felt more intuitive for me.

Thanks! I’ve added the variable now, however it doesn’t work still… I’m probably missing something somewhere, is there anything I can post here so you can point me in the right direction?

Hi there!

Still no luck with this blueprint… I must be missing something.

image

But nothing happens!

I’m confused, can someone help?

First off, excellent work @mougeat. I really like this blueprint!
I’d like to ask if there is a way to add another condition based on season:

For my windows facing east, in summer I want the curtains to close when the sun hits that side and the west side to open. However in winter time I want the opposite. Idea is to help manage temperature in the room. Any thoughts on how I could do that?

I have the season integration added but I have no idea how I could integrate it with your blueprint.

PS, If people feel like this is post hijacking I can create a new topic, it just seemed to close to justify a new topic :yum:

Hello, this is a nice blueprint. I added the following option to it. Because if the windspeed is to high the screens has to go open.

    input_wind_speed:
      name: Wind Speed
      description: Wind speed above ... Screens will open
      default: 40
      selector:
        number:
          min: 0.0
          max: 120.0
          unit_of_measurement: km/h
          step: 1.0
          mode: slider
var_wind_speed: !input input_wind_speed

#Screens omhoog door te veel wind!
  - conditions:
    - condition: template
      value_template: '{{- is_state(''input_boolean.cover_manage_cover_with_sun'',
        ''on'') -}}'
    - condition: template
      value_template: '{{ states(var_e) == ''1'' }}'
    - condition: template
      value_template: '{{ state_attr(weather_service, ''wind_speed'') > var_wind_speed
        }}'
    sequence:
    - data_template:
        entity_id: '{{ cover_e }}'
      service: cover.open_cover
    - condition: template
      value_template: '{{ states(cover_e) == ''open'' }}'
    - data:
        entity_id: '{{ var_e }}'
        value: 0
      service: var.set

2 Likes

HI. my logs showing:
Invalid config for [var]: [cover_NAME_OF_YOUR_COVER] is an invalid option for [var]. Check: var->var->cover_NAME_OF_YOUR_COVER. (See /config/configuration.yaml, line 24).

My config.file

input_boolean:
notify_home:
name: input_boolean.cover_manage_cover_with_sun
icon: mdi:window-shutter-settings

var:#### this is line 24
cover_NAME_OF_YOUR_COVER: cover_jadalnia_fix_mala
friendly_name: “JADALNIA FIX MAŁA CIEŃ”
initial_value :0
icon: mdi:bug

Can anyone help whit this?

Hello I plan to do something similar. How I plan to do it is have two of these blueprints for the two seasons but have a automation that switches the automations on or off based on season.

Hi I’m getting an error trying to import this BP

No valid blueprint found in the topic. Blueprint syntax blocks need to be marked as YAML or no syntax.

In your expample sould be:
var:
cover_jadalnia_fix_mala:
friendly_name: “JADALNIA FIX MAŁA CIEŃ”
initial_value :0
icon: mdi:bug

But in this mode is not runing for me.

If they can explain var config…

I am getting the same error

I love the idea of this blueprint, I’m going to try this later today.
I partially lower and raise several of my Somfy shades during the course of any given day, to block the direct sun from getting in our eyes, but don’t close them all the way.

Would it be possible to update your blueprint to open or close to a certain percentage depending on the azimuth / altitude / weather (clear, cloudy, partially cloudy, etc)?

Thanks for your industry!

It would be more helpful if you could share the nodered JSON.