Smart Night Light by LTek
π Version 2026.09.13.10
Author: LTek
Latest Release...
NEW: Restore Night Brightness after external change
If the light is changed by anything other than this automation (manual toggle, another automation, physical switch) while Night Mode is active, wait the applicable timeout and restore it to Night Brightness β unless something else (motion, ambient, etc.) has already corrected it. Separate timeouts for when the external change leaves the light ABOVE vs BELOW the configured Night Brightness.
NEW: Lux hysteresis (high/low range) to allow for a dead-band (40 LUX by default) to absorb dusk/dawn, shadows / cloud flicker, etc
"ambient bright β turn off" trigger now fires against the high threshold, thus is "area is bright," not "just crossed the entry point."
NEW: Account for the light's own luminance
the light's own on/off state is the night-state memory.
While the lights are ON, is_night_time holds night against the high threshold instead of the low one. So the fixtures' own glow (which sits below 80) can't push the reading into "daytime" and make the lights extinguish themselves. Applied to both the OR logic and the require_ambient_light AND path so a required-ambient setup doesn't fight the latch.
FIX: bright_to_dim_timeout (was dead)
Affects the non-motion path. Bright as night falls, or manually brightened mid-night. Added a re-check that it's still night after the wait, and restart mode means a real motion event cancels the wait and takes over cleanly.
How it works...
β’ Night Mode is determined by any enabled condition β Time Range, Sun Elevation, or Ambient Light. If any enabled condition is true, Night Mode is active (OR logic).
β’ Required Conditions add AND logic β if a condition is marked as Required, it must also be true for Night Mode to be active, regardless of other conditions.
β’ Motion Trigger: When Night Mode is active and motion is detected, lights brighten to Motion Brightness. When motion clears, lights return to Night Brightness after the configured timeout.
β’ Night Trigger: Each enabled trigger (Time Start/End, Sunset/Sunrise, Ambient Dark/Bright) fires independently and sets the light to Night Brightness or turns it off based on whether Night Mode is now active.
β’ Day Trigger: Sunrise, Time End, Ambient Bright β turns lights off.
β’ Bypass Schedule: When enabled, defines days and times when nothing will ever trigger β checked first, no light action taken.
β’ Bypass Switch: When enabled, overrides normal automation β checked last, acts on the light per the Bypass Switch Action setting.
π **Day** - Lights are not controlled; Night Mode is inactive
π **Night Mode** - Any enabled condition is true (and all required conditions are met)
π **Motion** - Lights brighten to Motion Brightness when Night Mode is active
**FEATURES**
π― Multi-sensor support with motion confirmation and cooldown
π
Smart night detection via ambient light, sun elevation, or time schedule
β±οΈ Configurable timeouts with optional grace periods
π Required Conditions enforce AND logic across night mode sources
βπ§ Bypass system for temporary automation override
π’ Comprehensive notification system
π Persistent Web UI Notifications
π± Mobile Notifications
π Sunset/sunrise triggers for automatic scheduling
π« Smooth transitions between all lighting states
π Debug mode for troubleshooting
π Community Discussion, Help, and Details... https://community.home-assistant.io/
source_url: Home Assistant Blueprint : Smart Night Light by Ltek Β· GitHub