Hildebrand / Glow Wired CAD MQTT Data Processing


I have a Consumer Access Device (CAD) from Glow to enable access to near-real-time (10 second granularity) readings from the SMETS2 smart electricity meter. This is one of the few CAD options which can be easily configured to send MQTT messages to a local MQTT server, rather than always sending all the data out to the ‘Cloud’ (although it does that too, for access from the Bright app).

MQTT is convenient for me since that that’s where (almost) all the near-real-time data gets presented, whatever the source, for onward processing, storage and graphing. (Storage is in the InfluxDB time-series database and graphing is via Grafana.) All the other readings (temperature and humidity, water and heat meter readings etc.) are slower-moving and typically sampled every couple of minutes whereas the live power consumption readings from the electricity meter are much faster-moving and probably deserve some more intelligent treatment, such as down-sampling for longer-term storage, so they warrant being separated out from the others, into their own InfluxDB database.

When adding the readings from the Glowmarkt CAD into the existing MQTT / InfluxDB / Grafana data pipeline it seemed sensible to separate them out from the other MQTT-derived readings. It’s Telegraf that provides the ‘glue’ between MQTT and InfluxDB and since MQTT is the integration point for lots of different types of readings, from lots of different sources, the single InfluxDB database which currently gets all the readings from all the sensors is quite “busy” already.

Content of the Glow CAD MQTT Messages

The MQTT messages consist of JSON payloads and look like this:

        "supplier":"Octopus Energy",



There’s a post on the Glowmarkt Forum relating to storing these in InfluxDB that basically says to declare the data_format as “json” and leave Telegraf / InfluxDB / Grafana to sort everything else out. While that does work, what’s happening under the covers is that the whole JSON text string is getting stored in InfluxDB (for every data point) – rather than just a simple numeric value – which places a lot of load on downstream processing tools (such as Grafana) to parse the JSON strings and extract the data. Sometimes Grafana shows ‘No Data’ when it’s still trying to process the JSON.

The fix is to process the JSON up-front then re-publish just the key values to discrete MQTT Topics, for easier processing by other data consumers. Sorting this out is on my TODO list…





CC BY-SA 4.0 Hildebrand / Glow Wired CAD MQTT Data Processing by Marsh Flatts Farm Self Build Diary is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.