┌──────────────────┐ webhooks ┌─────────────────┐
│ Shelly Gen2/3 │ ──────────→│ API Gateway │
│ 65 channels │ │ + Lambda webhook│
└──────────────────┘ └────────┬────────┘
│
┌──────────────────┐ Cloud API ┌────────┴────────┐
│ Shelly Cloud │ ──────────→│ Lambda energy- │
│ shelly-113-eu │ (1h cron) │ collector │
└──────────────────┘ └────────┬────────┘
│
┌──────────────────┐ ┌────────┴────────┐
│ Ring cameras │ ──────────→│ DynamoDB x3 │
│ 9 cameras │ │ device-status │
└──────────────────┘ │ device-positions│
│ energy-history │
┌──────────────────┐ └────────┬────────┘
│ Motion Sensor │ │
│ SHMOS-02 Garage │ ┌────────┴────────┐
└──────────────────┘ │ Lambda API │
│ 8 endpoints │
└────────┬────────┘
│
┌────────┴────────┐
│ S3 + CloudFront │
│ SPA (Vanilla JS)│
└─────────────────┘
| Frontend | Vanilla HTML/JS, Chart.js, simpleheat |
| Backend | AWS Lambda (Node.js 20) |
| Database | DynamoDB × 3 tabele |
| Hosting | S3 + CloudFront |
| API | API Gateway REST |
| Scheduler | EventBridge (energy scan co 1h) |
| IaC | Terraform (Atlas) |
| Koszt | $0/mies. (AWS Free Tier) |
| Endpoint | Opis |
|---|---|
| GET /status | Status wszystkich urządzeń (on/off/offline) |
| GET /devices | Lista urządzeń z pozycjami |
| GET /positions | Pozycje na mapie (x,y,floor) |
| GET /energy/rooms | Zużycie energii per pokój (24h/7d/30d) |
| GET /energy/room-devices | Drill-down: urządzenia w pokoju |
| GET /sensor | Motion sensor (temp, lux, battery) |
| POST /scene | Wykonaj scenę (all-off, leaving, vacation) |
| POST /webhook | Shelly webhook receiver |
| Table | PK | SK | TTL |
|---|---|---|---|
| device-status | tenantId_deviceId | — | — |
| device-positions | tenantId_deviceId | — | — |
| energy-history | tenantId#deviceId#ch | timestamp | 90 dni |
| Pokój | Piętro | Urządzenia |
|---|---|---|
| 🍳 Kitchen | Parter | 9 (6 lights + 3 blinds) |
| 🛋️ Living Room | Parter | 4 (2 lights + 2 blinds) |
| 💼 Office | Parter | 3 (2 lights + 1 blind) |
| 🧺 Laundry | Parter | 2 (1 light + 1 blind) |
| 🪜 Stairs | Parter | 5 (4 lights + 1 blind) |
| 🚗 Garage | Parter | 4 (light + gate + sensor) |
| 🛁 Bathroom down | Parter | 2 lights |
| 🧥 Windcatcher | Parter | 2 lights |
| 🏠 Outside | Parter | 8 (6 lights + gate + lock) |
| 🌿 Garden | Parter | 2 (light + water well) |
| 🛏️ Main Bedroom | Piętro | 6 (4 lights + 1 blind + shower) |
| 👦 Tobi Bedroom | Piętro | 3 (2 lights + 1 blind) |
| 👶 Lena Bedroom | Piętro | 4 (2 lights + 2 blinds) |
| 👧 Lucja Bedroom | Piętro | 4 (2 lights + 2 blinds) |
| 🚿 Bathroom Big | Piętro | 3 (2 lights + 1 blind) |
| 🏠 Attic | Piętro | 2 lights |
| ID | Scenariusz | Co sprawdza | Wynik | Szczegóły |
|---|
Właściciel: —