MQTT API
This API is used by Enapter devices to communicate with the Enapter Cloud. It is based on MQTT protocol. The API allows to send telemetry and properties from the device to the cloud, receive commands from the cloud, and send command responses back to the cloud.
If you need to integrate your device with Enapter Cloud, you can use this API. Follow the Creating Standalone Device tutorial to learn more how to use this API.
Send telemetry
Publish telemetry message to the topic:
v1/from/<hardware_id>/<channel_id>/v1/telemetry
The message payload is a JSON object with timestamp and telemetry attributes:
{
"timestamp": 1759212723,
"temperature": 23.5,
"pressure": 2.7
}
timestammpintegerrequired#The
timestampis in seconds since epoch.
<other keys>any#The other keys is telemetry attributes which should be described in the device blueprint.
Send properties
It works similar to telemetry. Publish properties message to the topic:
v1/from/<hardware_id>/<channel_id>/v1/properties
The message payload is a JSON object with timestamp` and properties attributes:
{
"timestamp": 1759212723,
"vendor": "Enapter",
"fw_ver": "7.5.0"
}
timestammpintegerrequired#The
timestampis in seconds since epoch.
<other keys>any#The other keys is properties attributes should be described in the device blueprint.
Receive commands
Subscribe to the topic:
v1/to/<hardware_id>/<channel_id>/v1/command/requests
The message payload is a JSON object with request id, command name, and optional command arguments:
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "set_power",
"arguments": {
"power": 5000
}
}
idstringrequired#The
idis a unique identifier of the command request. Use it in the command response.
namestringrequired#The
nameis the command name. It should be described in the device blueprint.
argumentsobject#The
argumentsis a JSON object. Keys should be described in the device blueprint.
Send command responses
Publish command response message to the topic:
v1/from/<hardware_id>/<channel_id>/v1/command/responses
The message payload is a JSON object with request id, execution state, and optional payload result:
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"state": "completed",
"payload": {
"new_power": 4700
}
}
idstringrequired#The
idshould match the command request id.
statestringrequired#The
stateis the command execution state. Canb:completedwhen the command is successfully completed.errorwhen the command execution failed.logto send intermediate log messages during command execution.
payloadobject#The
payloadis a JSON object. Keys should be described in the device blueprint.