/local

This service provides access to the values directly measured or derived from the sensors attached to the meter. Values obtained from other, remote, devices are not accessible through this service. Similarly, only the most recent (current) values are available. Use the /register service for accessing values stored in the database of the meter.

Derived values are called energy and apparent energy and are calculated from a pair of sensors. Specifically, energy values are calculated by numerically integrating over time the product of two sensor values. Similarly, apparent energy is calculated as the product of the normal (RMS) values of a pair of sensors. For example, if one sensor value measures an electrical current and the other a voltage, these calculate the real electric energy and apparent electric energy of the measured current/voltage pair, respectively.

This service guarantees to return an atomic snapshot of the measurements as of the time indicated by the timestamp in the response. Various query parameters can be used to select the exact data that is to be returned.

In particular, query parameters values, energy, apparent, or stats can be used to select which sections to include in the response. If none of these are specified, only the values section is returned by default.

Query parameters rate, cumul, or type can be used to select the metrics to return for each sensor. If none of these are specified, the rate and type metrics are returned by default.

Within the rate and cumulative metrics, query parameters normal, mean, or freq select what measurements to return. If none of these are specified, all measurements are returned by default.

Finally, the env, l, and s query parameters can be used to select which sensors to include in the response. If none of these are specified, all sensors are included in the response by default.

Python Example

A Python program illustrating the use of this service can be found here. This program takes advantage of class egauge.webapi.device.Local to handle the details of encoding the HTTP requests and decoding the responses.

Get local sensor values

SecurityApiKey
Request
query Parameters
values
boolean

If present, the sensor values are returned in member values of the response.

energy
boolean

If present, the calculated (real) energy values are returned in member energy of the response.

apparent
boolean

If present, the calculate apparent energy values are returned in member apparent of the response.

stats
boolean

If present, statistics about the internal operation of the meter are returned in member stats of the response.

rate
boolean

If present, the rate metrics of each sensor are included in the response (members rate).

cumul
boolean

If present, the cumulative metrics of each sensor are included in the response (members cumul).

type
boolean

If present, the type code (physical unit) of each sensor is included in the response (members type).

normal
boolean

If present, the normal value of each sensor is included in the response. For most sensor types, this is the RMS value of the sensor signal but for some, this may be the average value (e.g., for temperature sensors) or a count (e.g., for pulse sensors).

mean
boolean

If present, the mean (average) value of each sensor is included in the response.

freq
boolean

If present, the frequency (in hertz) of each sensor signal is included in the response. It is calculated as the number of times the signal crosses zero per second. For some sensor types (e.g., temperature sensors), frequency is not calculated and the returned value is always zero.

env
Array of strings

If present, this parameter specifies a comma-separated list of built-in environmental sensors whose measurements should be included in the response. The list may contain the following strings (case-insensitive):

  • ALL: Include measurements for all built-in environmental sensors.

  • Hpcb: Include measurements for the built-in relative humidity sensor. This sensor measures relative humidity inside the meter's enclosure. It is not available on all meters.

  • Tpcb: Include measurements for the built-in temperature sensor. This sensor measures temperature inside the meter's enclosure, which is generally a few degrees celsius higher than the temperature of the air surrounding the meter.

Note Environmental sensors have only rate metrics, no cumulative metrics, and only have a normal value, no mean or frequency.

Items Enum: "ALL" "Hpcb" "Tpcb"
l
Array of strings

If present, this parameter specifies a comma-separated list of voltages whose metrics should be included in the response. The following voltage names may be specified (case-insensitve):

  • ALL: Include measurements for all available line voltages.

  • L1, L2, or L3: The voltage of the named line input pin relative to the neutral pin.

  • D1, D2, or D3: The voltage of the named line input pin relative to a virtual neutral. The virtual neutral is calculated assuming the signals at pins D1, D2, and D3 are of equal amplitude and are phase-shifted by 120° relative to each other. If either of these assumptions is not true, the measured voltages are not be meaningful.

  • L12, L23, or L31: The voltage between the two line input pin numbers. For example, L12 measures the voltage between pins L1 and L2.

  • Ldc: The voltage at the DC input port.

It is also possible to specify a range of voltages by using a colon to separate the first and the last voltage to be included in the range. For example, L1:L3 would request inclusion of the measurements for L1, L2, and L3.

s
Array of strings

If present, this parameter specifies a comma-separated list of sensors whose metrics should be included in the response. The following sensor names may be specified (case-insensitve):

  • ALL: Include measurements for all available sensors.

  • Sn: Include measurements for sensor Sn where n is a number in the range from 1 to the number of sensor inputs supported by the meter.

  • Sn:Sm: Include measurements for sensors Sn through Sm, where n and m are numbers in the range from 1 to the number of sensor inputs supported by the meter and n is smaller than m. For example, S3:S5 would request inclusion of the measurements for S3, S4, and S5.

Responses
200

Local response.

401

Unauthorized response.

get/local
Request samples
Response samples
application/json
{
  • "ts": "1579893622.000132",
  • "values": {
    },
  • "energy": {
    }
}