Device discovery process
The device discovery process is relevant when:
- The user needs to confirm adding the device to the system.
- The device needs to be granted permission to connect to MQTT.
The device must connect to an MQTT broker with authorization access rights:
username: "discovery"
password: "discovery"
For the device to announce itself in the system, it must publish a message to the broker with the device's name (or any message that will notify the user about which device is waiting to be added).
discovery/new/<device-id> -> "Device name"
<device-id> - must be a unique device identifier and meet the requirements for Topic IDs in homie.
After the user confirms adding the device, the discovery/accepted/<device-id> topic will receive a password for authorization in MQTT. After that, the device should reconnect to the MQTT broker with access rights:
username: <device-id>
password: <token>
The device will not be able to re-obtain an authorization token, so it must save the access rights.
You can run the discovery process an unlimited number of times.
Adding new device from discovery
After connecting the device to 2Smart Standalone, the discovery icon in the admin panel will be marked with a green circle. Click on this icon.
On the window that appears, сlick on the “Add” button.
The new device will be added to the Dashboard.