OneMeter allows you to easily and non-invasively monitor the energy taken from and returned to the grid. The solution is so simple and versatile that it can be used at home as well as in a small business or industrial facility. Using the OneMeter API you can download all collected energy data to your openHAB installation. In this article, we’ll show you how to easily integrate. Let’s get started!
Outline
- Obtaining your device ID and API key
- Installing the necessary add-ons in openHab
- HTTP Binding
- JSONPath Transformation
- Map Transformation
- Configuration
- HTTP Binding
- Item
- SiteMap
1. Obtaining your device ID and API key
- <DEVICE_ID> You can find the device ID at the bottom of your OneMeter device preview page on the [OneMeter Cloud] (https://cloud.onemeter.com/) platform (the UUID row in the Device Details table).
- <API_KEY> Can be found at https://cloud.onemeter.com/#/api. If you do not have access to this section, please contact us and we will promptly give you access to the API.
Below is an example of the address that we will be using to download the relevant values from the OneMeter Cloud: https://cloud.onemeter.com/api/devices/<DEVICE_ID>?key=<API_KEY>
Be sure to remove the symbols <
& >
!
To check if the link we have created is error-free, paste it into your browser. If we have managed to do this step correctly, we should get a result similar to this:

2. Installing the necessary add-ons in openHab
HTTP Binding
With the help of Paper UI, install the HTTP Binding: Add-ons > BINDINGS > HTTP Binding > INSTALL

With the help of Paper UI, install the JSONPath and Map Transformation: Add-ons > TRANSFORMATIONS > JSONPath Transformation/ Map Transformation > INSTALL

Configuration
Create the following files (or modify, if they already exist) with the content as shown below:
/etc/openhab2/services/http.cfg
onemeter.url=https://cloud.onemeter.com/api/devices/<DEVICE_ID>{Authorization=<API_KEY>}
onemeter.updateInterval=900000
Be sure to remove the symbols <
& >
!
/etc/openhab2/items/onemeter.items
Number onemeter_kwh "OneMeter kWh [%f]" <kwh> { http="<[onemeter:900000:JSONPATH($.lastReading.OBIS['15_8_0'])]" }
Number onemeter_voltage "OneMeter Battery Voltage [%f]" <voltage> { http="<[onemeter:900000:JSONPATH($.lastReading.OBIS['S_1_1_2'])]" }
DateTime onemeter_timestamp "OneMeter Last Readout [%t]" <timestamp> { http="<[onemeter:900000:JSONPATH($.lastReading.OBIS['S_1_1_4'])]" }
Number onemeter_this_month "OneMeter Current Consumption [%f]" <this_month> { http="<[onemeter:900000:JSONPATH($.usage['thisMonth'])]" }
Number onemeter_previous_month "OneMeter Previous Consumption [%f]" <previous_month> { http="<[onemeter:900000:JSONPATH($.usage['previousMonth'])]" }
String onemeter_firmware "OneMeter Firmware Version [%s]" <firmware> { http="<[onemeter:900000:JSONPATH($.firmware.['currentVersion'])]" }
sitemap onemeter label="OneMeter" {
Frame label="OneMeter" {
Text item=onemeter_kwh
Text item=onemeter_voltage
Text item=onemeter_timestamp
Text item=onemeter_this_month
Text item=onemeter_previous_month
Text item=onemeter_firmware
}
}
That’s it! If you got here, you managed to integrate OneMeter into openHAB.
If you have any problems, questions or suggestions, please contact us via our contact form - we will be happy to help!