last updated: 2021-10-10 (created 2017-08-16)
The SmartyReader® gets the data from P1 interface and sends it to your network per WiFi or Ethernet. You can also use LoRa or LoRaWAN.
As the SmartyReader family grows :). Here the different links:
The Original using a WEMOS/LOLIN D1 mini pro (ESP8266) and communicating via MQTT over WiFi. It is also possible to use an ESP32.
A Teensy 3.6 is used (6 Uarts!!) to read and publish up to 6 smartmeter over MQTT. It is connected via Ethernet to your network (WiFi possible!).
The consumption or production can be read on the blinking LED of the smartmeter. A tandem Teensy 2.0 - WEMOS/LOLIN D1 mini pro (ESP8266) gets the data and publishes over MQTT via WiFi.
Because of the EU Energy Efficiency Directive from 2012 the gas and electricity Distribution System Operators (DSO) in Luxembourg replaced there gas and energy meters with smartmeters (named smarty :(). Besides gas and electricity metering, the system is open for other metering data like water and district heat (M-Bus).
The French group Sagemcom delivered the smartmeters. The model is the T210-D. All meters have to be read by one national central system, operated by a common operator. This is an economic group of interest (G.I.E.) of the 7 Luxembourgian gas and electricity DSO‘s named Luxmetering G.I.E.
Luxmetering is getting the data from 4 registers for active, reactive, import and export energy (1/4h) and the 3 registers for gas, water & heat (1 h) over Power Line Communication (PLC). The smartmeters have also alarms and logs for quality of electrical energy supply (voltage, outages,...) and fraud detection, and calendar functions for the 2 external relays (home applications).
The customer wants to get his data and this is possible by reading the blinking LED of the smartmeter. This can be done quite easily by using e.g. the IoT-board.
A better possibility is the 10 second data from the smartmeter P1 port (RJ12 connector under the green lid). The P1 data output communication protocol and format is specified in the Dutch Smart Meter Requirements v5.0.2 . The solution deployed in Luxembourg includes an additional security layer standard that is conform to the IDIS package 2.0 requirement. The encryption layer is based on DLMS security suite 0 algorithm: AES128-GCM. More information can be found in this document.
The P1 port connector is a 6 pole RJ12.
We get 5 V (250 mA) on pin 1. Both GNDs (power and data) are connected and reside on pin 6 and 3). Pin 4 is not connected.
To get data, the data request line (pin 2) has to be high. On the new boards it is connected to pin 1 (5 V) so the smarty is sending every 10 s.
Data pin 5 sends an inverted serial signal (EIA232) with 8N1
. This line is open collector! so we need a resistor to 3.3 V (voltage of the ESP) if we want to see a signal. The signal is inverted in software.
More details in the Dutch Smart Meter Requirements.
As stated the communication on P1 port is encrypted with AES128-GCM (Galois Counter Mode). Each meter has its own 16 byte encryption key. Ask your DSO or Luxmetering for your key.
With the key we need the cypher text, 17 byte Additional Authenticated Data (AAD), a 12 byte Initialization Vector (IV) and a 12 byte GCM Tag.
The AAD is fix: 0x3000112233445566778899AABBCCDDEEFF
. The other data is extracted from the serial stream.
The Initialization Vector (12 byte) consists of the system title (8 byte) and the frame counter (4 byte). The GCM Tag is found at the end of the stream.
The MQTT-protocol is a publisher/subscriber protocol and it is quite simple to implement this protocol on microcontrollers like the LOLIN D1 mini Pro board (ESP8266). The smartmeter data is published by the LOLIN board over Wifi. It is necessary to run a message server (broker) to distribute the data. I use for this mosquitto on a raspberry pi. The LOLIN board publishes the data and the same raspberry pi with the broker or another computer subscribes to the data and generates p. ex. a graphic.
For testing and debugging you can use the cool MQTT.FX software. It's a JavaFX based MQTT Client based on Eclipse Paho an very comfortable for testing purpose. Downloads on http://www.mqttfx.org.
An alternative software is mqtt-spy.