For the complete documentation index, see llms.txt. This page is also available as Markdown.

LAN API

The LAN API is exposed locally by the NET2GRID device on the home network. It provides device information, meter readings, and Wi-Fi (WLAN) configuration for the SmartBridge, and is protected by the N2G-LAN-USER API key, except for a few endpoints (i.e., device info, WLAN status, and connectivity ping) that are available without authentication.

Available Operations

Currently, the service supports the following operations:

  • Retrieve general device information (unique ID, device type, firmware version, hardware version).

  • Reboot the device.

  • Retrieve the connected meter interface's status (electrical, gas, or both).

  • Retrieve the most recent electrical meter readings (power, import, export).

  • Retrieve historical electrical power data for the last hour or the last 24 hours.

  • Retrieve per-phase power, voltage, and current attributes.

  • Retrieve historical energy import totals for the last day, month, or year.

  • Retrieve historical energy export totals for the last day, month, or year.

  • Retrieve the current Wi-Fi (WLAN) connection status.

  • Scan for available wireless access points.

  • Join a wireless network using an SSID and key.

  • Leave the current wireless network and return to access point mode.

  • Run a connectivity (ping) test to check internet access.

  • Enable WPS pairing mode for 2 minutes.

Error Codes

The LAN API returns a small, fixed set of error codes, which are documented per-operation in the OpenAPI specification:

  • 400 Bad Request — the request body did not match the expected schema. This is currently only returned by /wlan/join, when the supplied ssid/key fields are invalid.

  • 401 Unauthorized — the N2G-LAN-USER API key was missing or invalid. This applies to every operation except the handful that don't require authentication (see Available Operations).

  • 503 Service Unavailable — the device could not fulfill the request, typically because the relevant hardware interface (meter or Wi-Fi) isn't ready or connected yet, or because insufficient historical data has been collected for the requested time range.

Unlike the cloud-hosted Device Management API, there is no API Gateway middleware in front of this API, so no 403/404 responses are returned for malformed requests — an unrecognized path or method is handled directly by the device.

Getting Access

The LAN API is only reachable from the same local network as the SmartBridge — the client device must be connected to the same access point (either the SmartBridge's own AP if it hasn't joined a Wi-Fi network yet, or the home Wi-Fi network it has joined) to reach it at http://{IP}.

Authenticated operations require a N2G-LAN-USER token, passed in the Authorization header as N2G-LAN-USER token="${USER_API_TOKEN}".

Both the device's local IP address and the user token are retrieved from the Device Management API, not from the LAN API itself:

  • Call GET /gateways/{eui64}/info (part of the Device Management API's Information group of calls) with the eui64 of the desired device.

  • The response contains a lan object with the device's local IP address and, nested under token, the N2G-LAN-USER token.

This call requires an API Key, which is provided by NET2GRID in a secure manner.

OpenAPI Specification Interfaces

The LAN API is available in the API Reference section.

Last updated

Was this helpful?