Objective

The thought of manually operating blinds seems outdated. If not automated, I’d be toggling 7 switches twice daily across multiple rooms to adjust blinds. Although many systems adjust blinds based on sunrise and sunset, I’ve expanded on this when we first experienced a heatwave since moving in. With no air conditioning, it became crucial to shade our windows strategically. External blinds are ideal for this, shading only the windows exposed to direct sunlight.

Key to this automation is the sun’s azimuth—the angle of the sun relative to the cardinal directions, measured in degrees. Using a compass and the SunCalc tool, I mapped the sun’s azimuth for each side of our house. With this data, I developed a smart shading system.

Hardware

The blinds are managed by a dual-relay Shelly 2.5, which I’ve upgraded with Tasmota firmware for added features and better control. However, the same can be achieved also with factory firmware.

Integration in Home Assistant

Integration with Home Assistant is managed via the MQTT protocol.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
mqtt:
  cover:
    - name: "Ob kavču"
      unique_id: "Ob kavču"
      availability_topic: "tele/pritlicje/dnevna/zaluzije/pogon_zahod_14-6/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
      position_topic: "stat/pritlicje/dnevna/zaluzije/pogon_zahod_14-6/RESULT"
      position_template: >
        {% if ('Shutter1' in value_json) and ('Position' in value_json.Shutter1) %}
          {{ value_json.Shutter1.Position }}
        {% else %}
          {% if is_state('cover.zaluzije_ob_kavcu', 'unknown') %}
            50
          {% else %}
            {{ state_attr('cover.zaluzije_ob_kavcu','current_position') }}
          {% endif %}
        {% endif %}        
      position_open: 100
      position_closed: 0
      set_position_topic: "cmnd/pritlicje/dnevna/zaluzije/pogon_zahod_14-6/ShutterPosition1"
      command_topic: "cmnd/pritlicje/dnevna/zaluzije/pogon_zahod_14-6/Backlog"
      payload_open: "ShutterOpen1"
      payload_close: "ShutterClose1"
      payload_stop: "ShutterStop1"
      retain: false
      optimistic: false
      qos: 1

Automation Logic

Each morning, the system reviews temperature forecasts to decide if shading is necessary. Blinds automatically raise at dawn when outdoor lighting surpasses 5 lumens. On anticipated hot days, the system plans shading adjustments:

  • Azimuth 80°: Sun hits the east, lower eastern blinds
  • Azimuth 120°: Sun shifts south, adjust southern blinds and lift eastern ones
  • Azimuth 200°: Sun moves westward, lower western blinds
  • Azimuth 230°: Sun departs from the south, lift southern blinds
  • Azimuth 285°: Sun obscured by trees, lift western blinds

Before each action, the app checks whether the solar intensity is above 7000W (strong sun) and outside temperature exceeding 21°C. This prevents unnecesarry blind movements.

After sunset, with outside illuminance under 5 lumens, most blinds are lowered, except for terrace doors and specific windows that we open for evening cooling. Terrace blinds close at 2:00 AM, and bedroom blinds deserve a separate post.