Skip to main content

Electricity Meters

WARP Charger and Energy Manager support multiple electricity meters. The electricity meter API is divided into a general part under meters/... and a meter-specific part under meters/X/... where X corresponds to a meter number. The meter-specific part always includes

For example, the measurement values of the first electricity meter (which has meter number 0) can be read under meters/0/values. Additionally, each meter has the APIs

whose content depends on the class of the electricity meter. The electricity meter class is specified as the union tag of meters/X/config.

Each electricity meter reports its measurement values under meters/X/values as an array of floats. Which measurement value should be interpreted in which way can be read from meters/X/value_ids (an array of ints, the so-called MeterValueIDs): For example, if MeterValueID 13 is read at index 3 in meters/X/value_ids, then the meters/X/values value at index 3 should be interpreted as the phase current on L1.

All MeterValueIDs are documented on Github: List of all MeterValueIDs



meters/X/values

The measurement values of the X. electricity meter. The meaning of the measurement values can be determined from meters/X/value_ids.

Example
# $HOST e.g. warp-AbCd

Read

curl http://$HOST/meters/1/values
[
// Index 0
217.6941223, 0, 0,
30.72553635, 0, 0,
6680.515625, 0, 0,
6681.138672, 0, 0,
// Index 12
-90.09844208, 0, 0,
1, 0, 0,
72.56191254, 10.24184513, 30.72553635,
6683.693359, 6680.666016, -90.09844208,
// Index 24
1, 50, 4644.044922,
3.992000103, 0, 0,
0, 0, 30.70857239,
4648.038086, 197.5639954, 4648.038086,
// Index 36
4644.044922, 3.992000103
]



meters/X/update

Updates the measurement values of the X. electricity meter. Can only be used with an API electricity meter (union tag 4 in the corresponding meters/X/config).

Example
# $HOST e.g. warp-AbCd

Write

curl http://$HOST/meters/1/update -d '[
15.9, 16, 16.1,
3657, 3680, 3703
]'

Beispiel für einen Zähler, der pro Phase Strom (Bezug + Einspeisung) und Wirkleistung (Bezug - Einspeisung) misst. Die korrekte Konfiguration (meters/X/config) für diesen Zähler wäre

[4, { "display_name": "API-Zähler", "value_ids": [13, 17, 21, 39, 48, 57] }]



meters/X/value_ids

The MeterValueIDs of the X. electricity meter. The n-th entry in this array indicates the meaning of the n-th measurement value from meters/X/values. List of all MeterValueIDs

Example
# $HOST e.g. warp-AbCd

Read

curl http://$HOST/meters/1/value_ids
[
// Index 0
1, 2, 3, // Voltage L1-N, L2-N, L3-N
13, 17, 21, // Current (import + export) L1-N, L2-N, L3-N
39, 48, 57, // Active power (import - export) L1-N, L2-N, L3-N
122, 130, 138, // Apparent power (import + export) L1-N, L2-N, L3-N
// Index 12
83, 91, 99, // Reactive power (inductive - capacitive) L1-N, L2-N, L3-N
353, 354, 355, // Power factor (signed; sign indicates direction of current flow) L1, L2, L3
7, // Average phase voltage
29, // Average of (import + export) phase currents
33, // Sum of (import + export) phase currents
74, // Sum of (import - export) phase active powers
154, // Sum of (import + export) phase apparent powers
115, // Sum of (inductive - capacitive) phase reactive powers
// Index 24
356, // Sum of signed power factors
364, // Grid frequency
209, 211, // Active energy (Σ L1, L2, L3, since manufacture) import, export
4, 5, 6, 8, // Voltage L1-L2; L2-L3; L3-L1; ⌀ L1-L2, L2-L3, L3-L1
25, // Neutral conductor current
213, // Active energy (Σ L1, L2, L3, since manufacture) import + export
277, // Reactive energy (Σ L1, L2, L3, since manufacture) inductive + capacitive
214, // Active energy (Σ L1, L2, L3, since last reset) import + export
// Index 36
210, // Active energy (Σ L1, L2, L3, since last reset) import
212 // Active energy (Σ L1, L2, L3, since last reset) export
]



meters/X/history

A 48-hour history of the charging power of the X. electricity meter in watts. Missing values are indicated by null. The history is filled from back to front, so null values only occur consecutively at the beginning of the array if the ESP was restarted within the last 48 hours. Up to 720 values are output, which corresponds to one measurement value every 4 minutes. These measurement values are the respective average of these 4 minutes.

Example
# $HOST e.g. warp-AbCd
curl http://$HOST/meters/1/history
{
"offset": 60927,
"samples": [
null, null, null, null, null, null, null, null,
// 600 weitere null-Werte entfernt
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1736, 6656, 6655, 6666,
6680, 6716, 6714, 6625, 6640, 6641, 6595, 6612,
6592, 6593, 6589, 6592, 6600, 6625, 6626, 6637,
6665, 6636, 6632, 6656, 6616, 6611, 6646, 6670,
6691, 6715, 6787, 6754, 6761, 6797, 6771, 6685,
6705, 6778, 6703, 6675, 6681, 6721, 6739, 6816,
6872, 6858, 6821, 6836, 6784, 6871, 6943, 6930,
6968, 6955, 6837, 6800, 6846, 6919, 6881, 6736,
6671, 6655, 6674, 6743, 6878, 5733, 4462, 3712,
3098, 2693, 2337, 2098, 1683, 1575, 1575, 84,
0, 0, 0, 0, 0, 0, 0, 0
]
}
NameDescription
offset
int (ms)

The age of the last measured value.

samples
int[..]

The measured values.




meters/X/live

The last charging power measurement values of the X. electricity meter. Based on these values, the average values for meters/X/history are generated.

Example
# $HOST e.g. warp-AbCd
curl http://$HOST/meters/1/live
{
"offset": 370,
"samples_per_second": 1.99565,
"samples": [
2626, 2626, 2626, 2626, 2626, 2626, 2626, 2673,
2673, 2673, 2673, 2673, 2673, 2673, 2673, 2677,
2677, 2677, 2677, 2677, 2677, 2677, 2677, 2677,
2677, 2677, 2677, 2677, 2677, 2677, 2677, 988,
988, 988, 988, 988, 988, 988, 988, 3,
3, 3, 3, 3, 3, 3, 3, 1,
1, 1, 1, 1, 1, 1, 1, 3,
3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 4
]
}

Es liegen 80 Werte vor, ~ 2 Werte pro Sekunde wurden erhoben, das Offset des letzten Werts sind 370 ms -> Die Messwerte reichen im Moment 40,370 Sekunden in die Vergangenheit.

NameDescription
offset
int (ms)

The age of the last measured value.

samples_per_second
float (Hz)

The number of measured values per second.

samples
int[..]

The measured values. Depending on the length of the array and the samples_per_second value, it can be determined how far back in time the measurement values reach.




meters/X/config

The configuration of the X. electricity meter. The union tag specifies the meter class.

Example
# $HOST e.g. warp-AbCd

Read

curl http://$HOST/meters/1/config
[4, { "display_name": "API-Zähler", "value_ids": [13, 17, 21, 39, 48, 57] }]

Konfiguriert für den Stromzähler-Slot 1 einen über meters/1/update mit Werten befüllbaren Stromzähler, der pro Phase Strom (Bezug + Einspeisung) und Wirkleistung (Bezug - Einspeisung) misst. 4 ist das Union-Tag des API-Stromzählers.

Write

curl http://$HOST/meters/1/config -d '[4, { "display_name": "API-Zähler", "value_ids": [13, 17, 21, 39, 48, 57] }]'

Konfiguriert für den Stromzähler-Slot 1 einen über meters/1/update mit Werten befüllbaren Stromzähler, der pro Phase Strom (Bezug + Einspeisung) und Wirkleistung (Bezug - Einspeisung) misst. 4 ist das Union-Tag des API-Stromzählers.

null: No electricity meter configured.




meters/X/state

The state of the X. electricity meter. The content of this API depends on the type of electricity meter configured in meters/X/config.

Example
# $HOST e.g. warp-AbCd

Read

curl http://$HOST/meters/1/state
null

null: No electricity meter configured.




meters/X/errors

Error counters for communication with the electricity meter. The content of this API depends on the type of electricity meter configured in meters/X/config.

Example
# $HOST e.g. warp-AbCd

Read

curl http://$HOST/meters/1/errors
null

null: No electricity meter configured.




meters/X/reset

Resets all resettable (all values whose kind entry is resettable: List of all MeterValueIDs) meter values of the X. electricity meter. Empty payload. One of the following values must be passed: null, "", false, 0, [] or {}

Example
# $HOST e.g. warp-AbCd

Write

curl http://$HOST/meters/1/reset -d 'null'



meters/X/last_reset

The time of the last meter reset (see meters/X/reset) as Unix timestamp. 0 if no reset was performed. If no time synchronization was available at the time of the last reset, this value is instead a counter indicating how many times a reset was performed.

Example
# $HOST e.g. warp-AbCd

Read

curl http://$HOST/meters/1/last_reset
{ "last_reset": 1714728252 }

Zuletzt zurückgesetzt 2024-05-03T11:24:12+02:00

NameDescription
last_reset
int (s)

Unix timestamp of the time of the last meter reset.




meters/history

A 48-hour history of charging power in watts. Missing values are indicated by null. The history is filled from back to front, so null values only occur consecutively at the beginning of the array if the ESP was restarted within the last 48 hours. Up to 720 values are output, which corresponds to one measurement value every 4 minutes. These measurement values are the respective average of these 4 minutes.

Example
# $HOST e.g. warp-AbCd
curl http://$HOST/meters/history
{
"offset": 9378,
"samples": [
[
null, null, null, null, null, null, null, null,
// 600 weitere null-Werte entfernt
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1736, 6656, 6655, 6666,
6680, 6716, 6714, 6625, 6640, 6641, 6595, 6612,
6592, 6593, 6589, 6592, 6600, 6625, 6626, 6637,
6665, 6636, 6632, 6656, 6616, 6611, 6646, 6670,
6691, 6715, 6787, 6754, 6761, 6797, 6771, 6685,
6705, 6778, 6703, 6675, 6681, 6721, 6739, 6816,
6872, 6858, 6821, 6836, 6784, 6871, 6943, 6930,
6968, 6955, 6837, 6800, 6846, 6919, 6881, 6736,
6671, 6655, 6674, 6743, 6878, 5733, 4462, 3712,
3098, 2693, 2337, 2098, 1683, 1575, 1575, 84,
0, 0, 0, 0, 0, 0, 0, 0
],
null,
null,
null,
null,
null,
null
]
}
NameDescription
offset
int (ms)

The age of the last measured value.

samples
int[..][2]

The measured values of all electricity meters.

  • [0..1] - The measured values of the respective electricity meter. Null if a meter is not configured.



meters/live

The last charging power measurement values. Based on these values, the average values for meters/history are generated. Up to 720 values are output, which corresponds to 6 minutes with one measurement value every 500 milliseconds.

NameDescription
offset
int (ms)

The age of the last measured value.

samples_per_second
float (Hz)

The number of measured values per second.

samples
int[..][2]

The measured values of all electricity meters.

  • [0..1] - The measured values. Depending on the length of the array and the samples_per_second value, it can be determined how far back in time the measurement values reach.