Skip to content

Advanced Use Cases Forecast Based Shading

Jason Rhubottom edited this page Jun 12, 2026 · 1 revision

Forecast-based shading

Activate shading from today's forecast maximum instead of the live outdoor temperature. On a day that starts at 15Β°C but will reach 26Β°C, live-temperature gating lets the sun in all morning and the rooms pay for it in the evening. Driving the decision from the forecast closes that gap (requested in issue #547).

There are two ways to do it, and the right one depends on whether you want a fixed shade position or full climate-mode behavior.

  • A condition template on a custom position slot (simplest). The slot holds your shade position all day whenever the forecast max exceeds your limit. No automation, no binary sensor.
  • A template in the outdoor temperature threshold. Keeps real Climate Mode summer behavior β€” sun tracking, presence and cloud awareness β€” but makes its outdoor-temperature gate follow the forecast instead of the live reading.

Both need the forecast maximum as a numeric entity β€” see the prerequisite below.

Prerequisite: a forecast-max sensor

Jinja2 templates cannot call the weather.get_forecasts action, so the forecast maximum has to exist as an entity the template can read.

Many weather integrations already expose one (AccuWeather, OpenWeatherMap, and others provide a daily maximum temperature sensor). If yours doesn't, declare a trigger-based template sensor that refreshes a few times a day:

template:
  - triggers:
      - trigger: time_pattern
        hours: "/4"
      - trigger: homeassistant
        event: start
    actions:
      - action: weather.get_forecasts
        target:
          entity_id: weather.home
        data:
          type: daily
        response_variable: forecast
    sensor:
      - name: Forecast max temperature today
        unique_id: forecast_max_temperature_today
        unit_of_measurement: "Β°C"
        device_class: temperature
        state: "{{ forecast['weather.home'].forecast[0].temperature }}"

The rest of this page assumes sensor.forecast_max_temperature_today.

Option A β€” condition template on a custom position slot

Availability: condition templates on custom position slots ship with the Force Override / Custom Positions merge (issue #563) β€” v2.28.0 betas after beta.6.

Open the cover's Custom Positions options and configure a free slot:

Field Value
Trigger sensors (leave empty)
Condition template {{ states('sensor.forecast_max_temperature_today') | float(0) > 23 }}
Position your shade position, e.g. 10
Priority 60 (above Climate at 50, below manual override at 80)
Minimum mode optional β€” see below

While the template renders truthy, the slot holds the cover at the configured position all day, regardless of the live outdoor temperature. The cover reacts the moment the forecast sensor updates β€” slot templates are tracked live, the same way trigger sensors are.

Two knobs worth knowing:

  • Minimum mode turns the position into a floor instead of a fixed target, so sun tracking can still shade deeper than your value but never retract above it. Use this if you want tracking detail on hot days rather than one static position.
  • Priority decides what the forecast rule may override. At 60 it beats Climate Mode and solar tracking but yields to a manual move. At 100 the slot becomes a safety rule that also acts outside the start/end time window β€” usually more than this use case wants.

Option B β€” forecast-gated Climate Mode

If you want genuine summer Climate Mode behavior (sun tracking with presence, lux, and cloud awareness) rather than a fixed position, gate the climate threshold on the forecast instead. The Outdoor Temperature Threshold field accepts a Jinja2 template (see Templated Thresholds):

{# Summer mode eligible all day when the forecast max exceeds 23Β°C #}
{{ -50 if states('sensor.forecast_max_temperature_today') | float(0) > 23 else 99 }}

When the forecast max exceeds the limit, the threshold drops below any plausible outdoor reading, so the outdoor gate is satisfied from the first cycle of the morning. On cooler days the threshold sits at 99Β°C and summer mode stays off.

Note that summer strategy still also requires the comfort-temperature condition (current temperature above Maximum Comfort Temperature). If your rooms start the day cool and you want shading anyway, either template that field the same way or use Option A β€” the fixed slot doesn't ask the room's permission.

Choosing between them

Option A β€” slot template Option B β€” threshold template
Behavior on hot-forecast days Fixed position (or floor) all day Normal summer Climate Mode
Reacts to room temperature No Yes
Cloud / presence awareness No (unless min mode lets tracking through) Yes
Minimum version v2.28.0 betas after beta.6 v2.28.0-beta.5

Start with Option A if "keep the sun out on days that will be hot" is the whole requirement. Reach for Option B when you want the full climate arbiter and only its trigger condition was wrong.

Clone this wiki locally