Http Binding-How to debug?

I’m trying to create a ‘Thing’ that retrieves Octopus Agile prices for the next four hour period. I have the base URL, and want to add parameters to set the start date/time. Question: how can I see the combined URL (Base+command) to make sure that it’s correct, and how can I see the returned JSON? Note: the two channels are just me experimenting

UID: http:url:Octopus
label: Agile Thing
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-E/standard-unit-rates/
  delay: 0
  refresh: 30
  commandMethod: GET
  contentType: application/json
  timeout: 3000
  bufferSize: 2048
channels:
  - id: Agile_Count_Number
    channelTypeUID: http:number
    label: Number of items
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.count
      commandExtension: period_from=%1$tY-%1$tm-%1$tdT%1$tH:%1$tM
  - id: PriceIncVat1
    channelTypeUID: http:number
    label: Price1
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.results[7].value_inc_vat
      commandExtension: period_from=%1$tY-%1$tm-%1$tdT%1$tH:%1$tM&page_size=8

I bet the full url is logged out in openhab.log. If you’ve looked there and do not see it, you may need to put the binding into debug level logging.

To see the JSON returned, just link a String Item to the Channel and do not apply any transformations. You’ll see the Item changing state in events.log.

1 Like