1. HTTP (recommended)

Device can register its config by calling Thingoo's HTTP endpoint.

Device's config cannot be changed in webapp to keep only one source of truth.

Device has to send unique device key as well as its MAC address (to identify duplicated IDs).

The following "handshake" flow is being fully executed by Thingoo's connector library (specific for each environment). This process shouldn't be started directly by the user.

Registration URL:

POST ${THINGOO_INSTANCE}/api/devices

Registration URL can only be accessed by device clients with Authorizaton header containing JWT access token.

To obtain access token for device, POST following data to authorization server's token URL:

POST /auth/realms/Thingoo/protocol/openid-connect/token HTTP/1.1
Host: <https://dev.thingoo.xyz>
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=thingoo-device&client_secret=SECRET_HERE

client_secret is an environmental secret that can be accessed in authorization server's admin console, or just visit:

Every time a device boots up, it will send a POST request to the registration URL with following data structure:

{
    "key": "test",
    "macAddress": "c0:3e:ba:c3:50:0b",
    "entities": [
        {
            "key": "temp",
            "type": "SENSOR",
            "unitType": "DECIMAL",
            "unitDisplayName": "C"
        }
    ]
}

Entity is a single value that a device can receive (actuator) or provide (sensor). In this example, we specify a device with one entity - "temp" which will be used as a key while sending readings to Thingoo platform.

2. MQTT (deprecated)

Device can register its config by calling Thingoo's MQTT broker with appropriate message.

Device's config cannot be changed in webapp to keep only one source of truth.