Device Discovery & Control
Discovery Methods
SmartyHome OS uses a hybrid discovery system that finds devices through multiple channels simultaneously:
1. Cloud Devices (MQTT)
After linking your tablet to the cloud, all your SmartyHome cloud devices appear automatically. These devices connect directly to mqtt.smartyhome.in:1883 and sync in real-time.
Cloud devices are identified by their cloud_device_id — a numeric ID assigned when the device was provisioned. You can see this in Device Details.
2. UDP Discovery (Local LAN)
SmartyHome OS broadcasts a discovery packet on your local network every 30 seconds. Compatible devices respond with their identity, capabilities, and IP address.
Discovery packet: SMARTY_DISCOVER_V1
Broadcast to: 255.255.255.255:48899
Frequency: Every 30 seconds
Supported protocols: HTTP probe, UDP broadcast, mDNS, UPnP — covering Shelly, TP-Link, IKEA, Philips Hue, Sonoff, and custom ESP devices.
3. Manual Add
Go to Discovery → Add Device:
- Enter device IP address or MAC
- Select device type from template
- The system probes the device and adds it
Supported Device Types
| Category | Types | Control Methods |
|---|---|---|
| Lights | On/Off, RGBWW, CCT, Dimmable | Toggle, Brightness Slider, Color Wheel |
| Fans | Speed 1-5, Oscillating | Speed Buttons, Toggle |
| Switches | Relay, Plug, Wall Switch | ON/OFF Toggle |
| Curtains | Motor, Roller | Open/Close/Stop, Position Slider |
| Doorbells | SH01DB, SH01DB2 | Ring Alert, Camera View |
| Sensors | Motion, Door, Temp/Humidity | Readings, Alerts, History |
| IR Blasters | IR TX/RX | Learn + Send IR Codes |
| RF 433MHz | RF TX/RX | Learn + Send RF Codes |
ESP32 / ESP8266 Firmware
Flashing ESP32
- Download firmware from Downloads
- Install esptool:
pip install esptool - Connect ESP32 via USB
- Erase:
esptool.py --chip esp32 erase_flash - Flash:
esptool.py --chip esp32 write_flash 0x0 firmware.bin
Provisioning
- After flash, ESP opens WiFi AP:
SMARTY_WIFI_XXXX - Connect phone to this AP
- Open
192.168.4.1in browser - Enter home WiFi credentials
- Device connects to cloud → appears on dashboard
Device Control
Via Dashboard
- Home: Favorite devices with toggle
- Room: Devices grouped by room
- Devices: Full list with search
Via MQTT (Advanced)
# Turn device ON
mosquitto_pub -h mqtt.smartyhome.in -t "devices/25/node/1/command" -m '{"command":"on_off","value":"on"}'
Via REST API (Advanced)
curl -X POST https://api.smartyhome.in/mobile/assistant/devices/25/control \
-H "Authorization: Bearer TOKEN" \
-d '{"node_id":1,"command":"on_off","value":"on"}'
Hybrid Device Identity
When the same device exists both locally and in the cloud, the cloud_device_id is the primary key. The system merges:
- Cloud data is authoritative for: type, model, nodes, room
- Local data is used for: name (user override), online status (local ping)