Skip to content

ZiggyMeter REST API

ZiggyMeter Public API.

Authentication

ZiggyMeter API uses HTTP Bearer authentication. Obtain a short‑lived access token via the login endpoint, then send it in the Authorization header on subsequent requests.

Notes

  • Tokens expire after expires_in_secs. Re‑authenticate when expired.
  • Missing or invalid tokens will result in 401 Unauthorized.
  • Always include the exact header name Authorization with value Bearer <token>.

Exceptions

  • POST /api/v1/system/login does not require a token.
  • POST /api/v1/system/password does not require a token (it validates old_password instead).

System API (/api/v1/system)

POST /api/v1/system/login

Login. Returns authorization token.

json
{
    "username": "username",
    "password": "password"
}
FieldTypeDescription
usernamestringUsername
passwordstringPassword

Response

json
{
    "token": "vKEsedeLOBqLoSYYiWVrOF9To8T2RNK0ZV91aUwW",
    "expires_in_secs": 3600
}
FieldTypeDescription
tokenstringAuthorization token
expires_in_secsintegerRemaining validity in seconds

POST /api/v1/system/logout

Logout

Responses

  • 200 OK with empty body

GET /api/v1/system/version

Get firmware version.

Response

json
{
    "firmware": {
        "version": "1.0.320",
        "date": "Jan  3 2026",
        "time": "11:50:00"
    },
    "frontend": {
        "version": "1.0.320",
        "date": "Jan  3 2026",
        "time": "11:36:31"
    },
    "build_number": 320,
    "upgrade_url": "https://fw.ziggymeter.com/"
}
FieldTypeDescription
firmwareobjectFirmware version details
firmware.versionstringFirmware version
firmware.datestringFirmware build date
firmware.timestringFirmware build time
frontendobjectFrontend version details
frontend.versionstringFrontend version
frontend.datestringFrontend build date
frontend.timestringFrontend build time
build_numberintegerBuild number
upgrade_urlstringURL for firmware upgrades

GET /api/v1/system/status

Get device status.

Responses

json
{
    "battery_voltage": 0,
    "usb_voltage": 5.146,
    "battery_powered": false,
    "battery_status": 0,
    "device_temperature": 26.6,
    "zigbee_enabled": false,
    "wifi_enabled": true,
    "home_assistant_enabled": false
}
FieldTypeDescription
battery_voltagenumberBattery voltage
usb_voltagenumberUSB voltage
battery_poweredbooleanWhether device is powered by battery
battery_statusintegerBattery level in percent
device_temperaturenumberDevice temperature (°C)
zigbee_enabledbooleanZigbee integration enabled
wifi_enabledbooleanWiFi enabled
home_assistant_enabledbooleanHome Assistant integration enabled

POST /api/v1/system/reboot

Reboot the device.

Responses

  • 200 OK with empty body. The device will restart immediately, causing current connections to be dropped.

POST /api/v1/system/factory_reset

Factory Reset. This will clear all configuration, including WiFi and admin password, and reboot the device.

Responses

  • 200 OK with empty body. The device will restart and return to its initial setup state.

POST /api/v1/system/password

Change the admin password.

This endpoint does not require a Bearer token. It validates old_password.

Request Body

json
{
    "old_password": "old",
    "new_password": "new"
}
FieldTypeDescription
old_passwordstringCurrent admin password
new_passwordstringNew admin password

Responses

  • 200 OK with empty body
  • 400 Bad Request if JSON fields are missing
  • 403 Forbidden if old_password is invalid

POST /api/v1/system/ota

Sends firmware upgrade image. After successful transmission, the device will restart and update. The device is upgraded only when the entire image is transmitted. Failed transmission is ignored and does not render the device unresponsive.

TIP

Limit transmission rate in case of transmission problems. See API.

Request Body

Binary firmware image data (no JSON, raw binary).

Responses

  • 200 OK with empty body on successful transmission and update start.
  • 401 Unauthorized if token is missing or invalid.
  • 500 Internal Server Error if update fails.

Network API (/api/v1/network)

GET /api/v1/network/status

Get Network Status.

Responses

json
{
    "ip": "192.168.20.242",
    "netmask": "255.255.255.0",
    "gateway": "192.168.20.1",
    "hostname": "ZiggyMeter-1234",
    "dhcp": true,
    "ssid": "wifinetname",
    "rssi": -89,
    "channel": 4,
    "authmode": 3,
    "ap_mode": false
}
FieldTypeDescription
ipstringIP address
netmaskstringNetwork mask
gatewaystringGateway IP address
hostnamestringDevice hostname
dhcpbooleanDHCP enabled
ssidstringWiFi SSID
rssiintegerSignal strength
channelintegerWiFi channel
authmodeintegerAuthentication mode
ap_modebooleanAccess Point mode

GET /api/v1/network/scan

Get WiFi networks.

Response

json
{
    "hostname": "ZiggyMeter-1234",
    "networks": [
        {
            "ssid": "Star-XYZ123",
            "bssid": "A1B2C3D4E5F6",
            "rssi": -87,
            "channel": 4,
            "authmode": 7
        },
        {
            "ssid": "HomeNet-5G",
            "bssid": "F0E1D2C3B4A5",
            "rssi": -88,
            "channel": 4,
            "authmode": 3
        },
        {
            "ssid": "GuestWiFi",
            "bssid": "9A8B7C6D5E4F",
            "rssi": -93,
            "channel": 6,
            "authmode": 3
        },
        {
            "ssid": "OfficeSecure",
            "bssid": "1F2E3D4C5B6A",
            "rssi": -94,
            "channel": 13,
            "authmode": 3
        }
    ]
}
FieldTypeDescription
hostnamestringDevice hostname
networksarrayList of available WiFi networks
networks[].ssidstringNetwork SSID
networks[].bssidstringNetwork BSSID (MAC address)
networks[].rssiintegerSignal strength (RSSI)
networks[].channelintegerWiFi channel
networks[].authmodeintegerAuthentication mode

POST /api/v1/network/wifi

Post WiFi configuration.

Request Body

FieldTypeDescription
ssidstringWiFi SSID (required, 1-31 characters)
passwordstringWiFi password (required, up to 63 characters)
dhcpbooleanEnable DHCP (required)
hostnamestringDevice hostname (optional, non-empty string up to 31 characters)
ipstringStatic IP address (required if DHCP false, valid IP)
netmaskstringNetwork mask (required if DHCP false, valid IP)
gatewaystringGateway IP address (required if DHCP false, valid IP)
applybooleanApply settings immediately (optional, defaults to false)

Responses

json
{
    "ssid": "iot-net",
    "dhcp": true,
    "hostname": "ziggymeter1",
    "ip": "192.168.8.177",
    "netmask": "255.255.255.0",
    "gateway": "192.168.8.1"
}
FieldTypeDescription
ssidstringConfigured WiFi SSID
dhcpbooleanDHCP status
hostnamestringConfigured hostname
ipstringCurrent/Static IP address
netmaskstringCurrent/Static Network mask
gatewaystringCurrent/Static Gateway IP

WARNING

If apply is set to true, the device will attempt to connect to the new network immediately. This will cause the current connection to be dropped.

POST /api/v1/network/ap

Post Access Point configuration.

Request Body

FieldTypeDescription
ap_ssidstringAccess Point SSID (optional, 1-31 characters)
ap_passwordstringAccess Point password (optional, 8-63 characters)
ap_enabledbooleanEnable Access Point mode (optional)
applybooleanApply settings immediately (optional, defaults to false)

Responses

json
{
    "ap_ssid": "ZiggyMeter-1234",
    "ap_enabled": true
}
FieldTypeDescription
ap_ssidstringConfigured AP SSID
ap_enabledbooleanAP mode status

Zigbee API (/api/v1/zigbee)

GET /api/v1/zigbee/config

Get Zigbee configuration.

Response

json
{
    "enabled": false,
    "channel": 11,
    "short_address": 0,
    "extended_pan_id": "00124b0000000000",
    "pan_id": 0
}
FieldTypeDescription
enabledbooleanZigbee enabled/disabled from stored config
channelintegerCurrent Zigbee channel
short_addressintegerCurrent Zigbee short address
extended_pan_idstringCurrent Zigbee extended PAN ID (16 hex chars)
pan_idintegerCurrent Zigbee PAN ID

POST /api/v1/zigbee/config

Set Zigbee configuration.

Request Body

json
{
    "enabled": true
}
FieldTypeDescription
enabledbooleanEnable or disable Zigbee support

Responses

  • 200 OK with empty body

POST /api/v1/zigbee/reset

Trigger Zigbee reset. After reset, the device's internal Zigbee module is cleared and ready to join a new Zigbee network.

Responses

  • 200 OK with empty body. Current Zigbee pairing will be lost.

POST /api/v1/zigbee/map

Post Zigbee configuration to assign specific Zigbee data points to meter OBIS codes.

Request Body

json
{
    "mapping": [
        {
            "obis": "1-0:15.8.0",
            "mode": 0,
            "mapping_id": "07020000"
        },
        {
            "obis": "15.8.2",
            "mode": 1,
            "mapping_id": "07020001"
        }
    ]
}
FieldTypeDescription
mappingarrayList of OBIS-to-Zigbee mapping entries
mapping[].obisstringOBIS code to map (e.g. 1.8.0 or 1-0:15.8.0)
mapping[].modeintegerMatching mode: 0 (match full OBIS code), 1 (match short OBIS code)
mapping[].mapping_idstringZigbee mapping ID (8 hex characters, e.g. 07020000; cluster + ID)

Responses

  • 200 OK with empty body
  • 401 Unauthorized if token is missing or invalid
  • 400 Bad Request if JSON structure is invalid

Home Assistant API (/api/v1/hass)

GET /api/v1/hass

Get Home Assistant configuration

Response

json
{
    "enabled": false,
    "url": "https://home-assistant.local:8123",
    "cert_max_size": 10239
}
FieldTypeDescription
enabledbooleanWhether Home Assistant integration is enabled
urlstringHome Assistant URL (present only when enabled)
cert_max_sizeintegerMaximum Home Assistant certificate size in bytes

POST /api/v1/hass

Set Home Assistant configuration.

Request Body

FieldTypeDescription
enabledbooleanEnable or disable Home Assistant integration
urlstringHome Assistant server URL (required if enabled)
tokenstringHome Assistant long-lived access token (required if enabled)
langstringLanguage for OBIS descriptions (optional, defaults to 'en' if enabled)
certstringPEM certificate for HTTPS connection (optional, clears if not provided when enabled)

Responses

json
{
    "enabled": true,
    "url": "https://home-assistant.local:8123",
    "cert_max_size": 10239
}
FieldTypeDescription
enabledbooleanWhether integration is enabled
urlstringTarget Home Assistant URL
cert_max_sizeintegerMaximum supported certificate size

GET /api/v1/hass/send

Send a test publish to Home Assistant.

Response

json
{
    "retcode": 0,
    "http_status_code": 200
}
FieldTypeDescription
retcodeintegerreturn code (0 means success)
http_status_codeintegerHTTP status code returned by Home Assistant

Errors

  • 400 Bad Request if Home Assistant is not enabled

Meter API (IEC 62056-21) (/api/v1/iec62056)

GET /api/v1/iec62056/read

Trigger a meter readout and return the readings.

Responses

200

Returns the JSON structure with meter details and an array of OBIS readings.

json
{
    "protocol": "IEC62056-21",
    "meter_id": "/XXX6\\2YYYYYY",
    "mode": "C",
    "baudrate": 9600,
    "timestamp": 293209783,
    "status": 1,
    "readings": [
        {
            "obis_long": "0-0:C.1.0",
            "obis": "C.1.0",
            "value1": "12345678",
            "value2": "",
            "value1_number": null,
            "value1_unit": "",
            "medium": 0,
            "channel": 0,
            "billing_period": null,
            "mapping_id": "00000000",
            "en": "Meter serial number"
        },
        {
            "obis_long": "1-0:15.8.0",
            "obis": "15.8.0",
            "value1": "00000001000.657*kWh",
            "value2": "",
            "value1_number": 1000.657,
            "value1_unit": "kWh",
            "medium": 1,
            "channel": 0,
            "billing_period": null,
            "mapping_id": "07020000",
            "en": "Absolute active energy total"
        }
    ]
}
FieldTypeDescription
protocolstringProtocol used (IEC62056-21)
meter_idstringMeter identifier from the meter's identification telegram
modestringCommunication mode (e.g., 'C' or 'D')
baudrateintegerBaudrate used for communication
timestampintegerEpoch timestamp of the reading
statusintegerReadout status code (0 = success, other values indicate errors)
readingsarrayArray of OBIS readings
readings[].obis_longstringFull OBIS code (e.g. 1-0:1.8.0)
readings[].obisstringShort OBIS code (e.g. 1.8.0)
readings[].value1stringPrimary value as received from the meter
readings[].value2stringSecondary value (e.g. timestamp of maximum), if present
readings[].value1_numbernumber|nullParsed numeric value of value1
readings[].value1_unitstringUnit for value1 (e.g. 'kWh', 'kW', 'V')
readings[].mediuminteger|nullMedium identifier
readings[].channelinteger|nullChannel identifier
readings[].billing_periodinteger|nullBilling period identifier
readings[].mapping_idstringZigbee mapping ID (8 hex chars, e.g. 07020000), or 00000000 if not mapped
readings[].enstring|nullEnglish description of the OBIS code
500
  • Meter timeout: The readout did not finish within the expected timeframe (~45s).
  • Meter error: The meter returned an error response.

GET /api/v1/iec62056/last

Get the last available meter readings (does not trigger a new readout).

Responses

200

Same response schema as GET /api/v1/iec62056/read.

GET /api/v1/iec62056/config

Get meter configuration.

Responses

json
{
    "mode_d_enabled": false,
    "mode_d_baudrate": 2400,
    "baudrate_max": 9600,
    "schedule_min": 1,
    "battery": false
}
FieldTypeDescription
mode_d_enabledbooleanWhether IEC 62056 mode D is enabled
mode_d_baudrateintegerBaudrate for mode D communication
baudrate_maxintegerMaximum supported baudrate
schedule_minintegerMinimum reading schedule interval (minutes)
batterybooleanWhether meter is battery powered

POST /api/v1/iec62056/config

Post Meter Configuration.

Request Body

FieldTypeDescription
mode_d_enabledbooleanEnable or disable IEC 62056 mode D
mode_d_baudrateintegerBaudrate for mode D communication (must be valid baudrate)
baudrate_maxintegerMaximum supported baudrate (must be valid baudrate)
batterybooleanWhether meter is battery powered
schedule_minintegerMinimum reading schedule interval in minutes (minimum -1)

Responses

json
{
    "mode_d_enabled": false,
    "mode_d_baudrate": 2400,
    "baudrate_max": 9600,
    "schedule_min": 5,
    "battery": false
}
FieldTypeDescription
mode_d_enabledbooleanIEC 62056 mode D status
mode_d_baudrateintegerConfigured mode D baudrate
baudrate_maxintegerMaximum communication baudrate
schedule_minintegerReading schedule interval (minutes)
batterybooleanBattery operation flag