This guide offers a complete and robust automation suite to manage your roller shutters in Home Assistant. It includes:
input_boolean helperBefore deploying this automation suite, make sure the following Home Assistant entities exist and are properly configured:
input_boolean.rolladen_runter_ausgefuehrt – Boolean helper to track if the roller shutter closing automation has run today to prevent repeated triggerscover.rolladen_kuche_shutter, cover.smart_roller_shutter_...person.jimmybones, person.jessi, and person.philip for presence detectionrolladen_runter_ausgefuehrt:
  name: "Rolläden runter ausgeführt"
  initial: off
  icon: mdi:window-shutter
      
        This automation closes the roller shutters automatically once the sun elevation falls below 5°. 
        If person.jimmybones or person.jessi are home, specific lights will be turned on. 
        If person.philip is home, automation.philip_an will also be triggered. 
        The automation runs only once per day, controlled via the input_boolean.rolladen_runter_ausgefuehrt helper.
      
alias: Rolläden runter bei Dämmerung
description: >
  Wenn die Sonnenhöhe unter 4 Grad fällt und die Automation noch nicht
  ausgeführt wurde, gehen je nach Anwesenheit bestimmte Lichter und Geräte an,
  und danach fahren die Rolläden runter.
triggers:
  - entity_id: sun.sun
    attribute: elevation
    below: 4
    trigger: numeric_state
conditions:
  - condition: state
    entity_id: input_boolean.rolladen_runter_ausgefuehrt
    state: "off"
actions:
  - variables:
      jimmy_oder_jessi: |
        {{ is_state('person.jimmybones', 'home') or
           is_state('person.jessi', 'home') }}
      philip_zu_hause: |
        {{ is_state('person.philip', 'home') }}
  - if: "{{ jimmy_oder_jessi }}"
    then:
      - target:
          entity_id:
            - e25b453e2192564740c41b89ae86eb51
            - 1df39f453fd981ff0576529085067789
            - 0e661df61665a61795695edbf536dc47
            - 327eb8a228ca97eddb3b091e8dd6120e
            - bfed121a3102a12c6b2bcd96b91e524c
            - 61476caf6f6373648201fb5513bfa9dd
            - 4755de94ebc1c97331def7303161463b
            - bcc7cc2e68a4318e8946e6674b617333
            - light.badezimmer_led_2
            - light.nachttisch_2
            - light.kuche_links_outlet
            - light.kueche_re_outlet
            - light.gbk_h613c_4427
            - light.maya_nachttisch_2
        action: homeassistant.turn_on
        data: {}
  - if:
      - condition: template
        value_template: "{{ philip_zu_hause }}"
    then:
      - target:
          entity_id:
            - light.licht_philip_1_2
            - light.licht_philip_2_2
            - light.licht_philip_3_2
            - light.philip_monitor_2
            - switch.sterneneprojektor_philip_master
        action: homeassistant.turn_on
        data: {}
  - action: script.rolladen_runter_ohne_wohnzimmer_balkontur
    data: {}
  - target:
      entity_id: input_boolean.rolladen_runter_ausgefuehrt
    action: input_boolean.turn_on
    data: {}
  - data:
      message: >
        Rolläden wurden bei Sonnenhöhe {{ state_attr('sun.sun', 'elevation') |
        round(1) }}° runtergefahren.
      level: info
    action: system_log.write
mode: single
      This automation resets the input_boolean.rolladen_runter_ausgefuehrt daily at 00:00:01, allowing the roller shutter automation to run again the next day.
alias: Reset Roller Shutter Automation Flag
description: >
  Resets the input_boolean.rolladen_runter_ausgefuehrt daily at midnight to allow
  the roller shutter automation to run again the next day.
trigger:
  - platform: time
    at: "00:00:01"
action:
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.rolladen_runter_ausgefuehrt
mode: single
      input_boolean.rolladen_runter_ausgefuehrt helper in Home Assistant before deploying the automations.below: 5) based on your location and preferences.