# NOOB http configuration not discovering device

**URL:** <https://community.openhab.org/t/noob-http-configuration-not-discovering-device/127047>\
**Category:** Beginners\
**Tags:** httpbinding1\
**Created:** [October 1, 2021, 1:31am UTC](https://community.openhab.org/t/noob-http-configuration-not-discovering-device/127047 "2021-10-01T01:31:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AixNPanes](https://community.openhab.org/user_avatar/community.openhab.org/aixnpanes/32/81359_2.png) [@AixNPanes](https://community.openhab.org/u/AixNPanes)\
**Post date:** [October 1, 2021, 1:31am UTC](https://community.openhab.org/t/noob-http-configuration-not-discovering-device/127047/1 "2021-10-01T01:31:16Z")

</div>

- Platform information:
  - Hardware: RaspberryPI 3B+/1GB Mem/32GB disk
  - OS: Raspbian GNU/Linux 10 (buster)
  - Java Runtime Environment:OpenJDK Runtime Environment (build 11.0.12+7-post-Raspbian-2deb10u1)
  - openHAB version: openHAB 3.1.0 Release

- Issue of the topic: HTTP configuration not finding item
- Please post configurations (if applicable):

```auto
UID: http:url:85fb01a1b2
label: HTTP URL Thing
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: true
  headers:
    - bus=1
    - addr=0x76
  baseURL: http://hastings2:5000/i2c/thermometer/bme280
  delay: 0
  stateMethod: GET
  refresh: 30
  commandMethod: GET
  stateTransformation: JSONPATH:$.bme280.thermometer
  contentType: application/json
  timeout: 3456
  bufferSize: 4096

```

- Items configuration related to the issue
- Sitemap configuration related to the issue
- Rules code related to the issue
- Services configuration related to the issue
- If logs where generated please post these here using code fences:

I have BME280 device on the same host as the openHAB server. The url is [http://hastings2:5000/i2c/thermometer/bme280?addr=0x76&bus=1](http://hastings2:5000/i2c/thermometer/bme280?addr=0x76&bus=1)  
which returns:  
{“bme280”:“{"hostname": "hastings2", "ip": "127.0.0.1", "mac": "b8:27:eb:c1:f2:4d", "bus": 1, "address": 118, "chip\_id": 96, "chip\_version": 0, "temperature": 23.92, "temperature\_scale": "C", "pressure": 1016.7327165724124, "pressure\_scale": "hPa", "humidity": 44.896159593430646, "humidity\_scale": "%", "expiry": "2021-09-30T21:25:45.246724-04:00", "time": "2021-09-30T21:25:44.246724-04:00"}”}  
in the browser. I haven’t done an item config. I’m not sure what it should look like. I’ve turned on debug for as much as I see that might be reasonable:

```auto
openhab> log:list
Logger │ Level
───────────────────────────────────────────────────┼──────
ROOT │ INFO
javax.jmdns │ ERROR
javax.mail │ ERROR
org.apache.karaf.jaas.modules.audit │ INFO
org.apache.karaf.kar.internal.KarServiceImpl │ ERROR
org.apache.karaf.shell.ssh.SshUtils │ ERROR
org.apache.karaf.shell.support │ OFF
org.apache.sshd │ WARN
org.eclipse.lsp4j │ OFF
org.eclipse.smarthome │ INFO
org.jupnp │ ERROR
org.openhab │ DEBUG
org.openhab.ui.paper │ DEBUG
org.openhab.ui.paper.internal │ DEBUG
org.ops4j.pax.url.mvn.internal.AetherBasedResolver │ ERROR
org.ops4j.pax.web.pax-web-runtime │ OFF
smarthome.event │ DEBUG
smarthome.event.InboxUpdateEvent │ DEBUG
smarthome.event.InboxUpdatedEvent │ DEBUG
smarthome.event.ItemAddedEvent │ DEBUG
smarthome.event.ItemRemoveEvent │ DEBUG
smarthome.event.ItemRemovedEvent │ DEBUG
smarthome.event.ItemStateEvent │ DEBUG
smarthome.event.ThingAddedEvent │ DEBUG
smarthome.event.ThingRemovedEvent │ DEBUG
smarthome.event.ThingStatusInfoEvent │ DEBUG
openhab>

```

I don’t get anything in the logs that indicates anything to do with the HTTP binding.

---

<div class="post-metadata">

**Author:** ![JustinG](https://community.openhab.org/user_avatar/community.openhab.org/justing/32/55948_2.png) [@JustinG](https://community.openhab.org/u/JustinG)\
**Post date:** [October 1, 2021, 2:21am UTC](https://community.openhab.org/t/noob-http-configuration-not-discovering-device/127047/2 "2021-10-01T02:21:05Z")

</div>

1. For http things, after you configure the thing, you also have to configure channels manually. From the item config you’ve posted, it doesn’t look like you have any channels configured yet. Click on the channel tab on the thing page and then click `Add Channel`
2. It looks like your jsonPath and the json payload you’ve posted don’t match:

> [@AixNPanes](#):
>
> JSONPATH:$. **bme280**. **thermometer**

> [@AixNPanes](#):
>
> {“ **bme280** ”:“{“hostname”: “hastings2”, “ip”: “127.0.0.1”, “mac”: “b8:27:eb:c1:f2:4d”, “bus”: 1, “address”: 118, “chip\_id”: 96, “chip\_version”: 0, “ **temperature** ”: 23.92, “temperature\_scale”: “C”, “pressure”: 1016.7327165724124, “pressure\_scale”: “hPa”, “humidity”: 44.896159593430646, “humidity\_scale”: “%”, “expiry”: “2021-09-30T21:25:45.246724-04:00”, “time”: “2021-09-30T21:25:44.246724-04:00”}”}

---

<div class="post-metadata">

**Author:** ![ubeaut](https://community.openhab.org/user_avatar/community.openhab.org/ubeaut/32/119014_2.png) [@ubeaut](https://community.openhab.org/u/ubeaut)\
**Post date:** [October 1, 2021, 2:50am UTC](https://community.openhab.org/t/noob-http-configuration-not-discovering-device/127047/3 "2021-10-01T02:50:46Z")

</div>

Do you have the JSONPath transform installed?

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/6/3/63611081c2866d593331d2b4340078a7f499f503.png)

It’s under settings\>\>transformatons.

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [October 1, 2021, 1:04pm UTC](https://community.openhab.org/t/noob-http-configuration-not-discovering-device/127047/4 "2021-10-01T13:04:29Z")

</div>

Comment: start simple. Make a temporary string channel, link it a string Item, no transformations and see that you get the expected message.  
When that is working, start on the JSONPATH stuff.

---

<div class="post-metadata">

**Author:** ![AixNPanes](https://community.openhab.org/user_avatar/community.openhab.org/aixnpanes/32/81359_2.png) [@AixNPanes](https://community.openhab.org/u/AixNPanes)\
**Post date:** [October 1, 2021, 8:13pm UTC](https://community.openhab.org/t/noob-http-configuration-not-discovering-device/127047/5 "2021-10-01T20:13:25Z")

</div>

Duh! I thought I had put the channel definition in, but obviously it’s not there. Adding the channel def at least caused data to start flowing in the logs. Here’s the new definition:

```auto
UID: http:url:85fb01a1b2
label: HTTP URL Thing
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: http://hastings2:5000/i2c/thermometer/bme280?bus=1&addr=0x76
  delay: 0
  stateMethod: GET
  refresh: 30
  commandMethod: GET
  contentType: application/json
  timeout: 3456
  bufferSize: 4096
channels:
  - id: Temperature
    channelTypeUID: http:string
    label: Temperature
    description: ""
    configuration: {}

```

I defined an item in the UI as follows:

```auto
Name: HTTPURLThing
Label: HTTP URL Thing
Type: Number:Temperature
Category:
Semantic Class: Equipment

```

There is also an item:

```auto
HTTPRULThing_Temperature
Direct Parent Groups: HTTPURLThing
Channel Links: HTTP URL THING/Temperature/http:url:85fb01a1b2:Temperature

```

When I click on the channel link I get Temperature/HTTP URL Thing with 2 channels listed, the first is a Temperature channel listed as ONLINE, the second is:  
Temperature/String/HTTPURLThing\_Temperature  
I’ve set the profile to JSONPath, the JSONPath Expression to $.bme280.temperature and the State Formatter to %.1f °C.

The resultant log entry is  
16:11:21.941 [WARN] [rofiles.JSonPathTransformationProfile] - Could not transform state '{“bme280”:“{"hostname": "hastings2", "ip": "127.0.0.1", "mac": "b8:27:eb:c1:f2:4d", "bus": 1, "address": 118, "chip\_id": 96, "chip\_version": 0, "temperature": 24.11, "temperature\_scale": "C", "pressure": 1016.7128832107587, "pressure\_scale": "hPa", "humidity": 46.7051686445871, "humidity\_scale": "%", "expiry": "2021-10-01T16:11:22.931260-04:00", "time": "2021-10-01T16:11:21.931260-04:00"}”}  
’ with function ‘$.bme280.temperature’ and format ‘%.1f °C’

If i leave the State Formatter empty, I get the same with:

’ with function ‘$.bme280.temperature’ and format ‘%s’

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [October 1, 2021, 9:26pm UTC](https://community.openhab.org/t/noob-http-configuration-not-discovering-device/127047/6 "2021-10-01T21:26:46Z")

</div>

> [@AixNPanes](#):
>
> [WARN] [rofiles.JSonPathTransformationProfile]

There is a small bug with transformation profiles

> <https://github.com/openhab/openhab-core/issues/2037>
>
> I'm using openHAB 3.0 with docker on a linux host system.
> 
> My use case is an a…larm indicating that the humidity in my bathroom is over a certain upper value. When this happens the bathroom fan is turned on to bring the humidity down. The fan should stay on until the humidity drops below a certain lower value.
> 
> For this I configured a switch item carrying the alarm value and linked it to the humidity sensor with a channel configured for the hysteresis profile.
> 
> The expected outcome should be a switch item handling the alarm value with the hysteresis in place. The current outcome is that the item goes into an error state.
> 
> The item configuration is:
> 
> !\[image\](https://user-images.githubusercontent.com/4890418/103382284-c3a56380-4aee-11eb-85e4-2275a2a95f19.png)
> 
> The channel link configuration is:
> 
> !\[image\](https://user-images.githubusercontent.com/4890418/103382325-ef284e00-4aee-11eb-9825-12a0d80d3404.png)
> 
> As you can see in the screen shots, the state is "Err". The probable cause might be the following log entry:
> 
> \`\`\`
> 2020-12-30 00:41:22.012 \[WARN \] \[e.internal.SseItemStatesEventBuilder\] - Exception while formatting value 'OFF' of item Badezimmer\_Sicherheit\_Feuchtigkeitsalarm with format '%.0f': f != java.lang.String
> \`\`\`

but you don’t need to use any profile at all, HTTP binding allows you to do transformation in the channel settings.  
See `stateTransformation`

> **[HTTP - Bindings](https://www.openhab.org/addons/bindings/http/#channels)**
>
> This binding allows using HTTP to bring external data into openHAB or execute HTTP requests on commands.
