Provisioning
Provisioning is a process of adding devices to the Enapter Platform.
Reprovisioning
Sometimes, you may need to reprovision the same device to the same site, such as when the Wi-Fi SSID changes. Reprovisioning requires the same arguments as regular provisioning, but it does not create a new device.
You can not reprovision Lua device.
Provision UCM
POST provisioning/ucm
Adds a UCM (Universal Communication Module) to the Enapter Platform.
Request
$ curl -X POST \
http://api.enapter.com/v3/provisioning/ucm \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"hardware_id": "C8795CBA5375484E829105E959663C8B",
"name": "My UCM",
"protocol": "MQTTS"
}'
site_idstring#ID of the site.
hardware_idstring#Device hardware ID.
namestring#Device name.
protocolstring#MQTTorMQTTS.
Response
{
"config": {
"mqtt_host": "mqtt.enapter.com",
"mqtt_port": 8883,
"mqtt_credentials": {
"protocol": "MQTTS",
"private_key": "...",
"certificate": "...",
"ca_chain": "..."
},
"time_sync_protocol": "HTTP",
"time_sync_host": "127.0.0.1",
"time_sync_port": 80,
"hardware_id": "C8795CBA5375484E829105E959663C8B",
"channel_id": "ucm"
},
"device_id": "ucmbbba0-79f2-4e9e-a6f0-69a310ab110b",
"slug": "my-ucm"
}
config.mqtt_hoststring#Enapter Cloud MQTT broker host.
config.mqtt_postinteger#Enapter Cloud MQTT broker port.
config.mqtt_credentialsobject#Contains either MQTT or MQTTS credentials.
config.mqtt_credentials.protocolstring#MQTTorMQTTS.
| MQTT | MQTTS |
|---|---|
|
|
|
|
|
config.time_sync_protocolstring#Time synchronization protocol.
config.time_sync_hoststring#Time synchronization host.
config.time_sync_portinteger#Time synchronisation server port.
config.hardware_idstring#Device hardware ID.
config.channel_idstring#Device channel ID.
device_idstring#Device ID.
slugstring#
Provision VUCM
POST provisioning/vucm
Adds a virtual UCM (Universal Communication Module) to the Enapter Platform.
You can add a virtual UCM only on Gateway 3.x.x.
Request
$ curl -X POST \
http://api.enapter.com/v3/provisioning/vucm \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"hardware_id": "V8795CBA5375484E829105E959663C8B",
"name": "My VUCM"
}'
site_idstring#ID of the site.
hardware_idstring#Device hardware ID.
namestring#Device name.
Response
{
"device_id": "fecbbba0-79f2-4e9e-a6f0-69a310ab110b"
}
device_idstring#Device ID.
Provision Enapter Device
POST provisioning/embedded
Adds an Enapter Electrolyser, Dryer or Water Tank to the Enapter Platform.
Request
$ curl -X POST \
http://api.enapter.com/v3/provisioning/embedded \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"device_type": "ELECTROLYSER",
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"hardware_id": "BCC415CBA5375484E829105E959663C8B",
"name": "My Electrolyser",
"protocol": "MQTTS"
}'
device_typestring#One of the following types:
ELECTROLYSER- Enapter Electrolyser,DRYER- Enapter Dryer,WATER_TANK- Enapter Water Tank.
site_idstring#ID of the site.
hardware_idstring#Device hardware ID.
namestring#Device name.
protocolstring#MQTTorMQTTS.
Response
{
"config": {
"mqtt_host": "mqtt.enapter.com",
"mqtt_port": 8883,
"mqtt_credentials": {
"protocol": "MQTTS",
"private_key": "...",
"certificate": "...",
"ca_chain": "..."
},
"time_sync_protocol": "HTTP",
"time_sync_host": "127.0.0.1",
"time_sync_port": 80,
"hardware_id": "BCC415CBA5375484E829105E959663C8B",
"channel_id": "ucm"
},
"device_id": "elebbba0-79f2-4e9e-a6f0-69a310ab110b",
"slug": "my-electrolyser"
}
config.mqtt_hoststring#Enapter Cloud MQTT broker host.
config.mqtt_postinteger#Enapter Cloud MQTT broker port.
config.mqtt_credentialsobject#Contains either MQTT or MQTTS credentials.
config.mqtt_credentials.protocolstring#MQTTorMQTTS.
| MQTT | MQTTS |
|---|---|
|
|
|
|
|
config.time_sync_protocolstring#Time synchronization protocol.
config.time_sync_hoststring#Time synchronization host.
config.time_sync_portinteger#Time synchronisation server port.
config.hardware_idstring#Device hardware ID.
config.channel_idstring#Device channel ID.
device_idstring#Device ID.
slugstring#
Provision Master UCM Link
POST provisioning/link_master
Adds a master Enapter LINK device to the Enapter Platform.
You can connect an Enapter LINK device only to the Gateway 3.x.x.
Request
$ curl -X POST \
http://api.enapter.com/v3/provisioning/embedded \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"hardware_id": "BCC415CBA5375484E829105E959663C8B",
"name": "Enapter Link 1"
}'
site_idstring#ID of the site.
hardware_idstring#Device hardware ID.
namestring#Device name.
Response
{
"device_id": "02618484-5c16-4159-998a-ef4acc16666c"
}
device_idstring#Device ID.
Provision Slave UCM Link
Adds a slave Enapter LINK device to the Enapter Platform.
POST provisioning/link_slave
You can connect an Enapter LINK device only to the Gateway 3.x.x.
Request
$ curl -X POST \
http://api.enapter.com/v3/provisioning/embedded \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"hardware_id": "435840FFE5CD4E9DA93545DDF7E6D5FB",
"name": "ENP-AO6 BCC4",
"master_device_id": "02618484-5c16-4159-998a-ef4acc16666c"
}'
device_idstring#Enapter LINK master device ID.
Response
{
"device_id": "5841fafa-8d10-4103-ba7c-1b818899270f"
}
device_idstring#Device ID.
Provision Standalone Device
POST provisioning/standalone
Adds a Enapter Standalone device to the Enapter Platform.
Request
$ curl -X POST \
http://api.enapter.com/v3/provisioning/standalone \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"site_id": "sitebba0-79f2-4e9e-a6f0-69a310ab110b",
"name": "My Device"
}'
site_idstring#ID of the site.
namestring#Device name.
Response
{
"device_id": "standba0-79f2-4e9e-a6f0-69a310ab110b",
"slug": "my-device"
}
device_idstring#Device ID.
slugstring#
Provision Lua Device
POST provisioning/lua_device
Adds a Lua device that implements integration with third-party devices using Lua scripts.
Request
$ curl -X POST \
http://api.enapter.com/v3/provisioning/standalone \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"runtime_id": "ucmbbba0-79f2-4e9e-a6f0-69a310ab110b",
"blueprint_id": "bluepri1-50n3-4t9d-e6v0-69i310cb110e",
"name": "Gas sensor",
"slug": "gas-sensor-1"
}'
blueprint_idstring#Device blueprint ID.
namestring#Device name.
slugstring#Device slug.
Response
{
"device_id": "devicea0-45f2-4e9e-a6f0-69a310ab110b",
"slug": "gas-sensor-1"
}
device_idstring#Device ID.
slugstring#
Provision Gateway
POST provisioning/gateway
You can provision Gateway only to the Enapter Cloud.
Request
$ curl -X POST \
http://api.enapter.com/v3/provisioning/gateway \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"site_id": "fecbbba0-79f2-4e9e-a6f0-69a310ab110b",
"hardware_id": "B27925CBA5375484E829105E959663C8B",
"gateway_version": "3.0.0",
"site_name": "My Site",
"site_timezone": "Europe/Berlin",
"site_location": {
"latitude": 52.520008,
"longitude": 13.404954
}
}'
Body Parameters
site_idstring#ID of the site, to which you want add an Enapter Gateway.
hardware_idstring#Enapter Gateway hardware ID.
gateway_versionstring#Enapter Gateway firmware version.
site_namestring#Name of the site.
site_timezonestring#Timezone of the site.
site_location.latitudestring#Location latitude of the site.
site_location.longitudestring#Location longitude of the site.
Response
{
"config": {
"mqtt_host": "mqtt.enapter.com",
"mqtt_port": 8883,
"mqtt_credentials": {
"protocol": "MQTTS",
"private_key": "...",
"certificate": "...",
"ca_chain": "..."
},
"time_sync_protocol": "HTTP",
"time_sync_host": "127.0.0.1",
"time_sync_port": 80,
"hardware_id": "FGC415CBA5375484E829105E959663C8B",
"channel_id": "gw"
},
"gateway_device_id": "gwcbbba6-79f2-4e9e-a6f0-69a310ab110b"
}
config.mqtt_hoststring#Enapter Cloud MQTT broker host.
config.mqtt_postinteger#Enapter Cloud MQTT broker port.
config.mqtt_credentialsobject#Contains either MQTT or MQTTS credentials.
config.mqtt_credentials.protocolstring#MQTTorMQTTS.
| MQTT | MQTTS |
|---|---|
|
|
|
|
|
config.time_sync_protocolstring#Time synchronization protocol.
config.time_sync_hoststring#Time synchronization host.
config.time_sync_portinteger#Time synchronisation server port.
config.hardware_idstring#Device hardware ID.
config.channel_idstring#Device channel ID.
gateway_device_idstring#Device ID of newly added Enapter Gateway.