Energy meter metrics extraction
When the Romande-Energie Group connected my house to their power-grid last year, they installed a “smart” residential credit-meter before my switchboard. As I also produce electricity with my solar-panels, they installed a digital one, that is able to measure both the energy that I consume and the one that I produce.
Those meters are called smart because they’re kind of IOT appliances that can be remotely queried at some point. The model that I own is a Landis+Gyr E230.
The device has an optical interface (infrared) in it front-panel that can be used as a serial port. I was too lazy to build the probe myself so I bought it on ebay for ~20$ but if you have some spare-time have a look at this website: http://wiki.volkszaehler.org/hardware/controllers/ir-schreib-lesekopf . I connected the probe to one of my machines (Raspberry PI-like).
The second part of the project was to be able to ask the device to export its metrics. I was lucky enough to find some pyhton code written by Joost Baltissen (thanks man you saved me precious time figuring this out) and I tweaked it a bit to fit my need and pushed it on Github: https://github.com/xens/smartmeter.
The work-flow is the following: The program querries the smart-meter at a given time interval (here every 30 seconds) and then sends the metrics to a TSDB (InfluxDB here).
Here’s some screenshots of the graphs that I made using Grafana.
To finish, what’s kindof scary as you can see in the code is that the communication with the device is bi-directional, we send a certain string to the device and it answers with some data. I hope that those devices are sufficiently hardened and audited as they often can be queried from outside the buildings in Switzerland … TBC.