SelenaCore — Getting Started
SelenaCore
Open-source local smart home core for Raspberry Pi
What is it
SmartHome LK Core is an open-source (MIT) smart home hub that runs on Raspberry Pi 4/5 or any Linux SBC. Works fully offline — voice assistant, automations, device management — no subscription, no cloud required.
Three principles:
- Core is immutable — SHA256 protection of all core files, Integrity Agent checks every 30 sec
- Modules are isolated — HTTP/localhost:7070 only, no direct access to core data
- Agent watches — IntegrityAgent: stop modules → notify → rollback → SAFE MODE
Quick Start
Requirements
- Raspberry Pi 4/5 (4–8 GB RAM) or any Linux SBC
- Docker + Docker Compose
- Python 3.11+
Launch
git clone https://github.com/dotradepro/SelenaCore.git
cd SelenaCore
cp .env.example .env
# Edit .env as needed
docker compose up -d
Core API: http://localhost:7070
UI (PWA): http://localhost:80 or http://smarthome.local:80
First Launch — Onboarding Wizard
On first start (or without Wi-Fi) the core creates an access point:
SSID: SmartHome-Setup
Password: smarthome
Connect from your phone → open browser → 192.168.4.1 → follow the 9-step wizard.
Architecture
smarthome-core ~420 MB FastAPI, Device Registry, Event Bus,
Module Loader, Cloud Sync, Voice Core,
LLM Engine, UI Core
smarthome-modules 180-350 MB All user modules (Plugin Manager)
smarthome-sandbox 96-256 MB Temporary container for testing (--rm)
smarthome-agent systemd Integrity Agent — independent process
Core API
Base URL: http://localhost:7070/api/v1
Auth: Authorization: Bearer <module_token>
| Method | Path | Description |
|---|---|---|
| GET | /health | Core status (no auth required) |
| GET | /devices | Device list |
| POST | /devices | Register device |
| GET | /devices/{id} | Specific device |
| PATCH | /devices/{id}/state | Update state |
| DELETE | /devices/{id} | Delete |
| POST | /events/publish | Publish event |
| POST | /events/subscribe | Subscribe to events (webhook) |
| GET | /modules | Module list |
| POST | /modules/install | Install module (ZIP) |
| POST | /modules/{name}/start | Start module |
| POST | /modules/{name}/stop | Stop module |
| GET | /integrity/status | Integrity Agent status |
| GET | /system/info | Device info |
| POST | /wizard/step | Onboarding wizard step |
Full documentation: http://localhost:7070/docs (Swagger UI, auto-generated by FastAPI).
Voice Assistant
Fully offline — STT and TTS work without internet.
Wake-word (openWakeWord)
→ Audio recording
→ Whisper.cpp STT ~0.8–2 sec
→ Speaker ID (resemblyzer) ~200 ms
→ Fast Matcher (YAML) ~50 ms
→ LLM Fallback (Ollama) ~3–8 sec (Pi 5, 8GB only)
→ Piper TTS ~300 ms
→ History (SQLite)
Supported languages: uk, en.
SDK for Module Developers
smarthome new-module my-module # create module structure
smarthome dev # mock Core API on :7070
smarthome test # run tests
smarthome publish # package and upload to SelenaCore
Security
- Integrity Agent — SHA256 check of core files every 30 sec
- AES-256-GCM — all OAuth tokens encrypted in
/secure/tokens/ - API proxy — modules never receive tokens directly
- Biometrics — stored locally only, cloud sync blocked
- Core API — inaccessible outside localhost (iptables)
- Rate limiting — 100 req/sec per token; PIN: 5 attempts → 10 min lock