Knowledge/Integration/Grafana

GuideM-Center

Meter data from the M-Center in Grafana

Grafana displays data but does not collect it itself. The chain Telegraf, InfluxDB and Grafana has proven itself: Telegraf fetches the values from the EMU M-Center, InfluxDB stores them, Grafana displays them.

What you need

  • An M-Center with Modbus TCP server licence (210.300.04) or MQTT licence (210.300.03).
  • Telegraf, InfluxDB and Grafana, for example on a server in the same network.
  • OBIS codes entered in the M-Center and the device addresses of the meters.

Step 1: Telegraf reads via Modbus TCP

Telegraf has a Modbus input plugin. For each meter you create a block with its device address. The example reads import and export of an electricity meter with device address 9:

[[inputs.modbus]]
  name = "m_center"
  controller = "tcp://192.168.1.50:502"
  slave_id = 9
  timeout = "5s"
  interval = "15m"
  holding_registers = [
    { name = "import_total",     byte_order = "ABCD", data_type = "FLOAT32-IEEE", scale = 1.0, address = [999, 1000] },
    { name = "export_total", byte_order = "ABCD", data_type = "FLOAT32-IEEE", scale = 1.0, address = [1149, 1150] },
  ]
  [inputs.modbus.tags]
    meter = "apartment_1"

Telegraf counts addresses from 0, the manual from 1: register 1000 becomes 999. Byte order ABCD corresponds to big endian with the high word first, as delivered by the M-Center. The notation of the options changes between Telegraf versions; the plugin documentation of your version applies.

Alternative: Telegraf reads via MQTT

With the MQTT licence, Telegraf subscribes to the M-Center’s topics with the plugin inputs.mqtt_consumer:

<prefix>/emu/mcenter/<MAC>/meterreading/+/byobis/#

How Telegraf evaluates the messages is set with data_format. So look at the content of the messages with an MQTT client first.

Step 2: InfluxDB and Grafana

  1. In Telegraf, set the output to InfluxDB (outputs.influxdb_v2 with URL, token, organisation and bucket).
  2. In Grafana, add InfluxDB as a data source.
  3. Create a panel and query the reading. For consumption per day or month, take the difference of the meter reading over the time window.

Meter readings only rise. A bar chart with consumption per day is therefore usually more meaningful than the curve of the meter reading.

Frequently asked questions


Why not connect Grafana directly to the M-Center?

Grafana is a visualisation tool. It needs a database to read from. Telegraf and InfluxDB take care of querying and storage.

How often should Telegraf query?

As often as the M-Center reads, every 15 minutes by default. More frequent queries do not deliver newer values.

Is there a ready-made solution without your own server?

Yes. The M-Center transmits its data encrypted to Joulio-Web, our energy management software.

Read more


SEITEM-Bus to Modbus TCPRegister map SEITEM-Center with Node-REDGuide SEITEJoulio-WebProduct SEITEMore integrationsOverview

Questions about the integration?


Send us your meter list. We will help with addresses, OBIS codes and licences.

Phone
+41 (0)41 545 03 00

Technical support
helpdesk [at] emuag.ch
Support form →