The API Defintions for the Rainmaker MQTT topics for communication with RainMaker nodes.
TLS encryption with RainMaker issued X.509 certificate-based mutual authentication is required to publish and subscribe to these topics.
Command requests/responses use Binary TLV (Tag, Length, Value) format with these standard tags:
[Node connection] AWS IoT Core presence events for device connections
Available only on servers:
Accepts the following message:
{
"clientId": "rainmaker-node",
"clientInitiatedDisconnect": true,
"eventType": "connected",
"principalIdentifier": "6cf12df543fe301f65b52632c8a59b743467db17bae30ce74120663e96736ff3",
"sessionIdentifier": "adecf6af-2abd-4f23-8309-cf9257de3fa0",
"timestamp": 1743656583784,
"versionNumber": 0,
"ipAddress": "192.168.1.100"
}
[Node connection] AWS IoT Core presence events for device disconnections
Available only on servers:
Accepts the following message:
{
"clientId": "rainmaker-node",
"clientInitiatedDisconnect": true,
"eventType": "disconnected",
"principalIdentifier": "6cf12df543fe301f65b52632c8a59b743467db17bae30ce74120663e96736ff3",
"sessionIdentifier": "adecf6af-2abd-4f23-8309-cf9257de3fa0",
"timestamp": 1743656583784,
"versionNumber": 0,
"disconnectReason": "CLIENT_INITIATED_DISCONNECT"
}
[Node config] Node configuration
$aws/rules/esp_node_config/node/<node_id>/config
to save costsAvailable only on servers:
Accepts the following message:
{
"node_id": "Socfz6jwKPv8wDw4AakTts",
"config_version": "2020-03-20",
"info": {
"name": "ESP RainMaker Multi Device",
"model": "multi_device",
"platform": "esp32",
"fw_version": "1.0",
"type": "Multi Device",
"project_name": "multi_device"
},
"attributes": [
{
"name": "cmd-resp",
"value": "1"
}
],
"devices": [
{
"name": "Switch",
"type": "esp.device.switch",
"primary": "Power",
"attributes": [
{
"name": "Serial Number",
"value": "012345"
}
],
"params": [
{
"name": "brightness",
"type": "esp.param.name",
"data_type": "string",
"properties": [
"read"
],
"ui_type": "esp.ui.toggle",
"bounds": {
"min": 0,
"max": 100,
"step": 1
}
}
]
}
],
"services": [
{
"name": "Time",
"type": "esp.service.time",
"attributes": [
{
"name": "deactivation_support",
"value": "no"
}
],
"params": [
{
"name": "TZ",
"type": "esp.param.tz",
"data_type": "string",
"properties": [
"read"
],
"ui_type": "esp.ui.text",
"bounds": {
"min": 0,
"max": 10,
"step": 1
}
}
]
}
]
}
[Node params] Initial local parameters for nodes, this resets the node parameters to the provided values.
$aws/rules/esp_init_params/node/<node_id>/params/local/init
to save costsAvailable only on servers:
Accepts the following message:
Initial parameter values for the node
{
"Light": {
"brightness": 165
}
}
[User node mapping] Node can request or confirm user to node mapping
$aws/rules/esp_user_node_mapping/node/<node_id>/user/mapping
to save costsAvailable only on servers:
Accepts the following message:
{
"node_id": "rainmaker-node",
"user_id": "f3633ba0-3451-4996-842a-82b292b69371",
"secret_key": "abcdef123456",
"reset": false,
"timeout": 300
}
[Node params] Parameter change request sent to node by cloud
Available only on servers:
Accepts the following message:
Desired parameter change values for the node
{
"Light": {
"brightness": 165
}
}
[Node params] Delta in parameters reported by nodes whenever they are changed
$aws/rules/esp_set_params/node/<node_id>/params/local
to save costsAvailable only on servers:
Accepts the following message:
Changed parameter values for the node
{
"Light": {
"brightness": 165
}
}
[BETA] [Node params] Delta in parameters reported by nodes whenever they are changed
$aws/rules/esp_set_group_params/node/<node_id>/params/local/<group_id>
to save costsAvailable only on servers:
Accepts the following message:
Changed parameter values for the node
{
"Light": {
"brightness": 165
}
}
[OTA] Nodes request for OTA firmware updates
$aws/rules/esp_node_otafetch/node/<node_id>/otafetch
to save costsAvailable only on servers:
Accepts the following message:
{
"fw_version": "1.0.0",
"network_id": "network-123456"
}
[OTA] OTA update details if available sent to nodes. This is sent as a response to OTA fetch request or when a force pushed job is created.
Available only on servers:
Accepts the following message:
{
"url": "https://esp-rainmaker-ota-<Account-Id>-<Stage>.s3.<Region.amazonaws.com/users/<Admin-user-Id>/firmwareimages/<Image-Id>/<Image-Name.bin?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<>&X-Amz-Date=20240527T110857Z&X-Amz-Expires=86400&X-Amz-Security-Token=<>&X-Amz-SignedHeaders=host&X-Amz-Signature=5fb4f5ceed738e7c91ebfd7262b57562d66fb3022cb8f9576ce65c3f98f02859",
"stream_id": "3Aq7BcdkX3TdoBSgPAdbTE",
"file_md5": "d41d8cd98f00b204e9800998ecf8427e",
"file_size": 1048576,
"ota_job_id": "tyNoVBocEJ8ZQNuc9iMHZB",
"fw_version": "2.0.0",
"ota_available": true,
"metadata": "string"
}
[OTA] OTA update status from nodes once they start the OTA job.
$aws/rules/esp_node_otastatus/node/<node_id>/otastatus
to save costsAvailable only on servers:
Accepts the following message:
{
"status": "in_progress",
"ota_job_id": "tyNoVBocEJ8ZQNuc9iMHZB",
"additional_info": "Downloaded 50%",
"network_id": "network-123456"
}
[Time Series Data] Time series data from nodes.
$aws/rules/esp_ts_ingest/node/<node_id>/tsdata
to save costsAvailable only on servers:
Accepts the following message:
{
"ts_data_version": "2021-09-13",
"ts_data": [
{
"name": "temperature",
"dt": "float",
"ow": false,
"records": [
{
"v": 25.5,
"t": 1648147200
}
]
}
]
}
[Time Series Data] Simple time series data from nodes. This is a simplified version of the time series data format with lesser aggregations.
$aws/rules/esp_simple_ts_ingest/node/<node_id>/simple_tsdata
to save costsAvailable only on servers:
Accepts the following message:
{
"name": "temperature",
"dt": "float",
"t": 1648147200,
"v": 25.5,
"d": 30
}
[Command Request Response] Command requests or responses sent from nodes to the cloud. The format is Binary of TLV (Tag, Length, Value).
$aws/rules/esp_cmd_resp/node/<node_id>/from-node
to save costsAvailable only on servers:
Accepts the following message:
{
"1": "YHZGBT8Pxe6TJDiRKu9mGL",
"3": 2,
"5": 201,
"6": "{\"cmd\":201,\"data\":{\"csr\":\"-----BEGIN CERTIFICATE REQUEST-----\\nMIICZjCCAU4CAQAwGTEXMBUGA1UEAwwORVNQMzJfREFDX1RFUXQMV...\\n-----END CERTIFICATE REQUEST-----\"}}"
}
[Command Request Response] Command requests sent from cloud to nodes. The format is Binary of TLV (Tag, Length, Value).
Available only on servers:
Accepts the following message:
{
"1": "YHZGBT8Pxe6TJDiRKu9mGL",
"2": 2,
"5": 201,
"6": "{\"cmd\":201,\"requestID\":\"abc123def456\",\"status\":\"SUCCESS\",\"description\":\"Submitted CSR successfully\"}"
}
[Alert] Channel for sending push notification alerts to associated users from nodes
$aws/rules/esp_node_alert/node/<node_id>/alert
to save costsAvailable only on servers:
Accepts the following message:
{
"nodeId": "rainmaker-node",
"messageBody": {
"message": "Alert message from the node"
}
}