Our eMon Energy Monitor measures electricity use of a house, business, hotel or even a factory. While it’s internal webserver provides sophisticated graphs, you will get much better graphs, features and dashboards when the device uploads the data to a time-series server. The best one we know of is a combination of InfluxDB and Grafana.

In this article I will guide you through a very quick and easy way, with lots of pictures, to install a InfluxDB & Grafana server and to configure the eMon Energy Monitor to upload data to this server.

This is meant to gently introduce you to setting up a cloud server. I know “cloud server” sounds techie, but it really not more complicated than ordering a book from Amazon.

Google has a great deal for first time Google Cloud users. $300 credit valid for 12 months. This installation will in no way go over that $300 in 12 months. Delete the server before the 12 months are over, or consider continuing it.

Step 1. Create a Google Cloud Account.

In any browser go to https://cloud.google.com/free/

Free Google Cloud Platform

Click on Get Started for free

Yes, you need a Google email account. Either use that old throwaway email address or create a new one. After login you will see this:

Free Google Cloud Platform


You will need a Credit Card. There is no way around it. Google will not charge you anything unless the 12 months are over, or somehow you spend all that $300 credit. I have used CCs from TransferWise, BCA and Mandiri without issues. I know Revolut will not be accepted.

Free Google Cloud Platform


Voila. You have created a Google Cloud Account, received $300 credit and are ready to deploy your InfluxDB/Grafana server.

Free Google Cloud Platform

Step 2. Create a Project.

All GCP requests from this time on will be under a project, so we really need to create one in order to proceed.

Free Google Cloud Platform

Give your project a name. The Billing Account with that $300 credit is automatically selected. Organization and Location usually are not asked for.

Click on CREATE

Step 3. Create a Server with InfluxDB and Grafana

1.Click on three horizontal bars (menu bars) left of Google Cloud Platform
2.Menu opens up and click on “Compute Engine”

Free Google Cloud Platform


After that it will take a few minutes for you will get this (some browsers will ask if you want to refresh, if so: yes)

Free Google Cloud Platform

Click on Create

Free Google Cloud Platform


1.Enter a name
2.Click on “Machine type” and choose “g1-small”
2.Click on “Boot disk” and choose “Container-Optimized OS 78-xxxx”. See image below

Free Google Cloud Platform


Select and then click on Create

After a few minutes your server is created and ready. You will see the next image.

Free Google Cloud Platform

Click on SSH

Step 3. Install InfluxDB and Grafana

The image below will open up.

Free Google Cloud Platform

Seeing this window open, you may think “Whoa, this starts looking way too techie for me”. Rest assured, you will only need to do 3 copy/paste ENTERs.

Copy the each of the three lines below, separately, paste ( Windows: Ctrl + V - MacOS: Cmd + V) into that “techie” Window and press your keyboard ENTER key.

1.Get the stack:

git clone https://github.com/emonindonesia/docker-influxdb-grafana && cd docker-influxdb-grafana

2.Install docker-compose:

docker run docker/compose:1.24.0 version

3.Run the stack:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$PWD:$PWD" -w="$PWD" docker/compose:1.24.0 up -d


Free Google Cloud Platform

Done with installing InfluxDB/Grafana. You can close that window.

Step 4. Opening up the server Firewall

Right now your server is locked up tighter than Dick’s hatband. Nothing can go in or out.

We need to open two ports.

Free Google Cloud Platform


1.Click on three horizontal bars (menu bars) left of Google Cloud Platform
2.Menu opens up. Scroll down and click on “VPC network”, then on “Firewall rules”

Free Google Cloud Platform


Click on CREATE FIREWALL RULE

Free Google Cloud Platform

1.Enter a name
2.Choose “All instances in the network”
3.Type: 0.0.0.0/0
4.Type: 8086, 3000

Click on Create

This concludes the Server installation.



Step 5. Configuring eMon Energy Monitor

Open the webpage of your eMon Energy Monitor. Unless you changed the name of the device, type emon.local in your browser.

Free Google Cloud Platform

Click on “Setup” and “Web Server”

Free Google Cloud Platform

Click on “InfluxDB”

Before we continue, you need to get the IP address of your new server. In the image below it is 35.185.191.164 Your of course will be different. Write this number down.

Free Google Cloud Platform

Go back to the eMon Energy webpage

Free Google Cloud Platform


1.Enter the IP address of your server that you wrote down.
2.Type: emon
3.Click on “add” to tell the device what data to send to your server.

Free Google Cloud Platform

1.Give this data a name. Usually you leave the Units below set to “Watts”.
2.Hover the mouse over on “input”. Your “Inputs” will be presented. Choose a channel your want data for in your new server.

Click on save

Keep adding channels your want to send to your server.

You may have noticed the “calculator” layout. It is actually a calculator. For example your can sum several channels by clicking on the plus between input selection.

Free Google Cloud Platform

When you have added all you want to, click on save

Free Google Cloud Platform


Finish with save

Free Google Cloud Platform

On device “Status”, click on the grey InfluxDB box and you will see this.

Now go to your new Grafana server by entering it’s IP address in your Browser and adding :3000 e.g. 35.185.191.164:3000

Free Google Cloud Platform

A sample Dashboard called Demo is pre-installed. Click on it to get started building your own dashboards. User/Password = admin/admin . You will be asked to change.

Please have a look at Grafana’s documentation for detailed instructions. https://grafana.com/docs/guides/getting_started/#dashboards-panels-the-building-blocks-of-grafana

Final note on security

While Grafana is secured in this quick & easy install , InfluxDB is not. For simplicity this installation omitted InfluxDB username and password. To secure InfluxDB: 1. Create a Github account. Clone https://github.com/emonindonesia/docker-influxdb-grafana to your own Account. Rename your respository 2. Edit the env.influxdb file by removing all # and change the password to your own Git.

# INFLUXDB_HTTP_AUTH_ENABLED=true
# INFLUXDB_ADMIN_USER=admin
# INFLUXDB_ADMIN_PASSWORD=5up3down6left
INFLUXDB_DB=emon

Save. Stop your server by:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$PWD:$PWD" -w="$PWD" docker/compose:1.24.0 stop

Remove all containers

docker system prune

Start again with Step 3., but now replace my Git with your own.

git clone https://github.com/YOUR_OWN && cd YOUR_OWN

In Grafana you will need to add your username and password to the InfluxDB Datasource, same for the configuration in the eMon Energy device.