Setup New MQTT2GO Virtual Device
The MQTT2GO virtual devices are utilized for incorporation of devices from other services or purely software devices. This way, we can secure a separate process to add non-standard (software) devices into the MQTT2GO standard. As it will be described in the following text, this procedure expects the adopters to implement part of the proccess on their side, without which the whole setup process would not work.
Creation of new MQTT2GO Virtual device
This section describes the procedure of creating a new MQTT2GO virtual device. Each step is separately defined to avoid confusion while implementing:
- The third party platform tries to connect to HTTPS: /add_platform using the user credentials (username and password).
- If the credentials are valid, the management server forwards this request to the HTTPS: /add_platform of the MQTT2GO cloud broker and initializes the login process.
- The MQTT2GO cloud broker then sends activation code via the SMS for client verification.
- User enters this code into the third party platform, which then sends it into the HTTPS: /get_platform_credentials of the management server.
- The management server forwards the activation code to the HTTPS: /get_platform of MQTT2GO cloud broker.
- The MQTT2GO cloud broker then sends the certificate to the HTTPS: /get_platform of the management server.
- The management server then sends a response with user ID, broker IP, certificate, login, and password to the HTTPS: /get_platform/credentials from which the third party platform saves it.
- The third party platform connects to the MQTT2GO cloud broker using the provided certificate, access ID, login, password, and broker IP.
- The third party platform subscribes to the homes/<access_id>/in and publishes a QUERY_HOMES message to homes/access_id/out.
- The MQTT2GO cloud broker publishes to the homes/<access_id>/in message with all available MQTT2GO homes and their respective gateways.
- The third party platform subscribes to the <home_id>/<gw_id>/add_virtual_device/in and publish a message with device ID, device type, name, entities to the <home_id>/<gw_id>/add_virtual_device/out.
- The third party platform receives setup result, device id, and groups. Then it publishes device_id and group name to <home_id>/<gw_id>/add_virtual_device/out.
- Based on the entities, the controller subscribes to all their topics. From now on, the MQTT communication follows the MQTT2GO standard.
Fig. 1: Process of creating new MQTT2GO Virtual Device.
Similarly to the process of setting up a new controller, the Authentication part of the adding procedure can be substituted by any similar technique utilized for verification of the users (i.e., QR code verification).