-
Notifications
You must be signed in to change notification settings - Fork 16
Advanced Use Cases Sun In FOV Custom Position
A common request: "I want a custom position that applies only while the sun is in my window's field of view (FOV), and the normal default position the rest of the time." This is achievable today with no code changes β the key is to gate the custom-position slot's trigger on the sun being in the FOV, instead of leaving it always active.
A custom-position slot fires whenever its trigger is active, independent of where the sun is. With the default priority of 77 it then outranks solar tracking (40) and cloud suppression (60), so if the slot's trigger is always on, its position is applied around the clock.
For reference, the relevant slice of the priority chain:
... β Custom Position(77) β Cloud Suppression(60) β Solar(40) β Default(0)
Two things follow:
-
Cloud suppression is not the culprit when the sun is outside the FOV. Cloud suppression only evaluates when the sun is in the FOV (it checks
direct_sun_validfirst and passes through otherwise). When the sun is outside the FOV, both the custom slot and cloud suppression need to step aside for the default position to take over. -
The fix is to make the trigger track the FOV. Once the trigger is
ononly while the sun is in the FOV, the slot wins during those hours and yields to the default position the rest of the day.
Adaptive Cover Pro exposes a built-in binary sensor per cover:
| Entity | State |
|---|---|
binary_sensor.<your_cover_name>_sun_infront ("Sun Infront") |
on exactly when the sun is within the window's field of view β azimuth inside the configured FOV, elevation valid, and not inside the sunset-offset or blind-spot windows |
This is the same direct_sun_valid signal the solar handler uses internally, surfaced as an entity you can reference directly or in a template.
In the cover's options under Custom Positions, set Trigger Sensor for your slot to binary_sensor.<your_cover_name>_sun_infront. Leave priority at 77.
| Sun position | Sun Infront | Result |
|---|---|---|
| In FOV | on |
Custom position wins (77 > 60 > 40) |
| Outside FOV | off |
Slot passes, cloud suppression passes β default position |
That's the whole recipe for the basic case.
Custom-position slots have a built-in Condition Template field and a Combine Mode (OR / AND), so you can require both "sun in FOV" and some condition of your own β without an external template sensor.
Set up the slot as:
| Setting | Value |
|---|---|
| Trigger Sensor | binary_sensor.<your_cover_name>_sun_infront |
| Condition Template | your extra condition (see below) |
| Combine Mode | AND |
| Custom Position | your desired % |
| Priority | 77 |
Example Condition Template β only apply the custom position when you're working from home:
{{ is_state('input_boolean.work_from_home', 'on') }}With Combine Mode = AND, the slot is active only when the sun is in the FOV and the template is truthy. Outside the FOV (or when you're not WFH) the slot yields to the default position.
If you'd rather build the whole condition in a single template (e.g. for a standalone Template binary sensor reused elsewhere), the FOV state is available to Jinja two ways:
{# Direct β the dedicated binary sensor #}
{{ is_state('binary_sensor.living_room_sun_infront', 'on') }}
{# Or via the Control Status sensor's attribute #}
{{ state_attr('sensor.living_room_control_status', 'in_field_of_view') }}A standalone Template binary sensor that ANDs sun-in-FOV with another condition, then wired into the slot's Trigger Sensor:
template:
- binary_sensor:
- name: "Living Room Custom Trigger"
state: >
{{ is_state('binary_sensor.living_room_sun_infront', 'on')
and is_state('input_boolean.work_from_home', 'on') }}(Replace living_room with your cover's actual entity slug.) Options 2 and 3 reach the same result β Option 2 keeps the logic inside the integration; Option 3 is handy when you already maintain template sensors or want to reuse the trigger in other automations.
If you want the custom position to apply only when it's actually sunny in the FOV β i.e. let cloud suppression take over on a cloudy-but-sun-in-FOV moment β set the slot's priority below 60 (e.g. 55). The chain becomes:
... β Cloud Suppression(60) β Custom Position(55) β Solar(40) β Default(0)
Now cloud suppression wins when it indicates no real direct sun, even though the sun is geometrically in the FOV; otherwise your custom position applies.
Check sensor.{your_device}_decision_trace. The state shows which handler won; the trace attribute lists every handler that evaluated and why. While the sun is in the FOV you should see custom_position (or cloud_suppression if you chose the priority-55 variant); once the sun leaves the FOV you should see default.
- How It Decides: full priority chain
- Custom Position: slot configuration reference (trigger sensors, condition templates, combine mode, priority)
- Sun Tracking: field-of-view and tracking settings
- Diagnostic Sensors: the Sun Infront binary sensor and Control Status attributes
- Advanced Use Cases: all advanced use case recipes
π Home Β· β¨ Features Β· π° What's New
π Getting Started
- Installation
- Migrating from Custom Repository
- Migrating from Adaptive Cover
- First-Time Setup
- Cover Types
π§ Core Concepts
π Cover Types
βοΈ Configuration
- Sun Tracking
- Position
- Position Matching
- Glare Zones
- Automation
- Custom Position
- Force Override
- Weather Safety
- Climate
- Templated Thresholds
- Blindspot
- Summary Screen
- Debug & Diagnostics
π Entities & Services
- Entities
- Proxy Cover Entity
- Position Verification
- My Position Support (Somfy RTS)
- Runtime Configuration Services
π οΈ Operations
π§ Advanced Use Cases
- Dynamic Temperature Thresholds
- Dynamic Tracking Window
- Bedroom Sleep Mode
- Handling Variable Cloud Cover
- Venetian Tilt-Only on Overcast Days
- Forecast-Based Shading
- Custom Position When Sun in FOV
π¨ Dashboard
π§ͺ Testing & Simulation
π Reference
π©βπ» For Developers