Sensor-driven home lighting over Matter. Built for home use, not commercial deployment.
One daemon keeps your lights matching how each room should feel across the day. You describe brightness, colour temperature, and which sensors matter; a 1 Hz loop interpolates each light's circadian schedule, gates it on occupancy, and sends a command only when the target meaningfully changes. It talks to matter_webcontrol over HTTP/SSE — never Matter directly.
- Circadian schedules —
{time, level, kelvin}points, linearly interpolated, cross-midnight aware. - Occupancy gating — a flat
sensorlist, or a booleansensor_conditiontree (AND/OR/NOT/time windows). - Moonlight — a level between 0 and 1 drives the bulb's warm night-light channel. Opt-in: only a deliberate sub-one setpoint triggers it, never the ramp up to daylight.
unoccupiedfallback — an away-state window and level instead of plain off (e.g. an evening glow, dark overnight).- Rain override — weather scales an already-on light's brightness and colour while a rain sensor is active.
- Mode flags +
/lights—auto(pause) andkill(force off) over a small HTTP API, with optionalX-API-Key./lightsreports per-light reachability for the HomeKit bridge. - MCP server (
mcpextra) — agents enumerate devices, edit the config with validation, drive lights, and toggle modes. A non-loopback bind requires a bearer token; destructive tools are opt-in.
AC and climate are out of scope here — handled by matter_webcontrol and the HomeKit bridges. The MCP server only proxies their read/write APIs.
pip install light-programmer # add the [mcp] extra for the MCP server
Requires Python 3.8+ and a reachable matter_webcontrol. light-genconfig scaffolds a starter config from your controller's /api/metadata.
A JSON array, one entry per light: an id, an optional name (the label the HomeKit bridge shows), a schedule, and either a sensor list or a sensor_condition. rain and unoccupied are optional. See sample.json for a multi-room example and programmer.py for the authoritative reader — the schema is informal and unknown keys are ignored.
Part of a Matter home under github.com/dongnh:
- matter_webcontrol — required peer; speaks Matter so this daemon doesn't.
- matter-weather-sensor — rain, illuminance, and climate as Matter sensors; feeds the rain override.
- yeelight_webcontrol — target for the moonlight night-light channel.
- light-programmer-homekit — turns
/lightsinto per-light Apple Home reachability sensors. - matter-homekit-bridge — brings HomeKit-only Aqara AC and heaters into the fabric.
MIT