MQTT protocol for prepaid meters

Version 1. Every ENA prepaid meter, gateway and partner platform uses this protocol to talk to enapoint.com. Messages follow the Acrel IoT EMS data forwarding formats.

Connect

Each gateway logs in with its own serial number and a password issued by ENA. Keep the session persistent so commands queued while you are offline are delivered when you reconnect.

Host and portmqtt.enapoint.com:8883 (TLS)
ProtocolMQTT 3.1.1
UsernameGateway serial (gatewaySn)
PasswordIssued by ENA, one per gateway
Clean sessionfalse
Quality of serviceQoS 1 for everything
Willstatus topic, {"state":"OFFLINE"}, retained

Topics

A gateway may publish only to its own topics and subscribe only to its own command topic.

ena/v1/<gatewaySn>/telemetryGateway to ENA: list of meter readings
ena/v1/<gatewaySn>/eventsGateway to ENA: alarms
ena/v1/<gatewaySn>/statusGateway to ENA: ONLINE or OFFLINE, retained
ena/v1/<gatewaySn>/ackGateway to ENA: result of each command
ena/v1/<gatewaySn>/cmdENA to gateway: commands

Acrel IoT EMS cloud forwarding logs in with its own account and publishes the document's payloads unchanged to the agreed realtime and event topics.

Readings

Send the energy register as it stands, never a difference. ENA bills the rise in EPI between readings. A meter that does not answer is sent as OFFLINE with no measured values. Repeated readings are ignored.

EPIPositive total active energy, kWh (required)
SwitchStaRelay: 0 on, 1 off
createTimeISO 8601 with time zone
Other fieldsAny Acrel Appendix 1 name, stored as sent
[
  {
    "gatewaySn": "ENA-GW-APO-001",
    "meterSn": "1",
    "meterNo": "ENA-GW-APO-001_1",
    "state": "ONLINE",
    "source": "REALTIME",
    "createTime": "2027-01-15T09:30:00Z",
    "EPI": 1520.37,
    "Ua": 230.1, "Ia": 4.12, "P": 0.94,
    "SwitchSta": 0
  }
]

Commands and confirmations

At zero credit ENA sends a switch-off, and after a top-up a switch-on. Carry out the command, publish exactly one confirmation with the same id, then send fresh readings. Unconfirmed commands are recorded as sent after 20 seconds.

FORCESWITCH{"ForceSwitch":1} on, {"ForceSwitch":0} off
SWITCH{"Switch":"1"} on, {"Switch":"0"} off
REFRESHRead the meter now
// ENA to gateway, on ena/v1/ENA-GW-APO-001/cmd
{ "id": "1842", "gatewaySn": "ENA-GW-APO-001",
  "meterSn": "1", "method": "FORCESWITCH",
  "value": { "ForceSwitch": 0 } }

// Gateway to ENA, on ena/v1/ENA-GW-APO-001/ack
{ "id": "1842", "success": "1", "errorCode": "",
  "errorMsg": "", "data": { "meterSn": "1", "relay": "off" } }

Error codes

Use the Acrel error codes where one fits.

36006Device does not exist on this gateway
4903Gateway does not exist
4904Meter or gateway offline
4706The device execution result is failure
10015Unknown method

Modbus-TCP meters

The ENA site bridge reads Modbus-TCP meters, and RS485 meters behind a converter, on a schedule. It publishes their readings in this format and writes the relay register when a command arrives. Each meter model needs its register map from the manufacturer's Modbus manual.

PollingEvery 60 seconds by default
ConnectionsOne per converter, requests in turn
CommandsFORCESWITCH, SWITCH, REFRESH
Runs onAny small Linux computer with Node 20