Problems with extracting JSON value in OH3

Dear all,

i have OH3 running, HTTP binduing and JSONPATH transform installed.

I have this URL:

It returns:

  "objectIdFieldName" : "OBJECTID", 
  "uniqueIdField" : 
    "name" : "OBJECTID", 
    "isSystemMaintained" : true
  "globalIdFieldName" : "", 
  "geometryType" : "esriGeometryPolygon", 
  "spatialReference" : {
    "wkid" : 4326, 
    "latestWkid" : 4326
  "fields" : [
      "name" : "cases_per_100k", 
      "type" : "esriFieldTypeDouble", 
      "alias" : "Fälle/100.000 EW", 
      "sqlType" : "sqlTypeOther", 
      "domain" : null, 
      "defaultValue" : null
      "name" : "cases7_per_100k", 
      "type" : "esriFieldTypeDouble", 
      "alias" : "Fälle letzte 7 Tage/100.000 EW", 
      "sqlType" : "sqlTypeOther", 
      "domain" : null, 
      "defaultValue" : null
  "features" : [
      "attributes" : {
        "cases_per_100k" : 2119.85035308702, 
        "cases7_per_100k" : 113.120669426427

I would like to extract the value in ‘cases_per_100k’.

I created this thing:

This is the thing code I added:

UID: http:url:66fe49bee5
label: Corona Mettmann
thingTypeUID: http:url
  authMode: BASIC
  ignoreSSLErrors: false
  refresh: 30
  commandMethod: GET
  contentType: application/json
  timeout: 3000
  bufferSize: 2048
  - id: cases7_per_100k
    channelTypeUID: http:number
    label: Inzident pro 100k
    description: null
      stateTransformation: JSONPATH:$.features.attributes.cases7_per_100k

But when I check, the valoue remains empty:

But it shoudl be

Any help appreciated!

Can you copy/paste the JSON into your post, rather than a screenshot? Allows us to quickly test…

I added the JSON, which is returned.



work? Or




Unfortunately no change in the behaviour. The value is always NULL.

Interesting - all three of the examples work for me in openHAB using the JSON you posted in the OP, though I’ve tested them through the MQTT Binding, and therefore MQTT Generic Things, rather than HTTP URL Things. I don’t think that should make a difference though…

Are you aware that the screenshot of the Item you’re showing us is of a Group Item? What Item do you actually have linked to the cases7_per_100k Channel?

This is the config of the channel:

and the linked item:

In the logs, there is a waring, which is related to this topic:

2021-01-16 22:57:45.548 [WARN ] [ttp.internal.http.RefreshingUrlCache] - Creating request for '' failed: c != java.util.Date

Yes, so as I thought: this isn’t about the JSONPATH at all - something’s going wrong requesting the data?

Unfortunately I can’t help further as I have no idea what the error means! @J-N-K might be able to help (sorry for the ping), but please copy/paste the WARN message info your post, rather than a screenshot…

The problem is %2c which the binding tries to use as formatter input. Try replacing that with a ,.

thanks to @hafniumzinc and @J-N-K . Not it works. I’ll adopt a bit and share afterwards here.

have a great day!

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.