Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Emon system tips for absolute beginners?

I Hello, I just found this excellent forum, whilst researching how to install a sub-metering system in my house.
I see a lot of quite advanced advice being shared (seems advanced to me) but can anyone direct me to simpel start-up tips?

I have 3 x DIN-rail Modbus meters that will meter electricity used by 1) electric heating boiler 2) immersion water heater and 3) cooker.

I know in general I have to connect the meters to a Raspberry Pi, and install software on that, and connect via ethernet to my PC.

I have never used a Raspberry Pi, so:

Which system elements do I need other than an Emonpi? Or do I just need the Raspberry Pi?
How to I choose which Rapsberry pi to buy?
How to I put software on it?
How to I connect the wires from the meters to it?

etc… I am sure that when I start I’ll find more things I don’t understand.

NB I am an energy engineer so I understand the energy aspects of this, but I am no good with electronics and wires, so I have to find step by step guidance somewhere.

Many thanks.
Daniel

Welcome, Daniel, to the forum and to OEM.

Phew, what a question! It’s a simple question, the answer is not nearly so simple. In short, there are no simple startup tips, you need to know some electronics, some electrical engineering, some programming, and knowing about energy comes into it too!

“Emon” is an abbreviation for Energy Monitor. The first of these was the emonTx - energy monitor with a radio transmitter. Then came the emonPi, an energy monitor with a Raspberry Pi. That leads me to the second question - on the face of it, if you are using DIN-rail meters, you don’t want an emonPi - because you will have the ‘emon’ part in the meters themselves. Just a Raspberry Pi and an adapter to connect to your meters will serve your needs.

Now comes the tricky bit, I’m not sure where we stand with Modbus. I know there’s software to read a single Modbus meter, but although you can have many slave devices on a Modbus, I don’t know the state of our software to get the data into the RPi.

If you have our RPi software, it (“EmonCMS”) and the RPi’s operating system comes on an SD card. EmonCMS will run on anything from a Model 2B upwards, but drawing big graphs on one of those is slow. You can buy an SD card from our shop, or download the software and flash the SD card yourself. I think you’ll need the specific add-on software to read the Modbus meters. (I’ve recently been very busy with other aspects of the system, so I haven’t kept up with this side - but I know there have been some developments. Somebody else will need to fill in this area for you.)

Modbus is a protocol. Usually, the wiring between the meters will be RS-485, and you’ll need an RS-485 to USB adapter plugged into your RPi to make the connection. Like all bus systems, the wires will start at the controller (which will be the USB adapter), and connect to the first meter, from the first to the second, and from the second to the third. The way the protocol (Modbus) works is the controller asks each meter in turn for its data, and that meter responds. The meters never initiate any action, they only ever answer. The controller of course gets its instructions from the software on the RPi - which meter to ask, what to ask for, and how often, etc.

As far as your PC is concerned, the RPi is a server on your LAN and emonCMS on the RPi looks just like another website, so once you find your way around, that should be reasonably familiar. There are really two parts to emonCMS. There’s emonCMS itself, which handles the input data and the operations you can do on it (like totalling all 3 meters, storing the data in its database, drawing graphs and charts on web pages); and emonHub, which is the interface between the hardware and emonCMS. It’s emonHub that will issue the instructions to drive the Modbus.

If you want to search the forum, the words I’d suggest you start with are Modbus, Mbus (not the same, but does roughly the same job) & RS485.

I also suggest you look through - don’t under any circumstances try to take it all in, just get an idea where the various types of information are to begin with - the ‘Learn’ and ‘Resources’ sections. ‘Learn’ is the basic principles and theory, ‘Resources’ gives detailed technical data principally for the ‘emon’ hardware. I’m not sure that much of this will be relevant to you, but you should know roughly what’s there. Finally, you’ll probably need to look at the ‘Guide’ but much of this concerns setting up hardware that you don’t have - only the descriptions of emonCMS will concern you initially.

Thank you - that’s all VERY useful info, much appreciated.
I did a quick search and found some people on this forum very helpful with Modbus/RS485 so I’ll look into that too.
I’ll digest this all and your tips… many thanks,
Daniel

@DanielKenning, I’ll post how I did it as it can be helpful to know how others did it. But your personal situation may vary.
1 Installing emonCMS on Ubuntu. This was on a laptop, but on a Raspberry Pi it should work the same. Still on my 2DO-list.
2. Reading modbus kWh meters using EmonHub (SDM120 and SDM630) . I don’t know what meters you have, but it will should be similar.
3. Posting Data to Emoncms with MQTT (Python). At the moment no emonhub interfacer exist that will read daisy chained meters, so I decided to look for a self written Python script. Still a work in progress :slight_smile: .

I’m also still trying to figure out how I could do things the best and I already found lots of info on the forums. Hopefully my info is useful on way or another :slight_smile: .

Have a look at this thread.

Here’s a simple script that reads Modbus devices and sends the data to an Influx database via the Python
module requests. (it’s easy to adapt it to send data to whatever data logger one uses)

wn.zip (1001 Bytes)

@Bill.Thomson, thank you for your input. As far as I remember I read through that thread a couple of months ago to help understand modbus kWh meters and adapt it to my personal situation. Personally I think for a newbie that 1-2-3 list (see my last post earlier) are a bit more step-by-step and explain more what is going on. But it’s up to @DanielKenning to decide what works best for him :slight_smile: .

My own script to post data with MQTT seems to work in the meantime, but still “in development” not “in production”.

@DanielKenning, in the meantime I installed it on Raspberry Pi and succeeded. I have updated the link in the quote with some more information.

Thank you - I am just gathering bits. Do you know how to choose which model of Raspberry Pi, or is it just a case of getting the latest one? I think they’re all reasonably cheap.
I’m planning to install it on a DIN rail inside a box with my distribution board, and connect it with RS485 cable, I think that’s the way to do it. i have an RS485-to-USB adapter to plug into the RPi. Eventually there will be a CAT5e cable from the RPi to the nearest network switch, and thus to the PC.

Robert.Wall wrote “EmonCMS will run on anything from a Model 2B upwards, but drawing big graphs on one of those is slow.” I went for “Raspberry Pi 4 Model B”.