KME Smart is a unified IoT operations platform for devices, automation, monitoring
and industrial connectivity. This documentation is everything you need to get
started, connect devices, build integrations, and scale projects into production.
Real-time platform MQTT based ESP ecosystem Industrial ready No-code automation
What is KME Smart?
KME Smart connects, monitors and manages devices and operations — from a single
curtain motor in a home to a 10,000-node factory floor. It is one
vertically-integrated stack: firmware, a real-time MQTT message bus, a no-code
automation engine, branded dashboards, and an open REST API — so a project that
starts on one device scales to an entire site without re-architecting.
Real-time monitoring
Sub-second telemetry, live charts, alerts and event streams from every device.
No-code automation
When → then rules with schedules, sensor triggers, geofences and webhooks.
Device management
Provision, tag, group and OTA-update fleets from one pane — built for ESP32.
Platform architecture
Every device speaks to the platform over MQTT. KME Smart ingests that traffic, keeps
live device state, runs the automation engine, and exposes everything through
dashboards, a REST/streaming API, and third-party integrations.
You do not need to be a programmer to run KME Smart. Operators build dashboards and
automations with no code. Developers get a clean MQTT + REST surface and SDKs to
embed KME into their own products. This documentation serves both — start with
Getting Started,
then branch into whichever path fits you.
New to KME?
The fastest path to a live device is the 6-step Getting Started guide — account, device, Wi-Fi, dashboard, first automation. About 10 minutes.
From zero to a live device on a dashboard in about ten minutes. This is the most
important section — keep it open in one tab while you work.
6
Steps
~10m
Time
0
Cost to start
1
Device needed
Before you begin
You will need an ESP32 or ESP8266 board, a USB cable, and a 2.4 GHz Wi-Fi network. That is it — no toolchain, no SDK install for the quick path.
The six steps
Create an account
Open the platform and sign up with your email. Your account is a workspace — every device, dashboard and automation lives inside it, isolated from other workspaces.
Add your first device
In Devices → Add device, give it a name and pick the board type. KME issues a one-time device token — this is the device's password to the MQTT broker. Copy it now; you will not see it again.
Flash & connect to Wi-Fi
Use the in-browser KME Configurator to flash firmware over USB (no IDE). On first boot the device opens a setup access point; choose your Wi-Fi and enter the password. See Device Provisioning for every method.
Watch it come online
Within seconds the device turns green in the device list. Telemetry — switch states, sensor values — starts streaming live.
Open the dashboard
Drop widgets onto a canvas: a switch for a relay, a gauge for temperature, a chart for history. Bind each widget to a device channel. Changes are live both ways.
Create your first automation
Add a rule: when a sensor crosses a threshold, then toggle an output and notify you. No code — see Automations.
2.4 GHz only
Most ESP boards do not support 5 GHz Wi-Fi. If the device never comes online, check that you joined it to a 2.4 GHz SSID.
Connect with raw MQTT instead
Already have a device with its own firmware? Skip flashing and point any MQTT client at the broker using the device token from step 2:
connect.shbash
# Publish a temperature reading to your device's channel
mosquitto_pub --cafile ca.pem \-h mqtt.kmesmart.com -p8883\-u"<workspace>:<device_id>"-P"<device_token>"\-t"kme/<workspace>/<device_id>/state"\-m'{"V":{"temperature":24.6}}'
That value appears on the dashboard instantly. The full topic and payload model is in MQTT Documentation.
KME Smart is built around the ESP ecosystem and speaks every common IoT transport.
If your device can reach an MQTT broker, it can join the platform.
ESP ecosystem
These chips are first-class: official firmware builds, in-browser flashing, and firmware-aware defaults for the status LED and pairing button.
ESP32
Dual-core, Wi-Fi + BLE. The workhorse for relays, dimmers and multi-sensor nodes.
ESP32-S3
More RAM and AI acceleration. Status LED GPIO2, pairing GPIO0.
ESP32-C3
RIS-V, low cost, BLE 5. Pairing button defaults to GPIO9.
ESP8266
The classic budget node. Status LED GPIO2, pairing GPIO0.
ESP32-H2
802.15.4 / Thread + Zigbee radio for low-power mesh endpoints.
Bring your own
Any board with an MQTT client and the device token works — see SDKs.
Firmware-fixed pins
The status LED and pairing button GPIOs above are reserved by the device firmware at boot. The KME Configurator already defaults to the correct pin per chip — do not override them unless your hardware genuinely differs.
Connectivity
One unified message bus, many transports. KME bridges them so a mesh sensor and a cellular tracker show up the same way.
Transport
Spec
Best for
Status
Wi-Fi
802.11 b/g/n, 2.4 GHz
Mains-powered devices, dashboards
Live
BLE
Bluetooth LE 5.0
Provisioning, low-power sensors
Live
LoRa
868 / 915 MHz
Long-range fields, remote sites
Live
MQTT
3.1.1 over TLS
The core device ↔ platform bus
Live
Zigbee
802.15.4 mesh
Dense low-power building mesh
Planned
Device classes
Out of the box KME models switches & relays, dimmers, RGB lighting, shutters & curtain motors, climate sensors (DHT22, BME280), energy meters, GPS trackers, and low-power battery sensors. Each maps to a dashboard widget automatically.
Provisioning is how a device gets its network credentials and joins your workspace.
KME supports several methods — from a phone tapping a sensor to flashing a thousand
units on a bench.
The provisioning lifecycle
Whatever the method, every device walks the same path: it powers on with no credentials, receives Wi-Fi + a device token, claims itself into a workspace, and comes online.
The provisioning state machine — identical across every method
Methods
AP mode (SoftAP)
Device hosts a temporary Wi-Fi network. Join it, pick your SSID, enter the password. Zero extra hardware — the universal fallback.
BLE onboarding
A phone discovers the device over Bluetooth LE and writes credentials. Smoothest consumer experience; no network hopping.
QR setup
Scan a QR sticker to pre-fill device identity, then push Wi-Fi from the app. Great for retail kits.
SmartConfig
Broadcast credentials over the air to nearby unconfigured ESP devices at once.
Device claiming
A pre-flashed device announces itself; an operator approves it into a workspace from the dashboard.
Bulk provisioning
Flash a batch on the bench with baked-in tokens. Each unit claims itself on first power-up in the field.
Treat the device token like a password
The token is shown once at creation. It is the device's credential to the broker. If it leaks, rotate it from Devices → ⋯ → Regenerate token — note this requires re-flashing or re-pushing creds to the device.
Re-provisioning & factory reset
Hold the pairing button (see Supported Hardware for the per-chip GPIO) for ~5 seconds to wipe stored Wi-Fi and return the device to setup mode. The workspace claim is preserved unless you also remove the device from the dashboard.
MQTT is the heart of KME Smart — the low-latency, bidirectional bus every device
speaks. This is the contract between your firmware and the platform.
Why MQTT
Low latency — typically under 100 ms device-to-dashboard.
Bidirectional — state flows up, commands flow down, one connection.
NAT-friendly — the device dials out; no inbound ports or static IPs.
Resilient — survives flaky links and reconnects with session state.
Broker
Setting
Value
Host
mqtt.kmesmart.com
Port (TLS)
8883 — required in production
Port (plain)
1883 — local / development only
Protocol
MQTT 3.1.1, QoS 0–1
Client ID
the device_id
Username
<workspace>:<device_id>
Password
the one-time device_token
Topics
Every topic is namespaced to your workspace so a leaked token can never read or write another workspace's data.
topic patterntext
kme/<workspace>/<device_id>/<channel>
Channel
Direction
Purpose
state
Device → KME
Telemetry: switch states, sensor values
cmd
KME → Device
Commands: toggle, set, dim, request state
online
Device → KME
Birth / Last-Will presence (1 / 0, retained)
ota
KME → Device
Firmware update instructions & progress
Device publishes state, subscribes to commands — the broker enforces per-topic authorization
Payload format
State and command payloads are compact JSON. S is the array of switch/output states; V is a map of named sensor values. KME merges incoming values, so a device may report a subset.
Devices set a retained Last-Will on .../online with payload 0, and publish 1 on connect. KME also polls stale devices with status_request so a missed message never leaves the dashboard wrong for long. Commands publish at QoS 1; state at QoS 0 (idempotent — the next update corrects any gap).
Firmware authors
Always validate the broker's TLS certificate, never hard-code tokens, include a firmware_version in your boot state (enables OTA targeting), and back off exponentially on connect failure (max 60 s).
Everything the dashboard does, your code can do. The REST API manages devices,
sends commands, reads history, and drives automations — server-to-server.
Base URL & authentication
Base URL: https://api.kmesmart.com/v1 (dev: http://localhost:3000)
Auth: Authorization: Bearer <api_key> for server-to-server. Browser sessions use a JWT cookie.
Bodies are JSON; responses are { "ok": true, … } or { "error": "message" }.
API keys
Create scoped keys under Settings → API keys. Scopes are least-privilege: a key for a Grafana panel needs only devices:read, never devices:write.
curl -X POST https://api.kmesmart.com/v1/devices/KME9350008/command \-H"Authorization: Bearer kme_live_8f3c…"\-H"Content-Type: application/json"\-d'{"action":"toggle","value":2}'
The platform publishes to .../cmd, the device responds on .../state, and an SSE device_update event fires for any dashboard or subscriber watching.
Live updates without polling
Subscribe to /v1/events/stream (SSE) instead of polling /devices. You get device_update, lp_reading and automation_fired events the moment they happen.
Dashboards are drag-and-drop. Drop a widget, bind it to a device channel, brand it,
and share it. The same blocks power a 4-device home and a 4,000-sensor floor.
Widget library
Gauge
Radial value vs. range — temperature, pressure, fill level.
Chart
Time-series line/area with live tail and history.
Switch
Toggle a relay or output, with live confirmation.
RGB
Colour wheel + brightness for LED strips.
Map
Live GPS position and trails for fleets.
KPI card
A single big number with trend vs. yesterday.
Energy graph
Power draw, peak, and cost over time.
Slider
Dimmer / setpoint control 0–100.
Binding a widget
Drop it on the canvas
Pick a widget from the palette and place it on the grid.
Bind a data source
Choose a device and a channel — e.g. V.temperature or output S[2].
Style & brand it
Set ranges, colours, units. Apply your logo and palette for a white-label view.
Share or embed
Publish a read-only link or embed the dashboard in your own app via an iframe / signed URL.
One layout, many devices
Build a dashboard against a device template, then point it at any device of that type. Roll out 500 sites without rebuilding 500 dashboards.
KME Smart speaks to the rest of your stack. Mirror devices into your smart-home
ecosystem, pipe data into Grafana, or fan events out to chat and webhooks.
Available integrations
Home Assistant
MQTT Discovery — devices appear as entities with zero YAML.
Alexa
Voice control for switches, scenes and dimmers.
Google Assistant
Link a workspace and control devices by voice.
IFTTT
Trigger applets from device events, or act on KME from any service.
Webhooks
Signed outbound POSTs on any event; inbound webhooks as triggers.
Grafana
Read-only API key + data source for long-term analytics.
Node-RED
MQTT in/out nodes for custom flow logic.
Telegram
Push alerts and accept commands from a bot.
Slack
Channel notifications with escalation from automations.
Home Assistant in one step
Enable the integration and KME publishes MQTT Discovery messages — switches, sensors and dimmers register as native entities automatically. State mirrors both ways with command de-duplication so the dashboard and HA never fight.
Ship firmware to the whole fleet without touching a single device. Staged rollouts,
signed images, live progress, and one-click rollback.
How it works
Canary first, watch health, then promote — or roll back instantly
Capabilities
Version control — every image is tagged; devices report their running version on boot for targeting.
Staged rollouts — 10% canary → 50% → 100%, gated on error rate and reconnect success.
Signed updates — images are hash-verified; a device refuses an image that does not match.
Rollback — keep the previous slot; one click reverts the cohort to the last good version.
Resumable — interrupted downloads resume; a failed flash never bricks (A/B partitions).
Always canary first
Never push to 100% on the first wave. Roll to a 5–10% canary, watch the fleet health score and reconnect rate for at least one full reporting cycle, then promote.
Security is layered from the device to the API. Every connection is encrypted,
every credential is scoped, and no workspace can ever see another's data.
Defence in depth — each layer holds even if the one outside it is breached
Controls
Layer
Control
Transport
TLS on MQTT (8883) and HTTPS for all API traffic. Validate the server certificate chain.
Device auth
One unique token per device, issued once, rotatable. No shared secrets.
Topic authz
The broker rejects publish/subscribe outside kme/<your-workspace>/… — a stolen token cannot touch another tenant.
RBAC
Roles (Owner, Engineer, Operator, Viewer) gate every dashboard and action.
API permissions
API keys carry least-privilege scopes (devices:read, automations:write, …).
Encrypted comms
Secrets encrypted at rest; tokens stored hashed; webhook payloads signed.
Rotate on suspicion
If a device token or API key may have leaked, regenerate it immediately. Tokens are scoped, so a single rotation never affects the rest of the fleet.
The same KME Smart platform — different blueprints. This is what sets KME apart:
it is not just smart home, it is built for operations at industrial scale.
Factory monitoring
Line throughput, machine health, air handlers and alerts on one screen.
Energy tracking
Live power draw, peaks, cost and anomaly detection per circuit.
Live position, trails, geofence rules, ignition cut for vehicles.
Agriculture monitoring
Soil moisture, pump scheduling, LoRa to remote fields.
Fleet management
Cold-chain temperature, door events, route adherence, alerts.
One platform, many sites
Each solution is a blueprint on the same core — devices, MQTT, automations,
dashboards and the API are identical. Start with one line or one field, prove it,
then template it across every site without re-architecting.
Solutions are configurations, not forks
Everything in this section is built from the widgets, automations and APIs already documented here — there is no separate "industrial product" to learn.
Copy-paste starting points in every language a KME project touches. Each one
connects, authenticates, and exchanges state in the fewest lines possible.
ESP32 — Arduino
The KME Smart Arduino SDK handles reconnection, batching and TLS. Production firmware in six lines:
esp32 / main.cppcpp
// Publish a temperature reading every 2 s#include<KMESmart.h>
KMESmart kme("<device_token>");
voidsetup() {
kme.begin("wifi-ssid", "pass");
}
voidloop() {
float t = readDHT22();
kme.publish("temperature", t);
delay(2000);
}
MQTT — command line
subscribe.shbash
# Watch a device's live state
mosquitto_sub --cafile ca.pem -h mqtt.kmesmart.com -p8883\-u"acme:KME9350008"-P"<device_token>"\-t"kme/acme/KME9350008/state"-v
SDKs wrap the raw MQTT + REST surface so you ship faster. Reconnection, auth,
batching and OTA are handled for you — speak raw protocol only if you want to.
Arduino / ESP-IDF
For ESP32, S3, C3, ESP8266. Wi-Fi provisioning, TLS, OTA, auto-reconnect.
Stable
Node.js SDK
Promise API over REST + SSE. Ideal for backend integrations and bots.
Stable
Python SDK
Sync + async clients, pandas-friendly history export for analytics.
Beta
Flutter SDK
Cross-platform mobile — live device state streams and command helpers.
Beta
REST (any language)
No SDK? Every endpoint is plain HTTPS + JSON. Generate a client from the spec.
Always
MQTT (any client)
Standard MQTT 3.1.1 — use Paho, mqtt.js, or your platform's library.
Always
No lock-in
The SDKs are convenience, not a requirement. Anything that speaks MQTT or HTTPS is a first-class KME client — see Examples.
The tools that pair with the platform — flash firmware, configure devices, and
connect from a desktop.
KME Configurator
In-browser flasher & setup over USB (Web Serial) — no toolchain to install.
Open in browser →
KME Bridge
Desktop bridge that links existing devices and local networks to the cloud.
Download →
Windows tools
Standalone Windows configurator for bulk bench provisioning.
Download →
Firmware tools
Reference firmware builds and the CA certificate for TLS validation.
Download →
No install for the common path
The KME Configurator runs entirely in Chrome/Edge via Web Serial. Most users never download anything to flash and provision a device.
The questions every KME operator hits in the first week — answered.
Why is my device offline?
Most often: it joined a 5 GHz SSID (ESP boards are 2.4 GHz only), the Wi-Fi password changed, or the device token was regenerated without re-flashing. Check the device's .../online retained message; if it is 0, the broker saw it disconnect. Power-cycle and watch the status LED — see Device Provisioning.
MQTT connection failed — what do I check?
In order: (1) port 8883 reachable and TLS CA bundled on the device; (2) username is exactly <workspace>:<device_id>; (3) password is the current device token; (4) client ID equals the device ID and is unique. A second client with the same ID will kick the first.
How many devices are supported?
A workspace scales from one device to tens of thousands. The embedded broker comfortably handles thousands of devices; beyond that the platform runs against an external broker for horizontal scale. There is no hard cap in the data model.
How does OTA work?
You upload a signed image, target a cohort, and devices pull + hash-verify it on their next check-in, then reboot and report the new version. Roll out as a canary first, watch fleet health, then promote — or roll back in one click. Full detail in OTA Updates.
Do I have to use the SDK?
No. The SDKs are convenience wrappers. Any standard MQTT client or any HTTPS call is a first-class KME client — see Examples.
Can KME integrate with Home Assistant / Alexa / Grafana?
Yes — Home Assistant via MQTT Discovery (zero YAML), Alexa & Google Assistant by linking a workspace, and Grafana with a read-only scoped API key. See Integrations.
What happens to automations if the dashboard is closed?
They keep running. Automations execute server-side, not in the browser, so a rule fires whether or not anyone is watching.
Still stuck?
Search the docs with ⌘K, or open the platform and use in-app support.