Spanda

Building Automation

Building management, HVAC, lighting, access control, and life-safety orchestration for the Smart Spaces & Ambient Intelligence blueprint.

Status: Experimental (scaffold) · Profile: smart_space

Spanda does not replace BACnet/KNX BMS products or home automation hubs. It verifies readiness, orchestrates missions, and produces assurance evidence across those systems.


Scope

Layer Spanda role Typical external system
Device control Mission triggers via providers Matter hub, BMS controller
Scheduling Readiness-gated mode changes Home Assistant automations (optional bridge)
Life safety Verify + escalate + evidence Fire panel, UL-listed devices
Access Trust-verified lock missions Smart lock vendor cloud
Energy Optimize within readiness bounds Utility / inverter APIs

Reference architectures

Smart home

Home (facility)
├── Gateway (Matter / Zigbee hub)
│   ├── Thermostat → climate_control
│   ├── Locks → access_control
│   ├── Smoke / leak sensors → safety_monitoring
│   └── Lights → lighting_control
├── Occupants (human entities)
├── Robot vacuum (robot)
└── Energy meter + solar (optional)

Example: examples/solutions/smart-spaces/smart-home/

Smart office

Office floor (zone)
├── BACnet gateway → HVAC zones
├── Occupancy sensors → climate_control
├── Access readers → access_control
└── Cleaning robot → robot_assistance

Example: examples/solutions/smart-spaces/smart-office/

Smart building

Commercial tower (facility)
├── Floors (zones)
│   ├── Rooms
│   └── Redundant gateways (primary + backup)
├── Central BMS (BACnet / KNX)
├── Emergency systems (fire, PA, egress lighting)
└── Control Center NOC operator

Example: examples/solutions/smart-spaces/smart-building/


Protocol integration

Building type Primary packages
Residential spanda-matter, spanda-zigbee, spanda-thread, spanda-zwave
Commercial spanda-bacnet, spanda-knx, spanda-modbus
Mixed / retrofit spanda-home-assistant, spanda-mqtt

Native BACnet / KNX on site

  1. Install optional Python deps: requirements-bacnet.txt / requirements-knx.txt under each registry package.
  2. Set SPANDA_LIVE_BACNET=1 or SPANDA_LIVE_KNX=1 and network env vars (see iot.md).
  3. Point SPANDA_BACNET_CMD / SPANDA_KNX_CMD at the package scripts/read_*.sh helpers, or build with --features live-building so Rust dispatches registry read_*.py before the Python bridge.
  4. Verify with ./scripts/smart_spaces_live_iot_smoke.sh (mock) before SPANDA_LIVE_IOT_HARDWARE=1 on the building network.

BMS sidecar (Home Assistant / MQTT)

When BACnet/KNX are already aggregated by a hub, use a sidecar bridge instead of direct field-bus reads. See smart-space-bms-bridge.md.

export SPANDA_LIVE_HOME_ASSISTANT=1
export SPANDA_HOME_ASSISTANT_URL=http://127.0.0.1:8123
export SPANDA_HOME_ASSISTANT_TOKEN=your-long-lived-token
./scripts/smart_spaces_bms_sidecar_smoke.sh

Provider pattern: packages implement iot.* import paths; missions use requires capabilities — see iot.md.


Mode missions

Mode Preconditions (readiness) Actions (via providers)
Night mode Locks secure, leak sensors online, gateway healthy Dim lights, setback HVAC, arm perimeter
Away mode Occupancy clear, windows closed Reduce HVAC, enable security recording
Lockdown Operator approval, cameras online Deny entry, record all access attempts
Maintenance BMS path verified, local override available Isolate zones, notify occupants

Readiness profile: smart-space-readiness.md


Life safety

Life-safety devices remain on certified hardware paths. Spanda:

  1. Verifies sensor quorum and battery levels before trusting automation.
  2. Escalates fire / CO / leak events to emergency missions.
  3. Records assurance evidence for inspection and insurance.
  4. Never blocks UL-listed panel functions — orchestrates around them.

Emergency examples: examples/solutions/smart-spaces/emergency-response/


Digital twin

Building automation twins mirror:

See digital-twin.md and spanda.devices.toml twins section in the smart-spaces blueprint.