3.0 Version table ....................................................................................................................................................................................................................................... 2
5.0 General ..............................................................................................................................................................................................................................................3
6.1 Creating third party code ..................................................................................................................................................................................................... 4
6.2 Assigning access to a third party .......................................................................................................................................................................................5
7.1 API format ................................................................................................................................................................................................................................... 7
7.3 Time formats .............................................................................................................................................................................................................................. 7
8.0 Master data service ........................................................................................................................................................................................................................ 9
8.2.1 Example of getEclMasterData response ............................................................................................................................................................ 10
8.2.2 Master data ...................................................................................................................................................................................................................11
8.4 Status codes for response ...................................................................................................................................................................................................17
10.0 Using the interface .......................................................................................................................................................................................................................21
10.1 Extracting master data .......................................................................................................................................................................................................23
10.1.1 M-bus, Main meter house .................................................................................................................................................................................25
10.1.2 M-bus, Solar heating, small tank ....................................................................................................................................................................26
10.1.3 M-bus, Solar heating, large tank .....................................................................................................................................................................28
10.1.4 ECL log, A367.1 example e ................................................................................................................................................................................30
10.1.6 Read the latest values for one or more sensors on a meter connected to the ECL controller .................................................33
10.1.7 Reading the most recently measured outdoor temperature ...............................................................................................................34
10.1.8 Reading of Energy, Volume, Flow temperature and Return temperature for the house’s main meter ................................35
10.1.9 Read the latest value for one or more sensors across meters connected to the ECL controller .............................................35
10.1.10 Read a period of historical data for one or more sensors on one meter connected to the ECL controller .........................35
10.2 Format differences in data extracted ............................................................................................................................................................................39
This document is a description for a third party for use when implementing software clients to extract data from the
ECL Comfort 296 / 310 Portal (ECL Portal).
3.0 Version table
VersionDateChange
1.0025/09/2013First version.
1.1025/10/2013Section added about the creation of third party code, future version, time formats.
JSON examples added for requests and responses.
1.1129/10/2013Example added of difference in data extraction from ECL Portal and ECL Portal API.
Example added of time format in readings.
1.1201/04/2014A few detailed explanations and examples added.
4.0 Glossary
APIApplication Programming Interface. An interface for the sharing of application-specific information.
DeviceA device. Typically used in connection with a log device.
ECL Comfort 296 / 310 A district heating controller model from Danfoss A/S.
HTTPSHyperText Transfer Protocol. An encrypted protocol used to transfer information.
Configurable inputSome sensor inputs on an ECL Comfort 296 / 310 controller can be adjusted as an option to measure
temperature, pulse, frequency, 0-10 V analogue signal or digital ON/OFF
CustomerA person, company or municipality that wants data extracted from the ECL Portal.
JSONJavaScript Object Notation. An open data format for sharing data between a server and an Internet program.
M-busA communication protocol typically used by heat and energy meters.
PagingDivision into pages. In order to avoid too much information being transferred at one time, a volume of data is
divided into a number of pages, only one of which is read at a time.
ReadingA reading. Log data extracted from the web API from a log device.
RequestA request to the web API.
ResponseResponse from the web API server to a request.
RESTRepresentational State Transfer. A software architecture style that can be used to design Internet services.
Server codeA unique code issued by Danfoss to a third party.
SSLSecure Sockets Layer. Encryption for the secure sharing of information used, for example on the Internet
(HTTPS).
Master dataBase data for an ECL Comfort 296 / 310 controller.
Third party codeA code created by the customer in the ECL Portal, which the customer issues to a third party.
URLUniform Resource Locator. An Internet address.
UTCCoordinated Universal Time. A standard for coordinated time based in Greenwich, London. Time zones are
expressed with reference to UTC.
Web APIAn API adapted for the Internet.
Third partyAn external company engaged by a customer to develop software to extract data from the ECL Portal to an
The data that is available via the ECL Portal web API depends on the ECL application key installed in the ECL Comfort 296 / 310 in
question. I.e. the data set available is different for each ECL application type and can also depend on the various external data collection
devices, such as M-bus meters and configurable inputs with which ECL controllers can be fitted.
The ECL Portal retrieves data from the ECL controllers once an hour just after the top of the hour. The integrated ECL Log contains
application-specific signals such as temperatures measured and temperature references, as well as wind speed, pressure or flow,
depending on the application installed. The ECL log contains data recorded at 15-minute intervals. If the customer has set up
configurable inputs or connected M-bus meters, the current values of these will also be retrieved once an hour.
If it is not possible to retrieve data from an ECL controller because of a communication error or for some other reason, an attempt will be
made to retrieve the ECL log when the next collection takes place one hour later. The internal ECL log in the ECL controller contains data
for the last ten days, so if it has not been possible to retrieve the log from an ECL controller for ten days, data will be lost from the ECL
portal and will thus not be available through the web API.
As soon as data is available on the ECL Portal, it will also be available through the ECL Portal web API. It is not possible to retrieve data
through the web API that is not available on the ECL Portal. If, for example, a customer deletes an ECL log or M-bus meter on the ECL
Portal, it will no longer be available through the web API either.
Data is not saved for configurable inputs and M-bus meters in the ECL controller, so historical values will not be read when the logs are
next retrieved if there has been no contact with the ECL Portal.
Guides for individual ECL applications are available at www.ecl.doc.danfoss.com, if it is necessary for a third party to have more specific
knowledge of the data that can be extracted from the ECL controllers.
A description of communication for ECL controllers may be found here:
http://heating.danfoss.com/PCMPDF/VILGV502_ECL_Comfort_210_296_310_Communication.pdf or by Googling “ecl communication
description” to find the latest version. The communication description contains, among other things, a general list of parameters that are
logged by some applications.
6.0 Security
As this is an external interface from the ECL Portal server to the outside world, it is particularly important to make sure that it is not
possible to gain access to other parties’ data.
The first element in securing data is identification, so that you can validate whether the client that is calling the ECL Portal web API is
authorised to view the data being requested. You must therefore always specify the following in requests:
• Server code. This is issued by Danfoss to a third party or customer, so that the opening of the data interface is an active process
performed by Danfoss. This involves a setup in connection with the conclusion of a legal contract.
• ECL serial number. Used to identify an ECL controller of interest. The serial number may be found inside the ECL controller’s menu or
at the ECL Portal
• Third party code. Created by the customer in the ECL Portal and issued to a third party.
Not only must the third party or customer have stated a server code and know the serial number, but the customer himself must link third
party codes to the ECL controller. This provides the customer with the possibility of controlling which third party people and systems they
wish to allow to extract the data by assigning them various third party codes, which can of course also be revoked individually.
This means that in order to obtain data from a given ECL controller, you must know its serial number, have a server code issued from
Danfoss and have assigned yourself, your system or third party an ECL-specific third party code.
Just as with traditional user name/password combinations, data will only be able to fall into the wrong hands if the combination is
compromised, as in such an eventuality an external party would only be able to use the same codes and perform his own requests.
Security is thus dependent in this scenario on how the customer and the third party protect this information.
Server codes are issued to the customer/third party individually and may not be shared by a number of customers, as under the legal
contract such party may be cancelled when the contract expires or in the event of abuse.
Data communication through the web API requires SSL support. If a client sends requests via HTTP, it will be redirected to HTTPS.
Give a name to the third party code in order to keep track of all
codes, and select the setting “Enabled” to render the code active.
The code will now appear in the list of codes created.
Click on the “ECLs” link to go to the page where the code can be
assigned to specific ECL controllers.
You can assign the same code here to several ECL controllers, and
you can assign several codes to the same ECL controller, so that
you can better control who has access to what.
a) If the customer has not previously provided the third party in question with access to data for some ECL controllers administered by
the end customers, the end customer sets up a code for the third party under the menu item ECL > Third party codes.
b) The end customer links the relevant ECL controller to the relevant third party code.
c) The end customer notifies the third party of the ECL serial number and the third party code.
With these three pieces of information (server code, ECL serial number, third party code), the third party now has the ability to access data
for the ECL controller via the web API.
The conceptual interfaces that will be accessible via the web API are described here. Conceptual means what you can request, including
which items of information are required in order to request, as well as which items of information you receive in return from such requests.
When you retrieve readings for a given period, it may be the case that the period includes a large number of readings, which is not suitable
for transfer via an HTTP request in one action. It is therefore a good idea to operate using what is known as paging, i.e. when you make
your request, in addition to indicating the period, you can indicate how many readings you wish to receive at a time. From the responses
you receive in return, you can then see whether you have received all readings on the “first page” (/response) or whether you have to
retrieve more, and how many you can expect to have to retrieve in total. On the basis of this you can then request the next page, and so
on. At the same time, the system defines a default page size and a maximum page size, so you do not need to specify a page size, and nor do
you run the risk that a client will ask for an unrealistically large load of data in one single request.
As an ECL controller can operate with several log devices and at different log frequencies, it is difficult to create a logical “page break”
in the event that not all data can be returned at one time. When you retrieve readings, it is good to know in advance which devices are
accessible on an ECL controller, which ones are active, etc. There is thus a need to be able to obtain this information when readings are to
be retrieved, but also if a third party wishes to store/synchronise details of the ECL controllers, devices and channels – what is known as
master data.
Examples of accessible devices and channels in an ECL Comfort 296 / 310 controller with a given application, which has connected two
heat meters via M-bus:
These channels are accessible in the relevant
meter, which is connected via M-bus.
AQ131886471802en-010301
heat
Operating guide ECL Portal API
For this reason, there will be a division of the services that the web API makes available. One service that operates with master data and
one service that operates with readings. To make the transfer of readings as optimal as possible in terms of performance, these calls will
only return the raw values. In order to interpret them (e.g. in terms of units, etc.), they must then be aligned with master data.
7.1 API format
The web API is a REST (REpresentational State Transfer) API via HTTPS(GET) requests, in which the argument is extracted as a combination of
URL components and URL query parameters.
The response format will always be minimalist JSON due to performance. Later in this document there are examples of requests in the
correct format.
When the third party has received the server code, third party code and serial number for an ECL controller, they can test the web API by
pasting an example from a later section into a browser such as Chrome, after which they will receive a response. The JSON Viewer
Notepad++ can easily be used to format the JSON text received into an easily readable format.
7.2 Future versions
The interface is prepared for any changes in the future in the format, as an interface version must accompany the requests. The version
indicator must be specified in the following form:
https://{host}/endpoint/{version}/...
plug-in for
in which {version} must be replaced by the name of the version format. The version name for the first version is “v1”. See examples where
this is used in a later section. The endpoint can be either master data or readings, as described in subsequent sections.
When new versions are introduced, an end date will be announced for the old version, so that third party companies have a period during
which they can update their software to the new version.
The old version will no longer be available after the end date. When a new version is available, this will be announced on the front page of
the ECL Portal and/or the newsletter.
{host} must be replaced by eclwebapi.danfoss.dk for the web API linked to the Danish ECL Portal at ecl.portal.danfoss.dk.
For the web API on the international ECL Portal, {host} must be replaced by eclwebapi.danfoss.com.
It is not possible to access ECL controllers at the Danish portal through the web API for the international portal, or vice versa.
7.3 Time formats
Time stamps in the web API follow the ISO 8601 standard. This means that time stamps will be in UTC by default and will appear as:
2013-04-18T08:53:00.0Z
Time stamps in response messages will always be in UTC, and third party software may then convert to other time zones as required.
In master data for individual ECL controllers, the time zone stated is the one that was specified under the ECL controller’s data by the owner/
administrator on the ECL Portal.
It is possible to specify time stamps in other time zones, when you request data by specifying the local time zone. The above time stamp
will then be expressed as
2013-04-18T10:53:00.0+02:00
The “+” symbol must be expressed as “%2B” in requests and the “-” symbol must be expressed as “%2D”
If the time in the ECL controller does not match, or the time zone in the ECL Portal is incorrect, the time stamps in the data extracted may
be misleading.
Sample reading for ECL log taken from the ECL Portal API on 29/10/2013 at 09:40 Danish standard time.
The first “from” parameter is the current reading time, here shown with the time zone +01:00.
“timestamp” is the ECL controller’s time for the sample in question.
“receivedTime” is the time in the ECL Portal at the point in time when it extracted data from the ECL controller. As data is extracted once
an hour, there will typically be four samples (one for each quarter of an hour) with the same “receivedTime” value, although if there has
been a failure in data communication, more data may have been extracted at the same time.
If there is no data in the database for the specified time in the specified direction, the data field in the response will be empty.
Sample reading for ECL log extracted from the ECL Portal API on 01/01/2014 at 12:05 Danish Summer Time. The time in the ECL controller
has been wrongly set here, and an incorrect time zone has been selected (UTC+02:00 instead of UTC+01:00) in the ECL Portal.
The associated log extracted as an Excel file from the ECL Portal shows:
You can see here that the ECL controller’s time at the last sample was 2012-10-04 05:15:00, while the time in the data from the web API
was 2012-10-04 02:15:00Z. There is thus a three-hour difference, which comes from the time zone (which is +2 hours) and summer time
(+1 hour)
By comparing the three times (from, timeStamp and receivedTime), you can check whether the time has been set correctly in the ECL controller,
and whether the correct time zone has been selected in the ECL Portal.
8.0 Master data service
This section describes what the master data service can be used for.
In this first version, the service has only one method. The method is getEclMasterData, and it retrieves all relevant master data for a given
ECL controller, including connected meters. It also includes data that is necessary to interpret the readings that can be retrieved. Below is
a description of the conceptual content of request and response.
8.1 getEclMasterData request parameters
Parameter Description Example
serverCode Part of identification cf. section 5 on security. CompanyA
eclSerial Part of identification cf. section 5 on security. 123456792
eclAccessCode Part of identification cf. section 5 on security. Code5
clientRequestId Optional text that can be used to implement traceability in third party
systems that function asynchronously. Can be omitted, but would otherwise
typically be an auto-generated unique ID.
The following information is returned in the response from the server for reasons of traceability.
ElementDescriptionExample
clientRequestId The ID that was sent during the actual
request in order to permit traceability
in the third party.
serverRequestId The server itself assigns a unique ID to
each request, as there is no requirement
that you must send a unique client ID
across customers. This ID can be used if
you are in any doubt about the server’s
handling of a request, as various pieces
of statistical information will be logged
about each request (see section 5.4 on
traceability).
8.2.1 Example of getEclMasterData response
Master data is described in greater detail in the next section.
The following basic master data is also returned with the response for the actual ECL controller.
8.3 getEclMasterData response
The following information is returned in the response from the server for reasons of traceability.
Element Description Example
application Which application the ECL controller
is running.
applicationVersion Version of the application 4.00
hardwareModel Hardware model number ECL 296 / 310, 230 V
hardwareVersion Hardware version A
softwareBuild *Software build number 7232
hardwareProductionTime Hardware production time 3.2010
firmwareVersion Firmware version number 1.48
serialNumber Serial number 123456792
createdOnPortal Date when the ECL controller was
created on (first linked to) the portal
timezone Time zone in which ECL controller is
located (selected on ECL Portal)
location:Street **Street in which ECL controller is
located (if entered on ECL Portal)
location:StreetNumber **House number at which ECL controller
is located (if entered on ECL Portal)
A376.1
2013-04-18T08:53:00.0Z
Europe/Copenhagen
Solitudevej
13A
location:Zip **Postcode at which ECL controller is
located (if entered on ECL Portal)
location:City **Town/city in which ECL controller is
located (if entered on ECL Portal)
location:Country **Country in which ECL controller is
located (if entered on ECL Portal)
name Name (entered on ECL Portal) Heating in basement
description **Description (if entered on ECL Portal) Basement
portalGroup **Group set up in EP to group ECL
controllers
* This string was originally “hardwareBuild”, but has since been corrected to “softwareBuild”.
** This data is only sent with master data if it has been entered in the ECL Portal.
Furthermore, for every device on the ECL controller, the following information about the actual device will be returned.
type Specifies the type of device. Possible results are “EclLogDevice”,
“EclConfigInputDevice” and “EclMBusDevice”.
externalDeviceId External ID number for the device. Must be used, for example,
to be able to retrieve readings for the device.
name
activeDenotes whether the device is in use. Possible values are
createdOnPortalCreation time for device in ISO 8601 format.2013-04-18T08:53:00.0Z
lastReadTime last read in ISO 8601 format.2013-04-18T08:53:00.0Z
logAppNamePortal application currently selected. There are many different
configInputType
Name of the device. For an ECL log, the name is always “EclLog”. For
other types, any name can be used when created on the ECL Portal
“false”/“true”.
Only one ECL log device may be active at a time, although several
EclConfigInputDevices or EclMBusDevices can be created at the
same time. The active ECL log corresponds to the portal application
currently selected.
possibilities, so they will not be mentioned here.
Possible values are:
-0-10V ADC
-Digital
-Flow switch
-Pulse
-Frequency
If it is an unknown type, “7” is returned.
For EclConfigInputDevices only.
EclLogDevice
c0f6563e-2bd0-45149539-db2c0c700d78
EclLog
.
True
A376.1 example a
0-10V ADCPt 1000
configInputDefinedMaxValue*For EclConfigInputDevices of the type 0-10 V ADC only.4
configInputDefinedMinValue **For EclConfigInputDevices of the type 0-10 V ADC only.2
configInputCircuitCloseTextFor EclConfigInputDevices of the type “Digital” or “Flow switch”
for status “close” only.
configInputCircuitOpenText For EclConfigInputDevices of the type “Digital” or “Flow switch”
for status “open” only.
configInputSensorId For EclConfigInputDevices only. Indicates at which input the
configurable input has been created.
mbusAddress For EclMBusDevices only. The address of the M-bus network.15
mbusSerialNumber
mbusType ***For EclMBusDevices only. Type of M-bus meter. Consists of
channels Channel information is shown in a later table below.
* This parameter indicates which actual value 10 V represents for 0-10 V ADC input.
** This parameter indicates which actual value 0 V represents for 0-10 V ADC input.
*** Known types are:
For EclMBusDevices only. Unique serial number for the M-bus meter
ABB-02-02 ABB meter
ABB-06-02 ABB DBM
ABB-07-02 ABB OD
ACW-09-04 Actaris meter
ACW-0b-04 Actaris meter
ACW-0b-0c Actaris meter
ACW-0f-04 Actaris meter
ACW-14-07 Actaris meter
AXI-04-04 Axis SKS3
BHG-05-04 Brunata meter
BHG-3d-04 Brunata HGQ
BHG-3d-0c Brunata meter
BHG-3d-16 Brunata meter
DEI-14-02 Deif APM 380
DFS-01-04 Danfoss meter
DFS-01-0c Danfoss meter
DFS-20-04 Danfoss Sonometer 1100 Heat meter
DFS-20-0a Danfoss Sonometer 1100 Cooling meter
DFS-25-07 Hydrometer Hydrus
DFS-2b-04 Danfoss Sonometer 1000
DFS-2b-0c Danfoss meter
DFS-2f-04 Danfoss Sonometer 1100
DFS-41-04 Danfoss Sonometer 500
DFS-43-0c Danfoss M-Cal Compact
DFS-50-04 Danfoss Infocal 6
DFS-52-04 Danfoss Infocal 8
EMH-00-02 EMH KIZ
HYD-20-04 Danfoss Sonometer 1100 Heat meter
HYD-20-0a Danfoss Sonometer 1100 Cooling meter
HYD-20-0c Hydrometer meter
HYD-2b-04 Danfoss Sonometer 1000
HYD-2f-04 Danfoss Sonometer 1100
HYD-2f-0c Hydrometer meter
HYD-50-04 Danfoss Infocal 6
HYD-52-04 Danfoss Infocal 8
HYD-95-02 Hydrometer Hydroport
INV-40-07 Sensus HRI b1
ITR-18-04 Itron meter
KAM-01-02 Kamstrup meter
KAM-01-04 Kamstrup meter
KAM-01-0c Kamstrup Multical III
KAM-02-04 Kamstrup Multical 401
KAM-07-04 Kamstrup meter
KAM-07-0c Kamstrup meter
KAM-08-04 Kamstrup meter
KAM-08-0c Kamstrup Multical 601
KAM-0b-04 Kamstrup Multical 402
KAM-0b-0c Kamstrup meter
KAM-0f-04 Kamstrup meter
KAM-0f-0c Kamstrup Multical 801
KAM-0f-16 Kamstrup meter
KAM-11-04 Kamstrup meter
KAM-11-0c Kamstrup meter
KAM-15-04 Kamstrup meter
KAM-1b-16 Kamstrup Multical 21
KAM-1c-04 Kamstrup Multical 602
LDR-01-02 Unknown meter
LSE-10-04 Landis & Staefa electronic meter
LUG-02-04 Landis & Gyr
LUG-04-04 Landis & Gyr meter
REL-41-07 Relay meter
UNKNOWN Label for unknown M-bus meter type
SEN-0e-04 Sensus meter
SEN-52-07 Sensus meter
SVM-30-0c Svensk Värmemätning SVM meter
WZG-03-07 Neumann & Co. Wasserzähler meter
Used for M-bus devices to specify the
channel type. Depends on the M-bus
meter type, so new meters may contain
new values. Possible values are:
-ENERGY
-VOLUME
-MASS
-POWER
-VOLUME_FLOW
-VOLUME_FLOW_EXT
-MASS_FLOW
-FLOW_TEMPERATURE
-RETURN_TEMPERATURE
-TEMPERATURE_DIFFERENCE
-EXTERNAL_TEMPERATURE
-PRESSURE
-DATE_TIME
-ON_TIME
-OPERATING_TIME
-VOLTAGE
-CURRENT
-DATE
-STATUS
-SUBUNIT
-TARIFF
VOLUME_FLOW
* ) The name depends on factors including the device type, as explained below
For EclConfigInput devices, the name can be entered by the owner/administrator of the ECL Portal.
For EclLog devices, the name depends on the sensor number.
Sensor 1 is called S1, sensor 2 is called S2, etc.
The reference value for sensor 2 is RefS2, the reference value for Sensor 3 is RefS3, etc.
Furthermore, some applications log certain signals that do not come directly from the sensors.
These signals are named after their PNU/ID. For example, the PNU 11098, which is the calculated wind strength, is logged in A230.1.
It is therefore named “11098”. It is not possible to name all logged signals for all applications, which is why simple names should
be specified.
For EclMBusDevices, the channel is named on the basis of what the M-bus meter says it is.
The name therefore depends on the specific meter type being used.
Possible names are:
-power
-return_temperature
-temperature_difference
-voltage
-volume_flow
-volume
-current
-energy
-flow_temperature
-on_time
-operating_time
-status
The list of possible names may be extended in future if new M-bus meters make this necessary.
As an ECL can have several old log devices of all types, which are no longer active, the owner/administrator should make sure that old
devices on the ECL Portal are deleted if there is no longer any use for their data content.
8.4 Status codes for response
Errors will be responded to in accordance with the HTTP standard, i.e. the response must be able to have one of the following HTTP status
codes (for all codes other than code 200, the response will not contain data, but typically a text explaining the problem in detail).
• 200 – OK
• 400 – Bad request, typically because a parameter is missing.
• 401 – Unauthorised, i.e. the server code or third party code is not correct.
• 404 – ECL not found
• 500 – Other unknown error
9.0 Readings
This section describes what the readings service can be used for.
In this first version, the service has only one method. The method is getReadings and it retrieves readings for a device for a given period.
In order to optimise data transfer, the result is kept as simple as possible, and you will typically have to know the master data for the ECL
controller in order to be able to process the values received. Below is a description of the conceptual content of request and response.
serverCode Part of identification cf. section 5.3 on
security.
eclSerial Part of identification cf. section 5.3 on
security.
eclAccessCode Part of identification cf. section 5.3 on
security.
externalDeviceId The external ID number for the device
(see master data).
Default = “*”, which means that you are
interested in data from all devices for
the ECL controller. This is all permitted
when pageSize = 1, in all other cases
you must identify a specific device.
from * Start time (inclusive) in ISO 8601 format
direction If you want readings from the start time
page Specifies which page you want to have.
pageSize
clientRequestId Optional text ID that can be used to
c0f6563e-2bd0-4514-9539-
db2c0c700d78
for reading from API. The default value
is the current time.
and thereafter (forward) or
before (reverse). Please note that the
sort results of readings in the response
depend on this selection. Default =
“reverse”.
If, for example, pageSize is 1000 and
state that you want to have page 2,
will typically skip the first 1000 readings
(typically because you have received
them in a previous request). Default =
1. Min = 1.
The page size, i.e. the number of readings
per page. Default = 1. Min = 1. Max =
15,000. Please note that each reading
can have up to 16 values, depending on
the number of channels for the device.
implement traceability in third party
systems that function asynchronously,
as this is sent with the response. Can be
omitted, but would otherwise typically
be an auto-generated unique ID.
you
you
CompanyA
123456792
Code5
2013-04-18T08:53:00.0Z
forward
1
1000
555b7f4d-7e1a-4d76-a4f0-be8fb52b7c80
* If you have performed a recent extraction of master data, you will also know when you last received data (lastRead from the device).
Example of request following the last reading from a specific device.
Example of request for data from a specific device from a given date and back in time.
https://{host}/readings/{version}/{eclSerial}?serverCode={serverCode}&eclAccessCode={eclAccessCode}& ex ternalDeviceId={ex ternal
DeviceId}&from={from}&pageSize={pageSize}&page=1
Example of request for data from a specific device from a given date and ahead in time.
If there is no data in the database for the specified time, the API will deliver the next set of data in the specified direction (forward/reverse).
9.2 getReadings Response
As a response to a reading request, one tracking object and one data object are returned.
Tracking object:
Element Description Example
clientRequestId The optional text ID that was sent during the actual request in order
to permit traceability in the third party.
serverRequestId The server itself assigns a unique ID to each request, as there is no
requirement that you must send a unique client ID across customers.
This ID can be used if you are in any doubt about the server’s handling
of a request, as various pieces of statistical information will be logged
about each request (see section 5.4 on traceability).
from Repeat of the request parameter or default value, so that you can
check the starting point.
direction Repeat of the request parameter or default value, so that you can
check the direction.
page * Repeat of the request parameter or default value, so that you can
check how far you have “browsed”.
pageSize Repeat of the request parameter or default value, so that you can
check the page size.
resultReadings The number of readings contained in this response (this page –
typically pageSize except the last page).
totalReadings **
totalPages ** The total number of pages needed to read all readings. 6
The total number of readings available if you browse through all pages.
555b7f4d-7e1a-4d76-a4f0be8fb52b7c80
9cd4df10-09cc-4ec7-8b4ec1180b21d9d9
2013-04-18T08:53:00.0Z
forward
1
1000
1000
5642
*) To continue to the next set of data, you will thus use the same request parameters, but increase the page by one for each reading.
**) Only specified for the response on page 1, so that the rows for each page are not counted again. Also specified only if externalDeviceId is
different from * (as there is no support anyway for paging when submitting requests to several devices simultaneously).
externalDeviceId ID used to identify the device. See master data.c0f6563e-2bd0-4514-9539-db2c0c700d78
readingsA compilation of readings belonging to the device.See next table for contents
For each reading, the following information will also be contained in the response.
ElementDescriptionExample
timestamp The ECL controller’s time stamp for the reading.2013-04-18T08:53:00.0Z
receivedTime When the ECP Portal logged the reading. 2013-04-18T08:55:32.9Z
manualEntry Only for EclConfigInput devices of the “Pulse” type, for which you can enter
values manually via the ECL Portal.
value1
… 15 Other value fields as above, up to value16, which is the last one.
There is no dependency on the log frequency. The readings will only be listed ascending or descending (depending on what you have
requested) in chronological order. I.e. there can in theory be a change in the log frequency over a period.
Errors will be responded to in accordance with the HTTP standard, i.e. the response must be able to have one of the following HTTP status
codes (for all codes other than code 200, the response will not contain data, but typically a text explaining the problem in detail).
• 200 – OK
• 400 – Bad request, typically because a parameter is missing or incorrectly formatted.
• 401 – Unauthorised, i.e. the server code or third party code is not correct.
This section describes/provides examples of different scenarios for using the API.
The API can be used to request data from any ECL controller. The actual scenarios described later in this document are based on the
following setup:
This is an A367.1 example e, to which 3 M-bus-based heat meters have been linked together with one pulse-based water meter.
On the ECL Portal, the ECL controller appears with the following log units (referred to in web API terms as devices) under ECL > Log:
There are two ECL log devices here, because first of all the port application has been changed from example a to example e, as the user
felt that this was more suitable for the system in question. Only one ECL log is active (True), and the other only contains old data. All log
devices can be read through the web API. To read a specific log device, you must use the correct externalDeviceId, which can be found by
reading master data, which also specifies which log devices are active.
Each log device has a number of channels for which values are logged. These can best be viewed on the Portal as a list under Graph >
User-defined graph > Create new graph; the list is shown below, as based on our example ECL:
Before you extract the readings for an ECL controller, it will be relevant to retrieve the latest master data. Retrieving the master data for
the above ECL controller takes place by making one single call to the web API. This can take the form of a request to the REST endpoint,
and the response will be in JSON format.
As mentioned earlier, master data is returned for the actual ECL controller together with each of the linked devices/log devices (in this
instance 6 devices, as master data is also returned for inactive devices).
As described in section 7.1, the server code, ECL serial number, third party code and possibly a clientRequestId are sent as parameters in
the request.
This includes a description of which information is contained in the response from the web API. Information that includes what can be
seen in the portal (cf. screenshots earlier on in this document) and additional details.
For reasons of traceability, the following request ID information is returned in the response from the server. This does not relate to master
data registered on the portal, but only to the actual master data request, and will therefore be different for each request.
Description and portalGroup are not entered for this ECL controller, so they will not be included. Furthermore, for every device/log device
on the ECL controller, a number of items of information about the actual device and underlying channels will be returned.
This section describes the use of the web API to extract readings.
In order to be able to extract readings for a given period (rather than, for example, just the last reading), it is a requirement that you know the
device’s external ID (which is contained in the master data), and under all circumstances you need to know which values in a reading
represent what (which channel), and in which unit it is measured (also contained in the master data).
There is thus a need to know the master data for one reason or another. Whether you retrieve master data for an ECL controller immediately
before retrieving data for it, or you use cached master data, depends on the user scenario in the third party application. There will, however,
be a need to retrieve updated master data at intervals, as the customer may make changes to the setup without informing the third party.
However, if readings are to be requested over several pages, it is not necessary to request master data for each page. The following scenarios
assume that you have master data available for the ECL controller, in one way or another, before retrieving the data for the readings.
10.1.6 Read the latest values for one or more sensors on a meter connected to the ECL controller
Retrieving the latest reading (which contains one value for each sensor/channel) for a meter/device connected to the ECL controller takes
place by making one single call to the web API. This can take the form of a request to the REST endpoint, and the response will be in JSON
format.
Many of the input parameters are essentially set up to read the latest value, which is why you only need to define a few parameters in the
call. In addition to the identification parameters (server code, ECL serial number and third party code), only the meter’s/device’s external
ID (externalDeviceId) from the master data needs to be specified in the call.
10.1.7 Reading the most recently measured outdoor temperature
The outdoor temperature is measured via the ECL log, which has the externalDeviceId = 2cc34b74-2c42-4ad1-a6c4-f27876b1c799,
cf. the master data, which is why this value is included in the request.
The following reading is also returned in the same response message:
Element Example
timestamp 2013-04-29T09:00:00.0Z
receivedTime 2013-04-18T09:08:31.0Z
manualEntry False
value1 9.84
value2 192
value3 63.95
value4 65
value5 39.14
value6 65
value7 44.98
value8 50
value9 54
value10 28.48
value11 27.16
value12 32.61
value13 31.53
value14 192
Because the master data defines that the device in question has 14 channels, each reading for this device will have 14 values. It can also
be seen from the master data that the outdoor temperature has readingValueIndex = 1, and that the unit is °C, i.e. that the value in °C
must exist as value1 (the others are not of interest in this case), which in this case is 9.84.
10.1.8 Reading of Energy, Volume, Flow temperature and Return temperature for the house’s main meter
The main meter for the house is the M-bus device with externalDeviceId = 8dbb8b99-96a4-498c-b75b-c7453e1ad6c1. The request thus
takes place in the same way as above, although with a different ID for the device:
Interest has been expressed here in all 4 values, and according to the master data the following was read at 9:05:
• Energy (readingValueIndex1): 1.9378E7 Wh
• Volume (readingValueIndex2): 1546.838 m³
• Flow temperature (readingValueIndex3): 61.3°C
• Return flow temperature (readingValueIndex4): 42.4°C
10.1.9 Read the latest value for one or more sensors across meters connected to the ECL controller
Reading of the latest value across meters/devices takes place according to exactly the same principle as for one single device. The difference
in the request is that you enter * instead of a specific externalDeviceId. There will still be just one request and one response from the server.
The difference in the response message is that you will receive not just one reading, but instead one reading per device, which in our
example will mean 6 readings (3 x M-bus, 2 x ECL log and 1 configurable input) in same message.
10.1.10 Read a period of historical data for one or more sensors on one meter connected to the ECL controller
Just as when reading the last reading, the readings in this case also include values for all channels/sensors on the meter, if several
channels are available. But when reading data for a given period, it will not be possible to request across devices on the ECL controller,
but always only one log device at a time.
It is the same method being called, but with several arguments, and you may have to call the method several times in order to “cover” the
desired period (depending on page size, log frequency and the length of the period).
Our starting point is that we want to retrieve all data for the main water meter. There is, cf. the master data, a configurable input module
(of the pulse type with externalDeviceId = 77df9535-9333-4222-b0a5-b5d6d08da1b3), that has only 1 channel, where pulses are measures
converted into m3. We can also see from the master data that the latest data is from 2013-04-29T09:06:00.0Z, and that it was first sensed
by the portal at 2013-03-22T06:59:33.0Z. In this example we assume that a page size of 500 is most suitable for the third party client.
Data extracted through the ECL Portal and the download in, for example, Excel format will be scaled to have only one decimal place, but
data extracted through the ECL Portal API can contain a number of decimals depending on the raw data contained in the database.
Example of data download via the ECL Portal:
The same data downloaded via the web API:
Also note that the header for the data is different, cf. section 7.2.2 Master data.
This symbol on the product indicates that it may not be disposed of as household waste.
It must be handed over to the applicable take-back scheme for the recycling of electrical and electronic equipment.
• Dispose of the product through channels provided for this purpose.
• Comply with all local and currently applicable laws and regulations.