Download OpenAPI specification:
This is the OpenAPI specification for the Cozify HAN reader.
Returns general information about the HAN reader, including UUID, name, model, serial, firmware version, state, MAC address, network IPs, online status, and release channel.
{- "type": "HAN_STATE_MESSAGE",
- "uuid": "7f2f8c1e-2c6d-4a25-b2b1-6f6a27d5f5de",
- "name": "Cozify-HAN-123-456",
- "model": "HAN",
- "serial": "HAN12345678",
- "version": "1.0.1.0",
- "state": "REGISTERED",
- "mac": "AA:BB:CC:DD:EE:FF",
- "ethIp": "192.168.1.50",
- "wifiIp": "192.168.2.50",
- "online": true,
- "channel": "release"
}Establishes a WebSocket connection to the HAN reader. This endpoint upgrades the HTTP connection to a WebSocket (ws:// or wss://). The WebSocket protocol is used for real-time, bidirectional communication. Current payload behavior:
type = HAN_STATE_MESSAGE.type = HAN_METER_MESSAGE.Opens a stream of server-sent events (SSE) from the HAN reader.
The response uses the text/event-stream content type.
Current event names and payload discriminator values:
HAN_METER_MESSAGE: streams electricity meter payloads.HAN_STATE_MESSAGE: initial state snapshot sent when the client connects.Returns health and status information about the HAN reader, including UUID, hostname, heap memory statistics, CPU reset reason, and uptime.
{- "type": "HAN_HEALTH_MESSAGE",
- "uuid": "7f2f8c1e-2c6d-4a25-b2b1-6f6a27d5f5de",
- "hostname": "Cozify-HAN-123-456",
- "free_heap_size": 182144,
- "minimum_free_heap_size": 176320,
- "cpu_reset_reason": "RST_POWERON",
- "uptime_ms": 1234567
}Sets up the HAN reader with basic WiFi configuration. Accepts a JSON object with WiFi enablement, SSID, and password. Returns success status and message. May trigger a HAN reader reboot.
| s required | boolean Enable WiFi (must be true) |
| ss required | string WiFi SSID |
| sp required | string WiFi password |
{- "s": true,
- "ss": "string",
- "sp": "string"
}{- "success": true,
- "message": "string"
}Returns the current HAN reader configuration, including firmware version, timezone, spot price usage, fixed price, pricing and fuse settings, ethernet, and WiFi settings.
{- "type": "HAN_CONFIGURATION",
- "v": "string",
- "t": "string",
- "s": true,
- "p": 0,
- "m": {
- "f": 0
}, - "e": {
- "e": true,
- "n": {
- "m": "dhcp",
- "i": "string",
- "s": "string",
- "g": "string",
- "d1": "string",
- "d2": "string"
}
}, - "w": {
- "e": true,
- "s": "string",
- "p": "string",
- "w": 0,
- "z": true,
- "b": true,
- "n": {
- "m": "dhcp",
- "i": "string",
- "s": "string",
- "g": "string",
- "d1": "string",
- "d2": "string"
}
}
}Updates the HAN reader configuration. Accepts a JSON object with any subset of the configuration fields as defined in the GET response. Returns success status and message. Some changes may require a HAN reader reboot.
| s | boolean Use spot price |
| p | number Fixed price |
object Pricing and fuse settings used by the HAN reader | |
object Ethernet settings | |
object WiFi settings |
{- "s": true,
- "p": 0,
- "m": {
- "f": 0
}, - "e": {
- "e": true,
- "n": {
- "m": "dhcp",
- "i": "string",
- "s": "string",
- "g": "string",
- "d1": "string",
- "d2": "string"
}
}, - "w": {
- "e": true,
- "s": "string",
- "p": "string",
- "w": 0,
- "z": true,
- "b": true,
- "n": {
- "m": "dhcp",
- "i": "string",
- "s": "string",
- "g": "string",
- "d1": "string",
- "d2": "string"
}
}
}{- "success": true,
- "message": "string"
}Initiates or returns the result of a WiFi network scan. If a scan is running or requested, returns status. If scan is complete, returns a list of found networks with details.
Note: Performing a WiFi scan may temporarily disconnect the HAN reader from its currently connected WiFi network.
{ "status": "SCAN_RUNNING" }.{ "status": "SCAN_FAILED" }.{ "status": "SCAN_SUCCESS", "networks": [...] }.Each network entry includes SSID, BSSID, RSSI, channel, and authentication type.
| X-Scan-Start | string If present, triggers a new WiFi scan. |
{- "status": "SCAN_RUNNING",
- "networks": [
- {
- "ssid": "string",
- "bssid": "string",
- "rssi": 0,
- "channel": 0,
- "auth": "OPEN"
}
]
}Returns the latest electricity meter data received by the HAN reader. This endpoint is intended for the latest live reading values reported by the electricity meter.
{- "type": "HAN_METER_MESSAGE",
- "ts": 173568240000,
- "ic": 1000,
- "ec": 10,
- "ric": 1,
- "rec": 1,
- "p": [
- 1000,
- 300,
- 400,
- 300
], - "pi": [
- 1000,
- 300,
- 400,
- 300
], - "pe": [
- 0,
- 0,
- 0,
- 0
], - "r": [
- 10,
- 3,
- 4,
- 3
], - "ri": [
- 10,
- 3,
- 4,
- 3
], - "re": [
- 0,
- 0,
- 0,
- 0
], - "u": [
- 220,
- 220,
- 220
], - "i": [
- 6,
- 6,
- 6
]
}Returns low-churn electricity meter identity fields parsed from HAN telegrams. This endpoint is intended for metadata that changes rarely, so clients can fetch meter identity separately from high-frequency /meter polling.
{- "type": "HAN_METER_IDENTITY_MESSAGE",
- "manufacturerId": "KFM",
- "deviceType": "E",
- "meterId": "A123456789012345",
- "meterName": "AM550"
}