How to automate my awning (sunscreen)

Hi all,

I’m struggling with my template value. I have also a automation for my covers. I want a overview in a display to see or all my conditions are true or false. The most of them I have already, but I can’t get the right one of these

- condition: sun

after: sunrise

after_offset: ‘07:30:00’

How can I make a sensor with output true or false.

{% if is_state(‘sun.sun’, ‘above_horizon’) + (for example 7,5 hours) %} True

That is actually not as simply as you would hope :sunny:

Home Assistant only contains the time of the Next Sunrise. So once the sun has risen, you can only get the time of tomorrow’s sunrise. I think this template will get you an approximation of what you want:

{{ as_timestamp(now()) | timestamp_custom('%H:%M:%S', true) > ( as_timestamp(state_attr('sun.sun','next_rising')) + (7*3600)+1800 ) | timestamp_custom('%H:%M:%S', true) }}

Basically it says: if the time is after sunrise + 7,5 hours, then it’s true. But it looks at the time of tomorrow’s sunrise, not today’s. So there might be a slight difference (usually just a matter of minutes, depending on where you are in the world. If you want the exact number, I would advice you to install the sun2 custom component. It does contains today’s time of sunrise.

Sorry Arnold, forgot to answer you. My automation is indeed giving me the desired behaviour. I could make it more perfect, but because I can also control the awning manually there’s never really an issue. Dark Sky is accurate enough. But now I have my own weather station, so that temperature is also going in the mix soon. I don’t really know of another weather source for HA that containts today’s predicted temperature.

Did you get your timer to work correctly or do you need some help with that?

Roelof, I am on holiday right now but i did not manage to get the working correct.
But I haven’t tried your solution yet because i thought i had it working in node red. But I was wrong. I still like to use my own realtime lux values, but the hue sensors update only every few minutes.

When i am back i’ll try some more.

Roelof,

I will try it and let you know. thx for replying :slight_smile:

This could be a suggestion too. @Railittle

Roelof,

Thx for your extra suggestion. I will keep this in my mind. At this moment I want to have it all automatic and not with manual input.
I have made these sensor. And it works perfect. Based on your code.

 - platform: template
    sensors:
      wk_sun_above_horizon_time: 
        value_template: >-
          {% if (now().timestamp())|timestamp_custom('%H:%M') >= ( as_timestamp(state_attr('sensor.sunrise','today')) + (1.0*3600) )|timestamp_custom('%H:%M') %} True
          {% else %} False
          {% endif %}

1 Like

I did not integrate the dark sky sensors yet but did set up the statistics sensors and that works a lot better. Thanks for the suggestion.

Soon i will implement the dark sky sensors and use at least the wind sensor.
I am trying to build my own rain sensor so that after a few drops the screens will go up.

Nice, DIY :slightly_smiling_face: Still, in my experience Buienradar predicted rain is better. When my personal weather station picks it up the awning is quite wet already.

1 Like

Just a quick question, how did you make this view?
Like nice !

Hi Marc,

It’s basic, but helps me with adjustment the settings for the perfect (I hope ever) control of my sunscreens :slight_smile:

See my config below.

###################################################################################
#   screens group sensor
#   @author         :   RKl
#   @last update    :   18/08/2019
#   @package        :   none
#   @description    :   Template sensor for sunscreen conditions states
#   @url            :   https://www.home-assistant.io/components/sensor.template/
###################################################################################

###################################################################################   
# Woonkamer down
################################################################################### 
  - platform: template
    sensors:
      wk_blokkering_button_display:       
        value_template: >-
          {% if is_state('input_boolean.disable_automatic_sunscreens', 'off') %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if is_state('input_boolean.disable_automatic_sunscreens', 'off') %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}

  - platform: template
    sensors:
      wk_sun_above_horizon:       
        value_template: >-
          {% if is_state('sun.sun', 'above_horizon') %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if is_state('sun.sun', 'above_horizon') %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}

  - platform: template
    sensors:
      wk_sun_above_horizon_time: 
        value_template: >-
          {% if (now().timestamp())|timestamp_custom('%H:%M') >= ( as_timestamp(state_attr('sensor.sunrise','today')) + (1.0*3600) )|timestamp_custom('%H:%M') %} True
          {% else %} False
          {% endif %}
        entity_id:
          - sensor.sunrise 
          - sensor.time 
        icon_template: >-
          {% if (now().timestamp())|timestamp_custom('%H:%M') >= ( as_timestamp(state_attr('sensor.sunrise','today')) + (1.0*3600) )|timestamp_custom('%H:%M') %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}        
        
#     als--> huidige tijd (custom gemaakt) groter of gelijk is dan sensor.sunrise attribute tijd 'today' + 7,5uur (custom gemaakt) dan true.      9u = groter/gelijk dan bv 7u+1u      
#      - condition: sun
#        after: sunrise
#        after_offset: '01:00:00'

  - platform: template
    sensors:
      wk_sun_below_horizon_time: 
        value_template: >-
          {% if (now().timestamp())|timestamp_custom('%H:%M') <= ( as_timestamp(state_attr('sensor.sunset','today')) - (3.5*3600) )|timestamp_custom('%H:%M') %} True
          {% else %} False
          {% endif %}
        entity_id:
        - sensor.sunset
        - sensor.time 
        icon_template: >-
          {% if (now().timestamp())|timestamp_custom('%H:%M') <= ( as_timestamp(state_attr('sensor.sunset','today')) - (3.5*3600) )|timestamp_custom('%H:%M') %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}


#     als--> huidige tijd (custom gemaakt) kleiner is dan sensor.sunset attribute tijd 'today' - 3,5uur (custom gemaakt) dan true.      15u = kleiner/gelijk dan bv 3,5u voor 21u 
#      - condition: sun  
#        before: sunset
#        before_offset: "-03:30:00"


  - platform: template
    sensors:
      wk_max_wind_gust:
      # Wind strenght - in km/h  (equeal as windkracht 7)    
        value_template: >-
          {% if states('sensor.br_arnhem_wind_gust') | int < 60 %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if states('sensor.br_arnhem_wind_gust') | float < 60 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}
          
  - platform: template
    sensors:
      wk_max_rain_next_hour:
      # Almost no rain in the next 60 minutes is predicted      
        value_template: >-
          {% if states('sensor.br_arnhem_precipitation_forecast_average') | int < 10 %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if states('sensor.br_arnhem_precipitation_forecast_average') | int < 10 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}        

  - platform: template
    sensors:
      wk_min_outdoor_temp:
      # Above the 16 degrees outsite temperature 
        value_template: >-
          {% if states('sensor.outdoor_temperature') | int > 16 %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if states('sensor.outdoor_temperature') | int > 16 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}   

  - platform: template
    sensors:
      wk_min_inside_temp:
      # Above the 20 degrees in Living room.    
        value_template: >-
          {% if states.climate.woonk_keuken.attributes.current_temperature > 20 %} True
          {% else %} False
          {% endif %}
        entity_id:
        - climate.woonk_keuken
        icon_template: >-
          {% if states.climate.woonk_keuken.attributes.current_temperature > 20 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}   
  
  - platform: template
    sensors:
      wk_outside_weather_summary_down_up:
      #If one of the sensor values (see screens_sensor.yaml) is True and therefore this sensor is down for 30 min the condition will be True.    
        value_template: >-
          {% if is_state('sensor.screen_woonkamer_down_by_clouds', 'down') %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if is_state('sensor.screen_woonkamer_down_by_clouds', 'down') %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}  

  - platform: template
    sensors:
      wk_min_ha_running:
      # Voorkomt dat automation na restart HA gelijk uitgevoerd wordt.   
        value_template: >-
          {% if states('sensor.ha_runtime_in_hours') | float > 0.05 %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if states('sensor.ha_runtime_in_hours') | float > 0.05 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}  


#datetime
#{{now()}}
#timestamp
#{{as_timestamp(now())}}
#add 1 hour (3600 seconds)
#{{as_timestamp(now())+ (1*60*60)}}
#display as local time
#{{(as_timestamp(now())+ (1*60*60))  | timestamp_local}}
#display just the hour
#{{(as_timestamp(now())+ (1*60*60))  | timestamp_custom("%H",true)}}
# {% as_timestamp(now().strftime("%H") >= "7") and (now().strftime("%H") <= "16") %} True 

  
  
  - platform: template
    sensors:
      wk_time_frame_for_execution:       
        value_template: >-
          {% if now().hour > 7 and now().hour < 16 %} true
          {% else %} False
          {% endif %}
        entity_id:
        - sensor.time         
        icon_template: >-
          {% if now().hour > 7 and now().hour < 16 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}


        
#      - condition: time
#        after: '07:00:00'
#        before: '16:00:00'


  - platform: template
    sensors:
      wk_months_for_execution:
      # Starting in Maart dus groter dan 2 (feb) en ending in oktober dus kleiner dan 10    
        value_template: >-
          {% if (now().month >= 3) and (now().month <= 9) %} True
          {% else %} False
          {% endif %}
        entity_id:
        - sensor.date           
        icon_template: >-
          {% if (now().month >= 3) and (now().month <= 9) %} 
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}

  - platform: template
    sensors:
      wk_last_execution_time:
      # prevents that automation is triggered multiple times in a short amount of time. Checks last time automation is triggered, if more then 2700 seconds (45min), condition becomes True    
        value_template: >-
          {% if (as_timestamp(now()) - as_timestamp(states.automation.sunscreen_woonkamer_down.attributes.last_triggered) | int > 2700) %} True
          {% else %} False
          {% endif %}
        entity_id:
        - sensor.time 
        icon_template: >-
          {% if (as_timestamp(now()) - as_timestamp(states.automation.sunscreen_woonkamer_down.attributes.last_triggered) | int > 2700) %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}

  - platform: template
    sensors:
      wk_down_last_execution_up_older_then_down:
      # can only be triggered if timestamp of last_triggered time UP is kleiner/gelijk than the timestamp of last_triggered time of the "screen down" automation.    
        value_template: >-
          {% if (as_timestamp(states.automation.sunscreen_woonkamer_down.attributes.last_triggered) | int <= as_timestamp(states.automation.sunscreen_woonkamer_up.attributes.last_triggered) | int) %} True
          {% else %} False
          {% endif %}
        entity_id:
          - sensor.time          
        icon_template: >-
          {% if (as_timestamp(states.automation.sunscreen_woonkamer_down.attributes.last_triggered) | int <= as_timestamp(states.automation.sunscreen_woonkamer_up.attributes.last_triggered) | int) %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}

###################################################################################   
# Keuken Down
################################################################################### 
  - platform: template
    sensors:
      keu_blokkering_button_display:       
        value_template: >-
          {% if is_state('input_boolean.disable_automatic_sunscreens', 'off') %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if is_state('input_boolean.disable_automatic_sunscreens', 'off') %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}

  - platform: template
    sensors:
      keu_sun_above_horizon:       
        value_template: >-
          {% if is_state('sun.sun', 'above_horizon') %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if is_state('sun.sun', 'above_horizon') %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}

  - platform: template
    sensors:
      keu_sun_above_horizon_time: 
        value_template: >-
          {% if (now().timestamp())|timestamp_custom('%H:%M') >= ( as_timestamp(state_attr('sensor.sunrise','today')) + (7.5*3600) )|timestamp_custom('%H:%M') %} True
          {% else %} False 
          {% endif %}
        entity_id:
          - sensor.sunrise
          - sensor.time     
        icon_template: >-
          {% if (now().timestamp())|timestamp_custom('%H:%M') >= ( as_timestamp(state_attr('sensor.sunrise','today')) + (7.5*3600) )|timestamp_custom('%H:%M') %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}

#     als--> huidige tijd (custom gemaakt) groter of gelijk is dan sensor.sunrise attribute tijd 'today' + 7,5uur (custom gemaakt) dan true.       15u = groter/gelijk dan bv 7u+7,5u
#      - condition: sun
#        after: sunrise
#        after_offset: '07:30:00'

  - platform: template
    sensors:
      keu_sun_below_horizon_time: 
        value_template: >-
          {% if (now().timestamp())|timestamp_custom('%H:%M') <= ( as_timestamp(state_attr('sensor.sunset','today')) - (1.5*3600) )|timestamp_custom('%H:%M') %} True
          {% else %} False
          {% endif %}
        entity_id:
          - sensor.sunset
          - sensor.time            
        icon_template: >-
          {% if (now().timestamp())|timestamp_custom('%H:%M') <= ( as_timestamp(state_attr('sensor.sunset','today')) - (1.5*3600) )|timestamp_custom('%H:%M') %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}

#     als--> huidige tijd (custom gemaakt) kleiner is dan sensor.sunset attribute tijd 'today' - 1,5uur (custom gemaakt) dan true.      15u = kleiner/gelijk dan bv 1,5u voor 21u 
#      - condition: sun  
#        before: sunset
#        before_offset: "-01:30:00"


  - platform: template
    sensors:
      keu_max_wind_gust:
      # Wind strenght - in km/h  (equeal as windkracht 7)    
        value_template: >-
          {% if states('sensor.br_arnhem_wind_gust') | int < 60 %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if states('sensor.br_arnhem_wind_gust') | float < 60 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}
          
  - platform: template
    sensors:
      keu_max_rain_next_hour:
      # Almost no rain in the next 60 minutes is predicted      
        value_template: >-
          {% if states('sensor.br_arnhem_precipitation_forecast_average') | int < 10 %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if states('sensor.br_arnhem_precipitation_forecast_average') | int < 10 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}        

  - platform: template
    sensors:
      keu_min_outdoor_temp:
      # Above the 16 degrees outsite temperature 
        value_template: >-
          {% if states('sensor.outdoor_temperature') | int > 16 %} True
          {% else %} False
          {% endif %}
        entity_id:
          - sensor.outdoor_temperature
        icon_template: >-
          {% if states('sensor.outdoor_temperature') | int > 16 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}   

  - platform: template
    sensors:
      keu_min_inside_temp:
      # Above the 20 degrees in Living room.    
        value_template: >-
          {% if states.climate.woonk_keuken.attributes.current_temperature > 20 %} True
          {% else %} False
          {% endif %}
        entity_id:
          - climate.woonk_keuken           
        icon_template: >-
          {% if states.climate.woonk_keuken.attributes.current_temperature > 20 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}   
  
  - platform: template
    sensors:
      keu_outside_weather_summary_down_up:
      #If one of the sensor values (see screens_sensor.yaml) is True and therefore this sensor is down for 30 min the condition will be True.    
        value_template: >-
          {% if is_state('sensor.screen_keuken_down_by_clouds', 'down') %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if is_state('sensor.screen_keuken_down_by_clouds', 'down') %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}  

  - platform: template
    sensors:
      keu_min_ha_running:
      # Voorkomt dat automation na restart HA gelijk uitgevoerd wordt.   
        value_template: >-
          {% if states('sensor.ha_runtime_in_hours') | float > 0.05 %} True
          {% else %} False
          {% endif %}
        icon_template: >-
          {% if states('sensor.ha_runtime_in_hours') | float > 0.05 %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}  


  - platform: template
    sensors:
      keu_time_frame_for_execution:       
        value_template: >-
          {% if now().hour > 12 and now().hour < 20 %} true
          {% else %}
            False
          {% endif %}
        entity_id:
          - sensor.time             
        icon_template: >-
          {% if now().hour > 12 and now().hour < 20 %} 
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}


#      - condition: time
#        after: '12:00:00'
#        before: '20:00:00'


  - platform: template
    sensors:
      keu_months_for_execution:
      # Starting in Maart dus groter dan 2 (feb) en ending in oktober dus kleiner dan 10    
        value_template: >-
          {% if (now().month >= 3) and (now().month <= 9) %} True
          {% else %} False
          {% endif %}
        entity_id:
          - sensor.date 
        icon_template: >-
          {% if (now().month >= 3) and (now().month <= 9) %} 
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}


  - platform: template
    sensors:
      keu_last_execution_time:
      # prevents that automation is triggered multiple times in a short amount of time. Checks last time automation is triggered, if more then 2700 seconds (45min), condition becomes True    
        value_template: >-
          {% if (as_timestamp(now()) - as_timestamp(states.automation.sunscreen_keuken_down.attributes.last_triggered) | int > 2700) %} True
          {% else %} False
          {% endif %}
        entity_id:
          - sensor.time          
        icon_template: >-
          {% if (as_timestamp(now()) - as_timestamp(states.automation.sunscreen_keuken_down.attributes.last_triggered) | int > 2700) %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}

  - platform: template
    sensors:
      keu_down_last_execution_up_older_then_down:
      # can only be triggered if timestamp of last_triggered time UP is kleiner/gelijk than the timestamp of last_triggered time of the "screen down" automation.    
        value_template: >-
          {% if (as_timestamp(states.automation.sunscreen_keuken_down.attributes.last_triggered) | int <= as_timestamp(states.automation.sunscreen_keuken_up.attributes.last_triggered) | int) %} True
          {% else %} False
          {% endif %}
        entity_id:
          - sensor.time          
        icon_template: >-
          {% if (as_timestamp(states.automation.sunscreen_keuken_down.attributes.last_triggered) | int <= as_timestamp(states.automation.sunscreen_keuken_up.attributes.last_triggered) | int) %}
            mdi:check-outline
          {% else %}
            mdi:alert-outline
          {% endif %}
############################
# Sunscreens
############################                 
    title: Sunscreens # Tooltip
    icon: mdi:projector-screen
    cards:
      - type: entities
        title: Sturing Screens
        show_header_toggle: false
        entities:
          - type: section
            label: "Woonkamer_DOWN"
          - type: entities
            entity: sensor.wk_blokkering_button_display
          - type: entities
            entity: sensor.wk_sun_above_horizon
          - type: entities
            entity: sensor.wk_sun_above_horizon_time
          - type: entities
            entity: sensor.wk_sun_below_horizon_time 
          - type: entities
            entity: sensor.wk_max_wind_gust
          - type: entities
            entity: sensor.wk_max_rain_next_hour
          - type: entities
            entity: sensor.wk_min_outdoor_temp
          - type: entities
            entity: sensor.wk_min_inside_temp
          - type: entities
            entity: sensor.wk_outside_weather_summary_down_up
          - type: entities
            entity: sensor.wk_min_ha_running
          - type: entities
            entity: sensor.wk_time_frame_for_execution
          - type: entities
            entity: sensor.wk_months_for_execution
          - type: entities
            entity: sensor.wk_last_execution_time
          - type: entities
            entity: sensor.wk_down_last_execution_up_older_then_down
            
         
          - type: section
            label: "Keuken_DOWN"
          - type: entities
            entity: sensor.keu_blokkering_button_display
          - type: entities
            entity: sensor.keu_sun_above_horizon
          - type: entities
            entity: sensor.keu_sun_above_horizon_time
          - type: entities
            entity: sensor.keu_sun_below_horizon_time             
          - type: entities
            entity: sensor.keu_max_wind_gust
          - type: entities
            entity: sensor.keu_max_rain_next_hour
          - type: entities
            entity: sensor.keu_min_outdoor_temp
          - type: entities
            entity: sensor.keu_min_inside_temp
          - type: entities
            entity: sensor.keu_outside_weather_summary_down_up
          - type: entities
            entity: sensor.keu_min_ha_running
          - type: entities
            entity: sensor.keu_time_frame_for_execution
          - type: entities
            entity: sensor.keu_months_for_execution
          - type: entities
            entity: sensor.keu_last_execution_time
          - type: entities
            entity: sensor.keu_down_last_execution_up_older_then_down 
3 Likes

Ah yes, that’s smart. Thank you for sharing!

hi @gieljnssns
i like your config. where did you get the sun energy values?

Do you mean this?

          - condition: numeric_state
            entity_id: sensor.huidige_opbrengst
            above: 1200

This comes from my Smappee, this is the current solar energy from my solar panels

1 Like

ah ok thanks. then i can t use this value :slight_smile:

This thread is really helpful. My challenge was to automate the closing of the sunscreens in the morning when a very hot day is expected (based on the forecast of dutch Buienradar).

I have created 3 input_booleans:

  wind_low_tomorow:
    name: "Wind < 5 Bft tomorow"
    icon: mdi:weather-windy
  
  temp_high_tomorow:
    name: "Temp >24 C tomorow"
    icon: mdi:weather-sunny
  
  rain_low_tomorow:
    name: "Rain < 0.2 mm tomorow"
    icon: mdi:weather-pouring

Every evening these booleans are set with the latest forecast:

automation:
  - alias: Read temp tomorrow
    initial_state: 'on'
    trigger:
      platform: time
      at: '22:00:00'
    condition:
      condition: numeric_state
      entity_id: sensor.br_temperature_1d
      above: 24
    action:
      service: input_boolean.turn_on
      entity_id: input_boolean.temp_high_tomorow
  
  - alias: Read Windforce tomorrow
    initial_state: 'on'
    trigger:
      platform: time
      at: '22:00:00'
    condition:
      condition: numeric_state
      entity_id: sensor.br_wind_force_1d
      below: 5
    action:
      service: input_boolean.turn_on
      entity_id: input_boolean.wind_low_tomorow

  - alias: Read Rain tomorrow
    initial_state: 'on'
    trigger:
      platform: time
      at: '22:00:00'
    condition:
      condition: numeric_state
      entity_id: sensor.br_rain_1d
      below: 0.2
    action:
      service: input_boolean.turn_on
      entity_id: input_boolean.rain_low_tomorow

And the automation to get the screens down early morning :slight_smile:

  - alias: Screens down 
    initial_state: 'on'
    trigger:
      platform: sun
      event: sunrise
      offset: +00:30:00
    condition:
      condition: and
      conditions:
        - condition: state
          entity_id: input_boolean.wind_low_tomorow
          state: 'on'
        - condition: state
          entity_id: input_boolean.rain_low_tomorow
          state: 'on'  
        - condition: state
          entity_id: input_boolean.temp_high_tomorow
          state: 'on'  
    action:
     - service: switch.turn_on
       entity_id: switch.screens

And an automation to get the screens up when the wind or rain are too strong:

  - alias: Screens up
    initial_state: 'on'
    trigger:
    - platform: time
      at: '17:00:00'
    - platform: sun
      event: sunset
      offset: -02:00:00
    - platform: numeric_state
      entity_id: sensor.br_wind_force
      above: 4
      for:
        minutes: 5
    - platform: numeric_state
      entity_id: sensor.br_precipitation_forecast_total
      above: 0.2
    - platform: numeric_state
      entity_id: sensor.br_irradiance
      below: 100
      for:
        minutes: 5
    action:
     - service: switch.turn_off
       entity_id: switch.screens

A big thank you to all of you!

7 Likes

Hi @Emphyrio , your automations look awesome. I am installing my smart roller shades tomorrow, and i will be using a lot of your ideas. Thank you for that. Anyhow, since you are using this for a couple of years now, are there any new insights that would be worth sharing? Or is it ‘smooth sailing’ since then?

I am still using the settings as described above. No need to adapt.

1 Like

Two changes worth mentioning:

  1. I switched from DarkSky to OpenWeatherMap for today’s temperature forecast. DarkSky is no longer free.
  2. Because we are working from home, I built some more options for manual control into my Lovelace dashboard. It looks like this:

Controls straight on the dashboard. The button ‘Manual control’ shows until what time Home Assistant won’t interfere with the awning position:
image
Popup that appears when you click on the manual-control-button (‘Handbediening’):
image

1 Like

Thanks, some pretty nice updates! Regarding OpenWeatherMap, I guess you are using the onecall_daily mode to obtain todays ‘forecast_temperature’ ? I was already looking for todays maximum temperature, and reached the conclusion it is not available in the Buienradar Integration. I’ll jump to OpenWeatherMap for this. Nice!

Regarding working from home: same here. But i’ll be installing a physical switch to the wall to control the curtains via Home Assistant (most likely the Philips Hue Switch). I hardly ever control stuff via Lovelace, i like the feel of physical buttons. I’ve replaced all regular switches to Philips Hue V2 switches in my home (i don’t want to think about the € sum of that :rofl:).