Skip to main content

Interpreting XML data and examples

Contained in this article:

  1. General Information
  2. Example: Energy and power for specific dates

    General Information

    XML data is sent with cumulative register values. In the case for power registers, the cumulative values are in watt-seconds. To convert watt-seconds to kWh, divide the watt-seconds by 3,600,000. Cumulative values can be imagined as meter readings at that point in time, where consumption readings continuously increase over time. To get the kWh usage between two dates, subtract the more recent value from the older value and divide by 3,600,000.

    EG4xxx meters support TLSv1.2, while EG30xx only supports TLSv1.0

    At the bottom of the page is the output of a minute granular export showing the past ten minutes of cumulative data (obtained with the URL time_stamp represents the time of the export (unix timestamp in hex); time_delta indicates the time in seconds between exports; epoch represents the date and time recording started on that device (unix timestamp in hex).  

    Each <cname> tag contains data on a column header; in this case, that translates to a physical register on the device. t indicates the register type (P for power, V for Voltage, etc) and the text inside the tag represents the register name as recorded on the device. Virtual registers may also be shows in the appropriate parameter is passed in the initial request.

    Each row (<r> tag) contains a series of columns (<c> tag) that show the cumulative value of each register. To determine the average value of a register over a given time, simply find the difference between the two cumulative values and divide by the appropriate time delta. The resulting values are expressed in units based on the register type (see the chart in section 2.2.1 of the XML API document for the unit type).  It should be noted that prior to firmware 3.01 cumulative values do not necessarily count up from zero. On firmware 3.01 and newer passing the option when requesting data returns values relative to device epoch (ie, values start at zero). Using the parameter epoch in a data push has the same effect. This assumes that the date and time recording started option is set correctly on the eGauge.

    Some examples (based on the sample output below):

    Average Grid usage over the most recent minute 55357226851 - 55357243343 = −16492 / 60 = -274.86 Watts (remember, Power registers are bidirectional)

    Average Voltage L2 over ten minutes 4511385868513 - 4511319123106 = 66745407 / 600 = 111242.345 mV / 1000 = 111.24 Volts


    <group serial="0x4e842294">
    <data columns="12" time_stamp="0x564cb0e8" time_delta="60" epoch="0x55973268">
    <cname t="P">Grid</cname>
    <cname t="S">Grid*</cname>
    <cname t="V">VL2</cname>
    <cname t="V">VL1</cname>
    <cname t="F">Frequency</cname>


    Example: Energy and power for specific dates

    You can make CGI calls to http://DEV-URL/cgi-bin/egauge-show where DEV-URL is the URL of your eGauge (for example, 

    The T parameter lets you request data from specific points in time. It expects a comma separated list of Unix time-stamps.

    The E parameter requests the values be relative to the Date and Time when recording started. This needs to be set correctly in Settings -> Date & time when recording started. It effectively makes the reading start at zero when the date and time when recording started is set to, otherwise the raw database value could be arbitrary. This requires firmware v3.02 or greater.

    The a parameter requests total and virtual registers, such as "Usage" and "Generation". This is optional.,1483228800 returns data for January 1 2018 00:00:00 UTC, and January 1 2017 00:00:00 UTC respectively, using epoch-relative values and requesting total and virtual registers. The output below has all the other registers except for Usage and Generation removed for readability.

    <group serial="0x3b2d1cb7">
      <data columns="27" time_stamp="0x5a497a00" time_delta="60" epoch="0x52a0f760">
        <cname t="P">use</cname>
        <cname t="P">gen</cname>
      <data time_stamp="0x58684680" time_delta="900">

    Generation is zero because there is none recorded on this device.


    Usage for timestamp 0x5a497a00 (Jan 1 2018) is 241517238757 joules (241517238757/3600000 =  67088 kWh).

    Usage for timestamp 0x58684680 (Jan 1 2017) is 171138633823 joules (171138633823/3600000 = 47538 kWh).

    If you want power instead of energy, subtract the values and divide by the amount of time between them:

    67088 kWh - 47538 kWh = 19550 kWh were used between 2017 and 2018. 1 year is 8760 hours, so 19550 kWh / 8760 h = 2.23 kW average over the year. This can be done using any two points in time.


    Another description example: