Skip to main content

How the System Works

From tap to physical device

  1. User toggles a device in the dashboard or speaks a voice command.
  2. API updates device state in the database and writes a device log entry.
  3. MqttService publishes to the correct topic:
    • With esp32_name: smarthome/sala/relay/3
    • Without a board name: smarthome/relay/3 (legacy compatibility)
  4. ESP32 receives the message and energizes or de-energizes the relay.
  5. Pusher pushes the new state to all connected clients in real time.

Multi-Tenant

Each company (tenant) gets:

  • An isolated database
  • A subdomain: {company}.homatic.io
  • Branding settings (logo, colors, dashboard title)
Central API Tenant API (per subdomain)
│ │
├─ Super Admin ├─ Devices, Rooms, Scenes
├─ Billing (Stripe) ├─ Automations, Reports
└─ Tenant provisioning └─ Branding, Users

Multiple ESP32 boards

A tenant can attach more than one ESP32. Each board has a unique name (esp32_name), such as sala or bedroom, which scopes MQTT topics:

smarthome/sala/relay/1 … smarthome/sala/relay/16
smarthome/bedroom/relay/1 … smarthome/bedroom/relay/16

Offline mode

When the cloud is unreachable, the web or mobile client discovers the local API address and continues control on the home LAN.

Next step

Quick start