Lutron Lighting Vertical Architecture
The Lutron vertical provides local control of Lutron Caseta and RA2 Select systems. It bypasses the Lutron cloud entirely, executing encrypted commands directly on the local Smart Bridge.
Architectural Diagram
Section titled “Architectural Diagram”
Key Components & Protocol Flow
Section titled “Key Components & Protocol Flow”1. Agent Skill & Rules (skills/lutron-lighting)
Section titled “1. Agent Skill & Rules (skills/lutron-lighting)”- Circadian Lighting Automation: Instructs AI agents on color temperature and dimming curves across time of day.
- Pre-Flight Range Validation: Guards against out-of-range dimming commands (
level < 0orlevel > 100). - Blackout / Scene Control: Guides master shutoff workflows (
lutron_set_all(0)with--dry-runsafety).
2. Standalone MCP Server (cmd/mcp-lutron)
Section titled “2. Standalone MCP Server (cmd/mcp-lutron)”Exposes tools for lighting state and control:
lutron_list_devices(🔒 Read-Only): Lists all smart bridge devices, local zones, and model numbers.lutron_list_zones(🔒 Read-Only): Enumerates dimming and switching circuits with control types.lutron_list_areas(🔒 Read-Only): Returns room and area groupings.lutron_set_level(⚡ Mutating): Adjusts brightness for a specific zone with--dry-runsimulation support.lutron_set_all(⚡ Mutating): Broadcasts master dimming level to all zones with safety confirmation.
3. Go Engine (modules/lutron / pkg/leap)
Section titled “3. Go Engine (modules/lutron / pkg/leap)”- Mutual TLS (mTLS): The Lutron bridge requires client certificates.
pkg/leapconfigures a customx509.CertPoolusing certificates stored in~/.config/homectl/(lutron_client.crt,lutron_client.key,lutron_ca.crt). - Atomic ClientTag Sequencing: Each LEAP JSON request is assigned an incrementing atomic tag (
atomic.AddUint64(&tagCounter, 1)). The client matches incoming bridge responses to the initiating tag, ensuring request/response correlation over persistent TLS connections. - Batch Status Optimization: Instead of querying individual
/zone/<id>/statusendpoints sequentially (which scales as $O(N)$ network requests),homectlqueries the collective/zone/statusendpoint in a single roundtrip. - Resilient Auto-Reconnection: Network dropouts are detected via
isNetErr(err)(evaluatingio.EOF,net.OpError, and timeout conditions), triggering automatic reconnection before retrying in-flight requests.
4. Physical Bridge & LEAP Protocol
Section titled “4. Physical Bridge & LEAP Protocol”- Port 8081 TLS: Communcation takes place over newline-delimited JSON payloads:
{"CommuniqueType": "CreateRequest","Header": { "Url": "/zone/1/commandprocessor", "ClientTag": "42" },"Body": {"Command": {"CommandType": "GoToLevel","Parameter": [{ "Type": "Level", "Value": 75 }]}}}
- Clear Connect RF (434 MHz): The Smart Bridge broadcasts proprietary Clear Connect signals to wall dimmers, fan controls, and motorized Serena shades.