Fetch Device(s)
This section of the Device API explains how to retrieve one or more devices.
Get Device
GET devices/{device_id}
Request
$ curl http://api.enapter.com/v3/devices/devicea0-45f2-4e9e-a6f0-69a310ab110b
Query Parameters
expandarray of strings#Comma-separated list of additional device information to display. By default, no additional fields are included.
Supported values:
site— includes information about the site, to which the device is connected.manifest— includes device blueprint manifest.properties— includes the last received device properties.connectivity— includes current device connection status.communication_info— includes device communication info.
Response
{
"device": {
"id": "devicea0-45f2-4e9e-a6f0-69a310ab110b",
"blueprint_id": "bluepri1-50n3-4t9d-e6v0-69i310cb110e",
"name": "Gas detector in living room",
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"updated_at": 1735689600,
"slug": "gas-detector-in-living-room",
"type": "LUA",
"authorized_role": "INSTALLER"
}
}
Request(expanded)
$ curl http://api.enapter.com/v3/devices/devicea0-45f2-4e9e-a6f0-69a310ab110b?expand=communication_info,connectivity
Response (expanded)
{
"device": {
"id": "devicea0-45f2-4e9e-a6f0-69a310ab110b",
"blueprint_id": "bluepri1-50n3-4t9d-e6v0-69i310cb110e",
"name": "My Device",
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"updated_at": 1735689600,
"slug": "my-device",
"type": "LUA",
"authorized_role": "INSTALLER",
"communication_info": {
"communication_type": "UCM_LUA",
"upstream_id": "ucmbbba0-79f2-4e9e-a6f0-69a310ab110b"
},
"connectivity": {"status": "ONLINE"}
}
}
device.idstring#Device ID.
device.blueprint_idstring#Blueprint ID.
device.site_idstring#Site ID.
device.namestring#Device name.
device.updated_atinteger#The timestamp of the most recent update of the device’s information.
device.authorized_rolestring#The user's authorized role for the device.
device.slugstring#
device.typestring#One of the following types:
UNDEFINED_DEVICE_TYPE,STANDALONE,GATEWAY,EMBEDDED_UCM- communication module, which embedded into Enapter devices UCM,HARDWARE_UCM- Enapter Universal Communication Modules (UCM),VIRTUAL_UCM- Enapter virtual UCM,LINK_MASTER_UCM,LINK_SLAVE_UCM,LUA,NATIVE- Enapter device like Electrolyser or Dryer.
device.implemented_profilesarray of strings#A list of profiles implemented by the device. You can also find them in the device's manifest.
Expanded fields
device.propertiesobject#Device's properties.
device.communication_infoobject#Device's communication info.
device.connectivitystring#Device's connectivity status. Can be
ONLINE,OFFLINE,UNKNOWN.
List Devices
GET devices
Get a list of devices.
Request
$ curl http://api.enapter.com/v3/devices
Query Parameters
limitnumber#The maximum number of devices to return.
offsetnumber#The number of devices to skip. Devices are ordered by ID.
profiles.hasstring#Filter devices by profiles.
expandarray of strings#Comma-separated list of additional device information to display. By default, no additional fields are included.
Supported values:
site— includes information about the site, to which the device is connected.manifest— includes device blueprint manifest.properties— includes the last received device properties.connectivity— includes current device connection status.communication_info— includes device communication info.
Response
{
"devices": [
{
"id": "ucmbbba0-79f2-4e9e-a6f0-69a310ab110b",
"blueprint_id": "bluepri0-79n2-4t9e-u6c0-69m310ab110b",
"name": "My UCM",
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"updated_at": 1735689600,
"slug": "my-ucm",
"type": "HARDWARE_UCM",
"authorized_role": "INSTALLER"
},
{
"id": "devicea0-45f2-4e9e-a6f0-69a310ab110b",
"blueprint_id": "bluepri1-50n3-4t9d-e6v0-69i310cb110e",
"name": "My Device",
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"updated_at": 1735689600,
"slug": "my-device",
"type": "LUA",
"authorized_role": "INSTALLER"
}
],
"total_count": 2
}
Request (expanded)
$ curl http://api.enapter.com/v3/devices?expand=communication_info,connectivity
Response (expanded)
{
"devices": [
{
"id": "ucmbbba0-79f2-4e9e-a6f0-69a310ab110b",
"blueprint_id": "bluepri0-79n2-4t9e-u6c0-69m310ab110b",
"name": "My UCM",
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"updated_at": 1735689600,
"slug": "my-ucm",
"type": "HARDWARE_UCM",
"authorized_role": "INSTALLER",
"communication_info": {
"communication_type": "MQTT_V1_TLS",
"hardware_id": "C8795CBA5375484E829105E959663C8B",
"channel_id": "ucm"
},
"connectivity": {"status": "ONLINE"}
},
{
"id": "devicea0-45f2-4e9e-a6f0-69a310ab110b",
"blueprint_id": "bluepri1-50n3-4t9d-e6v0-69i310cb110e",
"name": "My Device",
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"updated_at": 1735689600,
"slug": "my-device",
"type": "LUA",
"authorized_role": "INSTALLER",
"communication_info": {
"communication_type": "UCM_LUA",
"upstream_id": "ucmbbba0-79f2-4e9e-a6f0-69a310ab110b"
},
"connectivity": {"status": "ONLINE"}
}
],
"total_count": 2
}