Pronounced "homie" - a local-first, privacy-focused smart home control system. Manage your Zigbee devices through a REST API without cloud dependencies or privacy concerns.
- Direct Zigbee device control via EZSP serial protocol (no Zigbee2MQTT/MQTT required)
- REST API for device management
- Real-time device events via Server-Sent Events (SSE)
- Multi-profile support for multiple installations
- MCP server for AI assistant integration
- Swagger API documentation
- Go 1.24+
- Zigbee 3.0 USB adapter (e.g., SONOFF Zigbee 3.0 USB Dongle Plus)
- just command runner
-
Clone the repository:
git clone https://github.com/urmzd/homai.git cd homai -
Build the binaries:
just build
-
Run the API server:
./bin/api --port /dev/cu.SLAB_USBtoUART
-
(Optional) Run the MCP server:
./bin/mcp
-
Access the API at http://localhost:8080
| Binary | Description |
|---|---|
bin/api |
REST API server for device management and Zigbee control |
bin/mcp |
MCP server for AI assistant integration (stdio transport) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| GET | /api/v1/health |
Health check (versioned) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/devices |
List all paired devices |
| GET | /api/v1/devices/:id |
Get device details |
| PATCH | /api/v1/devices/:id |
Rename a device |
| DELETE | /api/v1/devices/:id |
Remove a device |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/devices/:id/state |
Get device state |
| POST | /api/v1/devices/:id/state |
Set device state |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/discovery/start |
Start device pairing mode |
| POST | /api/v1/discovery/stop |
Stop device pairing mode |
| GET | /api/v1/discovery/events |
SSE stream of discovery events |
| Method | Endpoint | Description |
|---|---|---|
| GET | /swagger/* |
Swagger UI |
Configuration is stored in SQLite at ~/.config/homai/homai.db
| Command | Description |
|---|---|
just build |
Build all binaries to bin/ |
just clean |
Remove dist/ directory |
just test |
Run all tests |
just lint |
Run gofmt, golangci-lint, go vet |
just check |
Run lint + test (default) |
just swagger |
Generate Swagger documentation |
just run |
Run API server with live reload (air) |
just open-db |
Open database in sqlite3 |
just reset-db |
Delete the database |
┌─────────────┐ ┌──────────────┐ ┌────────────────┐
│ API Server │────▶│ EZSP Layer │────▶│ Zigbee Devices │
│ (Go/Gin) │◀────│ (Serial) │◀────│ │
└─────────────┘ └──────────────┘ └────────────────┘
│
▼
┌─────────────┐ ┌─────────────┐
│ SQLite │ │ MCP Server │
│ (Config) │ │ (stdio) │
└─────────────┘ └─────────────┘
- SONOFF Zigbee 3.0 USB Dongle Plus
- Sylvania A19 70052