How do I add power monitoring?

What is the best/cheapest way to add power/energy monitoring to my OpenHAB system? Ideally I need to be able to monitor both power coming in from the grid, and power generated by my Solar PV array, so this implies two current sensors. Ideally I do not want to have to modify the wiring, so a clip-on current sensor would be ideal. Does someone make one of these (preferably cheap) with a Bluetooth or WiFi or Ethernet connection? Or is there a design for the hardware and/or firmware using Raspberry Pi or NodeMCU? I am not presently sure whether I need to be able to measure true power (which implies measuring the current and the voltage multiple times per mains cycle and doing all the multiplying and accumulating to measure the total energy) or whether just current measurement will be good enough. Since the current from the grid will sometimes be negative (because the solar PC is generating more than the house is using), I suspect that I DO need true power. I would then like to be able to view graphs of energy used in the home against time of day and time of year, and the same for solar energy generated. I’m not averse to a bit of hardware design and building, and a bit of firmware development. Any ideas on the best way to approach this would be excellent.

Thanks - Rowan

  • Platform information:
    • Hardware: _Intel X64 processor with 16GB RAM
    • OS: Windows 8.1

The only ones I’m aware of are Zwave.

I also know that a lot of solar power generators have an API that users have successfully integrated with, usually through an HTTP REST API using the HTTP binding.


Which solar inverter do you have? I have a SolarEdge, and it was installed with an external (Modbus) consumption meter (SE240). If your inverter doesn’t support that, then the meter @rlkoshak suggested is the next best option - I have one of them, but never installed it and at this point I’d only put it on my subpanel, since the inverter consumption meter does my whole-house power usage.

Many cheap modbus meters on eBay, it’s a common format.

I would as well suggest looking into your solar controller, if it has inbuilt or optional data service it’s likely to offer much better features.

Thanks for your suggestions. I have a Power One Aurora inverter. It does have some data output on an RS485 port, but as yet I have not been able to decode the data that it sends. This would be another project… I think I will try the Modbus meters first, and see how that goes…

Thanks - Rowan

What do I need to attach this device (or two of them) to OpenHAB and to monitor my power usage, and my solar PV generation, hour by hour? Currently I’m running OpenHAB on my Windows PC. I presumably need an RS485 USB stick. Do I need any other hardware? What software do I need? Something is needed to convert eh RS485/ModBus messages into a form that OpenHAB can use. Presumably this software already exists somewhere… How can I get it? How do I need to configure OpenHAB (I am still pretty much an OpenHAB novice…)?

Thanks - Rowan

I don’t know, what device?!?

But yes, you can use a USB<>RS485 converter to connect a PC to a wired serial Modbus.
If you google around serial modbus, you’ll find it runs over cheap twisted pair cable, for relatively long distances. You can connect several devices together in a daisy chain (or bus). You should pay attention to terminating the bus.

Alternatively, there are Ethernet- or WiFi-to-serial gateways that allow your openHAB host to talk Modbus-TCP over your LAN, and they convert locally to wired RS485 Modbus. More costly but more flexible if yu need to reach an outbuilding or suchlike.

To get openHAB talking Modbus, install the Modbus binding. If you have OH version 2.4 you can use Modbus binding version 2, which I would recommend over older obsolete v1.