/config

The meter configuration service.

The endpoints under /config provide common method semantics and atomicity guarantees as described below.

HTTP Method Semantics

The endpoints generally support HTTP methods GET, PUT, POST, and DELETE, though some of the endpoints may have restrictions. For example, security-sensitive values such as certificates or passwords are usually write-only.

GET returns the current value of the endpoint and has no side-effect.

The exact semantics of the other methods depend on the JSON type of the value that the endpoint represents:

Semantics for Object Values

PUT replaces the value of the object with the one in the request body. POST updates the object based on the members in the request body. That is, the POST may add new members or updates the values of existing members. DELETE removes the object where that makes sense and otherwise resets the object to its default value.

Semantics for Array Values

PUT replaces the value of the array with the array contained in the request body. POST appends the array in the request body to the existing array. DELETE removes the array where that makes sense and otherwise resets it to its default value (usually the empty array).

Semantics for String and Number Values

PUT and POST replace the value. DELETE removes the value if that is possible and otherwise resets it to the default value.

Atomicity

GET responses are guaranteed to return a consistent view of the meter configuration. That is, if there are simultaneous modification requests, it is guaranteed that the modifications take place either before or after the GET response is created, not partway through it.

Modification requests (POST, PUT, and DELETE) are executed transactionally, meaning either all of a modification is applied or none of it. Multiple modifications are applied in a sequentially consistent fashion. That is, there must exist a sequential order in which the modifications can be applied that yields the final result.

HTTP headers ETag and If-Match can be used to ensure a modification request is applied only if the configuration has not been changed since the GET request that returned the ETag.

Get /config

SecurityApiKey
Request
query Parameters
max-depth
integer >= 1

Limit output depth of the response. See Max-Depth.

Example: max-depth=2
filter
string

Response filter string. See Filter-Spec.

Example: filter={foo,bar}
Responses
200

Normal response.

401

Unauthorized response.

get/config
Request samples
Response samples
application/json
{
  • "result": {
    },
  • "error": "Error message (present if an error occurred)."
}

Replace /config

A PUT request is equivalent to a DELETE followed by a POST with the same request body. Because of that, care must be taken to ensure the desired configuration is written. Specifically:

  • The classic interface uses CGI-BIN programs. It is therefore recommended to include member "net":{"http":{"cgi-bin":"user-required"}} in the request body as otherwise CGI-BIN support is disabled.

  • Member alert may contain references to register names (as part of custom alert conditions). This member should therefore appear after member register.

  • Member remote must appear in the request body before member register as otherwise the remote registers in this member will be deleted when member remote is processed.

SecurityApiKey
Request
Request Body schema: application/json
object (configBacnet)

The BACnet configuration.

object (configDb)

The database configuration.

object (configDisplay)

The display (LCD) configuration of the meter.

language_code
string (configLanguageCode)

The code of the preferred language for the meter. When the meter needs to generate a message (e.g., as a result of an alert triggering), it will generate the message in the language selected by this code whenever possible. The code should be in a format acceptable to the setlocale() function. Language codes currently supported include:

  • de: German.

  • en: US English (defaults to 12-hour clock and imperial units).

  • en_GB: British English (defaults to 24-hour clock and metric units).

  • es: Spanish.

  • fr: French.

  • he: Hebrew.

  • it: Italian.

  • ko: Korean.

  • pl: Polish.

  • zh_Hans: Simplified Chinese (Mandarin).

  • zh_Hant: Traditional Chinese (Cantonese).

See eGauge Internationalization Instructions for information on adding other languages or improving an existing translation.

Note When accessing the meter from a web browser, the value of this resource has normally no effect as the user interface is presented in the language selected by the browser.

object (configLocal)

The configuration of directly attached sensors.

object (configLocation)

The geographic location of the meter.

object (configLog)

The log configuration.

object (configLua)

Lua scripting configuration.

object (configModbus)

Modbus-related configurations.

object (configNet)

The network configuration.

The current state of the network is available at /sys/net.

object (configPush)

The push service configuration. This service is used to share the meter data with a remote web server. The data is sent via an HTTP POST request.

object (configRemote)

The remote device configurations.

object (configRegister)

The register configuration of the meter.

object (configTime)

Time related configurations.

object (configUser)

The user accounts.

object (configVar)

The set of meter variable sections.

object (configAlert)

The alert configuration of the meter.

Responses
200

Normal response.

401

Unauthorized response.

put/config
Request samples
application/json
{ }
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}

Update /config

SecurityApiKey
Request
Request Body schema: application/json
object (configBacnet)

The BACnet configuration.

object (configDb)

The database configuration.

object (configDisplay)

The display (LCD) configuration of the meter.

language_code
string (configLanguageCode)

The code of the preferred language for the meter. When the meter needs to generate a message (e.g., as a result of an alert triggering), it will generate the message in the language selected by this code whenever possible. The code should be in a format acceptable to the setlocale() function. Language codes currently supported include:

  • de: German.

  • en: US English (defaults to 12-hour clock and imperial units).

  • en_GB: British English (defaults to 24-hour clock and metric units).

  • es: Spanish.

  • fr: French.

  • he: Hebrew.

  • it: Italian.

  • ko: Korean.

  • pl: Polish.

  • zh_Hans: Simplified Chinese (Mandarin).

  • zh_Hant: Traditional Chinese (Cantonese).

See eGauge Internationalization Instructions for information on adding other languages or improving an existing translation.

Note When accessing the meter from a web browser, the value of this resource has normally no effect as the user interface is presented in the language selected by the browser.

object (configLocal)

The configuration of directly attached sensors.

object (configLocation)

The geographic location of the meter.

object (configLog)

The log configuration.

object (configLua)

Lua scripting configuration.

object (configModbus)

Modbus-related configurations.

object (configNet)

The network configuration.

The current state of the network is available at /sys/net.

object (configPush)

The push service configuration. This service is used to share the meter data with a remote web server. The data is sent via an HTTP POST request.

object (configRemote)

The remote device configurations.

object (configRegister)

The register configuration of the meter.

object (configTime)

Time related configurations.

object (configUser)

The user accounts.

object (configVar)

The set of meter variable sections.

object (configAlert)

The alert configuration of the meter.

Responses
200

Normal response.

401

Unauthorized response.

post/config
Request samples
application/json
{ }
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}

Delete /config

Reset to default. See the descriptions of the individual endpoints for their default values. Commonly, arrays and strings are cleared to empty, numbers are cleared to 0, and booleans are cleared to false.

SecurityApiKey
Responses
200

Normal response.

401

Unauthorized response.

delete/config
Request samples
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}