Configuration
The IoT Adapter uses a layered configuration system: defaults → SQLite database → environment variables.
Configuration Precedence
- Environment variables — Highest priority, set in
.envor system environment - SQLite database — Runtime configuration stored locally
- Defaults — Built-in fallback values
Key Environment Variables
| Variable | Description | Default |
|---|---|---|
PORT | HTTP server port | 3000 |
API_KEY | ZenEdge authentication key | Required |
DB_PATH | SQLite database path | ./data/iot.db |
UNIFI_HOST | UniFi controller address | — |
UNIFI_USERNAME | UniFi admin username | — |
UNIFI_PASSWORD | UniFi admin password | — |
LOG_LEVEL | Logging verbosity | info |
HEALTH_CHECK_INTERVAL | Device poll interval (ms) | 30000 |
Admin UI
The IoT Adapter includes a local admin web interface for:
- Viewing registered devices
- Managing device configurations
- Viewing logs and diagnostics
- Running device tests
Access at http://localhost:PORT/admin (requires local authentication).
Device Registration
Devices are registered via the admin UI or API:
POST /api/devices/register
Content-Type: application/json
{
"name": "Front Door Lock",
"type": "lock",
"vendor": "unifi",
"config": {
"device_id": "ua-door-001"
}
}
Next Steps
- Supported Vendors — Compatible devices
- Logs & Diagnostics — Monitoring