Twilight — Solar-Aware Lighting Automation & Visual Area Manager

Hey everyone,

I’ve recently been developing an integration called Twilight, which is finally ready to be introduced here. It enables sun-based lighting automation (time windows tied to the sun’s position rather than fixed times) as well as a sidebar panel that lets you configure everything visually—no YAML required.

The problem I was trying to solve

I had previously created an automation blueprint for my lighting that worked, but was slowly reaching its limits. It also couldn’t be scaled to set up different behaviors in different rooms, such as a separate ambient channel. Fixed time triggers also don’t account for how much the length of the day shifts over the course of the year, so there were always seasonal discrepancies.

What Twilight does

  • Uses scenes/scripts – it triggers HA scenes, Hue scenes, or scripts, so it doesn’t require its own lighting configuration

  • Sun-Based Time Windows – instead of activating scenes based on the clock, they are linked to solar events (dawn, golden hour, dusk, night, etc.), so the settings remain accurate year-round without requiring manual adjustments for the time of day

  • Multi-Channel Zones – a room can have independent schedules, for example, for main lighting, accent lighting, and night lights, each with its own schedule

  • Motion/Input → Activity Assignment — Motion sensors, binary sensors, timers, and physical buttons can trigger named activities (e.g., “Sleep,” “Manual Override”), each with its own on/off behavior

  • A real user interface – a side panel with real-time status information on the currently active areas, a schedule editor for time slots and analysis data provided by the recorder, as well as a sun path diagram (daily and annual views)

I’ve been using it at home for some time now, and it has proven to be reliable, but it’s still a young 0.x project—the configuration and behavior may still change slightly as development continues. For now, consider it something for early adopters.

Questions and feedback are welcome.

Screenshots

Area config with multi-channel setup, scene mapping, and input/activity editing:

Sun path / timeline view — day and year:

Settings — area templates so new rooms come pre-wired instead of starting empty:

Links

Updated — Version 0.5.0:

  • Rules system – a parallel, temporary override layer triggered by switches or buttons. A Rule can override a running Activity’s channel/slot configuration, its auto-expire timer, or its input suppression, without controlling lights directly. Multiple Rules can be active simultaneously.

  • Presence Simulation – makes an empty home look occupied by replaying an Activity’s light behavior timed against historical motion density from the Recorder. Supports saved heatmap profiles (up to 5 snapshots per area) and configurable playback frequency.

  • Flexible Auto-Expire – Activities can now run with no timer at all, ending only on release or when another Activity takes over, instead of always requiring a duration.

  • Dynamic Hue Scenes – slots using Philips Hue scenes can opt into the Bridge’s dynamic color rotation with configurable playback speed.

  • Various UI improvements