Get temperature json data

I’m trying to extract temperature from JSON output.

my website …sensorCurrent_esp8266.php?sensor=hotwater returns the following JSON output
[{“id”:“28ffdcb564150151”,“name”:“hotwater”,“Temperature”:46.75}]

I am a bit confused about what needs to happen but I have created a items file

Number HOTWATER “Temperature [%.1f C]” (hotwater) { http="<[http://localhost/sensorCurrent_esp8266.php?sensor=hotwater]" }

but openhab is throwing the following error:

  • Binding configuration of type ‘http’ of item ‘HOTWATER’ could not be parsed correctly.
    org.eclipse.smarthome.model.item.BindingConfigParseException: bindingConfig ‘http://localhost/sensorCurrent_esp8266.php?sensor=hotwater’ doesn’t represent a valid in-binding-configuration. A valid configuration is matched by the RegExp ‘(.?)({.})?:(?!//)(\d*):(.*)’

If the output is JSON, you will have to define a transformation, see http://docs.openhab.org/addons/bindings/http1/readme.html#handling-json for details.

Is this why the item is failing to parse.

I was using the example from website, hmmm
Is it possible to use POST with arguments to retrieve data?

You can’t do POST as an input binding.

Which website? The link is from official documentation. Your Item should be like

Number HOTWATER “Temperature [%.1f C]” (hotwater) { http="<[http://localhost/sensorCurrent_esp8266.php?sensor=hotwater:60000:JSONPATH($.[0].Temperature)]" }

and this would result in an item which is updated every 60 seconds.
There is no need for POST at all, as you want to GET a value.

Ok, Thanks, understand a bit more now.

The sensor I’m getting data from requires arguments to be posted, so I assume I have retrieve it another way.

You can do POST and PUT using the HTTP Actions from a rule.