New Frontend for Opensource Smartmeter


I never really liked the structure of my piMeter software. The combination of websockets for live data and a database for the historical data was cluttered and prone to error. Added to this i never felt happy with the javascript frontend in which all graphs were hardcoded for visualization.

Time to streamline the software and leave the visualization to people who know about it. Grafana and InfluxDB were the right candidates for this.

Installation of InfluxDB and Grafana

Add the Package Source:

    curl -sL | sudo apt-key add - source 
    /etc/lsb-release echo "deb${DISTRIB_ID,,} 
    ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

Install the database with apt-get and start the service:

    sudo apt-get update && sudo apt-get install influxdb
    sudo service influxdb start

With the command:


you can start the InfluxDB console and add a database for your piMeter


Thats it.

Installing Grafana works the same way.

Add Package Source:

    echo "deb wheezy main" | 
    sudo tee /etc/apt/sources.list.d/grafana.list curl | 
    sudo apt-key add -

Install Grafana with apt-get and start the service:

    sudo apt-get update && sudo apt-get install grafana
    sudo service grafana-server start

You can now Log-In to your installation at www.yourDomain:3000 and build your Dashboard.

Grafana Dashboard


The Old Repository gets cleaned up and will be renamed to piMeter_hardware.
I would like to thank  orca-zhang for the really easy to use InfluxDB-Cpp Lib!

Opensource Raspberry Pi Smartmeter

I was missing the ability of measuring and visualizing power consumption in my Smarthome. For this reason I have developed a Smartmeter / Energymonitor as an extension for the Raspberry Pi which I would like to share for rebuilding / improving / expanding. The piMeter.

The Smartmeter can record the following data on 3 phases:

Current RMS
Voltage RMS
Active power
Apparent power
Reactive power
Accumulated active power
Accumulated apparent power
Accumulated reactive power

All smartmeter data is visualized on a web frontend. It shows consumption data for a given day, month or year. It can also show real-time data of the actual consumption. The real-time data is stored in RAM. It holds 10 minutes of data in a buffer and sends it to the browser if needed. The long time data is stored in a mariaDB on my NAS. Storing this data on the pi directly is not recommended due to high read / write cycles on the sdcard.

The Smartmeter is based on the ADE9000 chip from Analog Devices which communicates over SPI with the Raspberry Pi. For current measurement I use SCT-013-000 Current Transformers from YHDC. They are cheap and can measure currents up to 100A.

Web Frontend

Realtime Data

Smartmeter Board

piMeter Board


Case bottom with Pi Zero
Case bottom with piMeter
Case closed

SCT-013-000 Datasheet
ADE9000 Datasheet
BCM2835 SPI Lib


When working with 230V there is danger to life. The board has no protection against contact. I assume no liability for damage to persons or objects that arise when replicating the meter.

Modbus IP Weather Library


Ich habe auf Github eine kleine c++ Bibliothek veröffentlicht die zur Einbindung von Wetterdaten auf Smarthome Geräten genutzt werden kann.

Der Code holt sich die aktuellen Wetter Informationen von OpenWeatherMap und stellt diese per Modbus IP im Netzwerk zur Verfügung.

Bei mir Zuhause nutze ich die Bibliothek auf einem Raspberry Pi um die Daten auf einem Loytec Display grafisch darstellen zu können. Die Daten können aber auch als Grundlage für eine Bewässerungssteuerung oder zur Berechnung der Vorlauftemperatur für die Heizungsregelung genutzt werden.

Loytec L-Vis