-
Notifications
You must be signed in to change notification settings - Fork 28
Advanced Use Cases Coupled Indoor Lux
An indoor illuminance sensor mounted behind the cover it helps control is coupled to that cover: closing the cover shades the sensor, the reading falls, and the low reading looks like "no sun" β so the cover reopens. This page shows an asymmetric-latch template sensor that lets you use the shaded lux reading anyway, without the feedback loop.
Cloud suppression treats a low lux reading as "the sun isn't out" and returns the cover to its default position. That works when the sensor sees the sky. It breaks when the sensor sees the inside of a closed cover:
- Cover open, sun out β lux climbs, cloud suppression stays off, the cover tracks the sun and closes. Correct.
- Cover closed, sun still out β the closed cover shades the sensor, lux drops, cloud suppression reads "no sun" and reopens the cover. Wrong β but the reading isn't false. It really is dim behind the cover.
Both readings are genuinely true, which is why averaging, a longer delay, or hysteresis (the Handling Variable Cloud Cover patterns) won't fix it β those smooth out noisy readings, and this reading isn't noisy. The sensor and the cover are wired together through the room's light: the thing being measured is caused by the thing being controlled.
Make the sensor asymmetric. A bright reading is trustworthy β nothing but real sun pushes indoor lux past a few thousand. A dim reading is ambiguous β it might be a genuine overcast, or it might be the cover's own shadow. So: let a bright reading latch the sensor on, never let a dim reading turn it off, and clear the latch overnight so each day has to earn its own close.
template:
- binary_sensor:
- name: "Confirmed Sunny (asymmetric)"
unique_id: confirmed_sunny_asymmetric
state: >
{% set lux = states('sensor.indoor_lux') | float(0) %}
{% set cloudy_now = is_state('weather.home',
['cloudy', 'partlycloudy', 'rainy', 'snowy']) %}
{% if state_attr('sun.sun', 'elevation') | float(0) < 5 %}
false
{% elif lux > 3000 %}
true
{% elif cloudy_now %}
false
{% else %}
{{ this.state == 'on' }}
{% endif %}Replace sensor.indoor_lux with your own indoor lux sensor and weather.home with your weather entity. Then wire the resulting binary sensor to the Is Sunny binary sensor field under Light Sensors & Cloud Suppression, and leave Lux sensor and Irradiance sensor blank.
The branches, in order:
- Sun below 5Β° β off. The nightly reset. It has to be first, or a stray bright reading at dusk re-latches the sensor overnight.
- Lux above 3000 β on. Real sun latches it.
- Weather is cloudy β off. A release path that doesn't depend on the shaded sensor.
-
Otherwise β hold the previous state (
this.state == 'on'). A later dim reading falls through to here and changes nothing, so the cover's own shadow is silently ignored.
The nightly reset is what makes the sensor do real work instead of coasting on yesterday's answer. Every morning the latch starts off, so cloud suppression parks the cover at its default position β which leaves the sensor exposed to the sky:
- Sunny morning β lux climbs past 3000, the latch sets, the cover closes.
- Overcast morning β lux stays low, the latch stays off, the cover stays open.
-
Cloud rolls in mid-day β the weather entity flips to
cloudy, branch 3 releases the latch, the cover opens, the sensor is exposed again. When the sun returns, branch 2 re-latches it.
After a Home Assistant restart the sensor comes up unknown, so the latch starts off and the cover re-earns its close. That's the safe direction to fail β an unknown state opens the cover rather than trapping it shut.
You don't need a release branch for "the sun left the window." Cloud suppression only runs while the sun is inside the window's sun acceptance angle and elevation range, so a latch still sitting on after the sun exits can't do anything β the solar handler opens the cover on its own.
Every cloud-suppression input (weather state, lux, irradiance, cloud coverage) is combined with OR logic and evaluated independently. If you also wire the shaded sensor into the Lux sensor field, its raw reading will trigger suppression on its own no matter how good the latch is β the latch on Is Sunny and the raw lux check would fight each other. The whole point is to route the coupled signal through the latch and nowhere else.
While the latch is held and the cover is shut, the shaded sensor can't tell you a cloud has arrived β you're leaning on the weather entity alone to notice, and weather entities update slowly. If you have an outdoor cloud-cover percentage sensor, add it under Cloud coverage sensor. It isn't shaded by the cover, so it ORs in as genuine mid-close cloud detection without dragging the coupled signal back into the loop.
Tune the two constants to your setup: the 3000 lux threshold (raise it if bright indirect light latches the cover on false alarms, lower it if genuine sun doesn't cross it) and the cloudy weather states list (match your weather integration's state names).
-
Handling Variable Cloud Cover: the hysteresis and hold-time patterns for noisy lux readings, and the
this.stateself-reference idiom this page builds on (Variant C) - How It Decides: the full priority chain, including where cloud suppression and solar tracking sit
- Sun Tracking: lux threshold, Is Sunny sensor, and other tracking settings
- 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
- Building Profile β start here if you have multiple covers
- Cover Groups
- Copy Settings to Other Covers
- Cover Types
π§ Core Concepts
π Cover Types
- Vertical
- Horizontal
- Oscillating Awning
- Roof / Skylight Window
- Tilt
- Louvered Roof
- Sliding Curtain
- Day/Night Shade
- Dual Panel
- Venetian (Dual-Axis)
βοΈ Configuration
- Sun Tracking
- Position
- Position Matching
- Travel Time Calibration
- Glare Zones
- Automation
- Manual Override
- Command Queue
- Custom Position
- Force Override
- Weather Safety
- Climate
- Templated Thresholds
- Template Self-References
- Blindspot
- Summary Screen
- Debug & Diagnostics
π Entities & Services
- Entities
- Proxy Cover Entity
- Position Verification
- My Position Support (Somfy RTS)
- Runtime Configuration Services
π οΈ Operations
- Known Limitations
- Hardware Compatibility
- Troubleshooting
- Troubleshooting Findings
- Diagnostic Sensors
- Tips and Tricks
π§ Advanced Use Cases
- Overview
- Dynamic Temperature Thresholds
- Dynamic Tracking Window
- Bedroom Sleep Mode
- Handling Variable Cloud Cover
- Indoor Lux Sensor Behind the Cover
- Venetian Tilt-Only on Overcast Days
- Forecast-Based Shading
- Custom Position When Sun in FOV
- Suppress Closing While a Door Is Open
- Keep a Blind Clear of the Sill
π¨ Dashboard
- Dashboard Cards
- Panel Card
- Tile Card
- Sky Compass Card
- Decision Strip Card
- Solar Chart Card
- History Card
π§ͺ Testing & Simulation
π Reference
π©βπ» For Developers