For systems that fetch consumption and cost time-series data from Metry, it is common that the meters in Metry need to be mapped to the system's objects such as meter points, buildings or premises. This is often needed to be able to visualise or report consumption and costs for a building.
Some systems solve this by importing everything from Metry and then provide a graphical user interface for the end user to connect the metering points from Metry to the correct building using data Metry has about the meter. Use the _id property on the meter or tree node when saving a reference to the meter in your system. This identifier is available when receiving data via streams or exports and is used when fetching consumption directly from the consumption API.
When fetching meters from Metry's API, the following properties on each meter can be useful for the mapping:
- ean: A metering points identifier used by external sources from which Metry is getting data. For meters set up by utility providers, it may be referred to using different names depending on the country. Some examples are "EAN", "MPAN", "MPRN", "Anläggnings-ID", and "Målepunkt-ID".
- active_box_tree_paths: A structured description as nested arrays for where the meter is located in the tree structure defined by the user in Metry including the names of tree nodes.
- name: A free text field where the user can specify a name.
- tags: Free text values set by the user.
- address: A description of the meters geographical position. This is often the street address. The format of the address may differ as it is collected from the utility provider or set by the user.
- type: The type of utility measured at this metering point such as "heat", "electricity", "water", etc.
Another method is to require the user to specify an identifier in Metry. It is common to use tags for this or the tree node name. This can be more difficult as the user needs to be aware of performing this step as meters are continuously added in Metry. Also, when importing the data from streams, the importing system may not be able to understand how to map the meters to its own structure because the identifier required to be set on the meter or tree node is missing so the import must either stop and resume when this is done, drop the streaming data or store the streaming data somewhere else and map it later.