OneMeter integration to OpenHAB

Hello all,

I have bought and installed OneMeter device to measure my electricity consumption. It is working fine with its own Android phone application e.g. reading information and sync with OneMeter cloud.

There is description how to connected it to OpenHAB. It is using HTTP, JSONPath and MAP Transformation binding. I did what was requested (like adding DEVICE_ID and API_KEY, both are correct), but all values in OH are NULL

/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'])]" }
/etc/openahb2/transform/onemeter.sitemap
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
  }
}

I am not sure about transformation itself, naming convention of files and their location.

Is anyone able to see any error in that configuration?

Thanks

Jan K.

Talked to OneMeter support, after few iterations, solution has been found:

  1. install integrations as mentioned
  2. then create HTTP thing with this code:
UID: http:url:xxxxxx
label: OneMeter
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: true
  baseURL: https://cloud.onemeter.com/api/devices/xxxxx?key=xxxxx
  delay: 0
  stateMethod: GET
  refresh: 30
  commandMethod: GET
  contentType: application/json
  timeout: 6000
  bufferSize: 2048
channels:
  - id: firmware
    channelTypeUID: http:string
    label: firmware
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.firmware.['currentVersion']
  - id: battery_voltage
    channelTypeUID: http:number
    label: battery_voltage
    description: null
    configuration:
      stateTransformation: JSONPATH:$.lastReading.OBIS['S_1_1_2']
  - id: timestamp
    channelTypeUID: http:datetime
    label: timestamp
    description: null
    configuration:
      stateTransformation: JSONPATH:$.lastReading.OBIS['S_1_1_10']
  - id: this_month
    channelTypeUID: http:number
    label: this_month
    description: null
    configuration:
      stateTransformation: JSONPATH:$.usage['thisMonth']
  - id: previous_month
    channelTypeUID: http:number
    label: previous_month
    description: null
    configuration:
      stateTransformation: JSONPATH:$.usage['previousMonth']
  - id: kwhT1
    channelTypeUID: http:number
    label: kwhT1
    description: null
    configuration:
      stateTransformation: JSONPATH:$.lastReading.OBIS['1_8_1']
  - id: kwhT2
    channelTypeUID: http:number
    label: kwhT2
    description: null
    configuration:
      stateTransformation: JSONPATH:$.lastReading.OBIS['1_8_2']

then create Items as per channels

finito …

Jan K.