# MQTT API

# Configuration

Before starting integration process MQTT API should be configured. If you are not familiar with how to access and use Enapter Command Line interface please see Enapter Command Line Interface section of this documentation.

To do this - enter configuration mode on gateway shell and set basic parameters.

# Setup MQTT Port and Authentication

Public MQTT port is 9883.

set public-mqtt authentication username "public"
set public-mqtt authentication password "password"
commit
save

# Receiving device telemetry

  1. Connect to mqtt on gateway ip address, specified port, with specified username & password,
  2. Subscribe to telemetry topic.
mosquitto_sub -d -v -p 9883 -h 192.168.1.1 -u public -P password -t "telemetry/v1/<DEVICE_ID>"

# Device Telemetry API

# Device Telemetry

Provides Device telemetry.

Will be published every 1 second.

telemetry/v1/{id}
Payload Field Description
timestamp Message publishing timestamp
... Device-specific fields

# Example

Topic

telemetry/v1/A0B1

Payload

{
  "timestamp": 1514320289,
  "uptime": 2
}

# Device Commands API

# Request Command Execution

commands/v1/{id}/requests
Payload Field Description
id Command execution ID, e.g. UUID
name Command name
arguments Optional, command arguments
expires Optional, command expiration timestamp

# Example

Topic

commands/v1/A0B1/requests

Payload

{
  "id": "ab3e364c-cab2-4cc1-872d-4d554530d587",
  "name": "impulse",
  "arguments": {
    "id": 1,
    "impulse": 300
  }
}

# Command Execution Responses

commands/v1/{id}/responses
Payload Field Description
id Required, command execution ID, e.g. UUID
state Required, command execution state, e.g. started
payload Optional, command state payload

# Example

Topic

commands/v1/A0B1/responses

Payload

{
  "id": "ab3e364c-cab2-4cc1-872d-4d554530d587",
  "name": "finished"
}

# Electrolyser V2.1 Protocol

# Device Telemetry Payload

Field Description
timestamp Message publishing timestamp
status Electrolyser status string one of maintenance, expert, error, fatal, idle, steady, standby, curve, blowdown
is_running Indicates whether device is running boolean
has_errors Indicates whether any device errors boolean
has_warnings Indicates whether any device warnings boolean
errors List of electrolyser errors (opens new window)
warnings List of electrolyser warings (opens new window)
electrolyte_level_very_high Indicates whether electrolyte level is higher than very high level
electrolyte_level_high Indicates whether electrolyte level is higher than high level
electrolyte_level_medium Indicates whether electrolyte level is higher than medium level
electrolyte_level_low Indicates whether electrolyte level is higher than low level
h2_flow H2 Production in Normal Litre/hour
h2_total Total H2 Produced in Normal Litre
stack_pressure H2 Stack Pressure in Bar
stack_voltage H2 Stack Voltage in Volt
stack_amperage H2 Stack Amperage in Amper
outlet_pressure H2 Outlet Pressure in Bar
water_inlet_pressure Water Inlet Pressure in Bar
electrolyte_tank_temperature Electrolyte Tank Temperature in Celsius
electrolyte_downstream_temperature Downstream Temperature in Celsius

# Example

{
  "timestamp": 1514320289,
  "status": "steady",
  "is_running":  true,
  "has_errors":  true,
  "has_warnings": false,
  "h2_flow": 250.0,
  "h2_total": 10000,
  "stack_pressure": 30.1,
  "stack_voltage": 38.1,
  "stack_amperage": 12.3,
  "outlet_pressure":  30.0,
  "water_inlet_pressure": 1.2,
  "electrolyte_tank_temperature":  38.3,
  "electrolyte_downstream_temperature": 24.7,
  "errors": ["FP_01", "FP_03"],
  "warnings": [],
  "electrolyte_level_very_high": false,
  "electrolyte_level_high": false,
  "electrolyte_level_medium": true,
  "electrolyte_level_low": true
}

# Supported Commands

Command Name Description Arguments
start Start electrolyser
stop Stop electrolyser
reset Reset electrolyser
set_production_rate Set electrolyser production rate (in percents) value (float)

# Enapter Dryer Protocol

# Device Telemetry Payload

Field Description
timestamp Message publishing timestamp
status Dryer status string one of waiting_for_power, waiting_for_pressure, stopped_by_user, starting, standby, waiting_for_pressure, drying_0, cooling_0, switching_0, pressurizing_0, finalizing_0, drying_1, cooling_1, switching_1, pressurizing_1, finalizing_1, leak_input, leak_dryer, error
is_running Indicates whether device is running boolean
has_errors Indicates whether any device errors boolean
errors List of dryer errors (opens new window)
warnings List of dryer warings (opens new window)
input_pressure H2 Inlet Pressure in Bar
output_pressure H2 Outlet Pressure in Bar

# Example

{
  "timestamp": 1547680704,
  "status": "drying_0",
  "is_running": true,
  "has_errors": true,
  "input_pressure": 30.5,
  "output_pressure": 26.1,
  "errors": ["TT00", "PT00"],
  "warings": []
}

# Supported Commands

Command Name Description
start Start dryer
stop Stop dryer
reset Reset dryer