Http binding problem with color channel UNDEF

Hi there,

I have recently started to connect my existing home automation hardware to OH3.
I am using the latest version of OH from openhab.org on a Linux PC. HTTP binding and JSONPATH installed.
My hardware provides a HTTP server and can be controlled using a REST API and JSON. I got it managed that roller shutters and simple switches are already working, however I got stuck with full-color lights: My HTTP server returns two objects for a full-color LED stripe:

{
    "RGB1_1": {
        "value": "32767",
        "level": 0,
        "type": "FB Switch",
        "age": 1
    },
    "RGB1_1_COL": {
         "value": "36,100,50",
         "level": 0,
         "type": "Color",
         "age": 2
    }
}

I used the following configuration for the HTTP binding to create a “Testroom” thing:

UID: http:url:2714827e25
label: Testroom
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: http://192.168.1.43/signal/
  refresh: 1
  commandMethod: PUT
  contentType: application/json
  timeout: 3000
  bufferSize: 8192
channels:
  - id: RGB1_1
    channelTypeUID: http:switch
    label: "LED Stripe On/Off"
    description: null
    configuration:
      onValue: "32767"
      offValue: "0"
      stateTransformation: JSONPATH:$.RGB1_1.value
      commandExtension: RGB1_1
  - id: RGB1_1_COL
    channelTypeUID: http:color
    label: "LED Stripe Color"
    description: null
    configuration:
      mode: READWRITE
      colorMode: HSB
      stateTransformation: JSONPATH:$.RGB1_1_COL.value
      commandExtension: RGB1_1_COL

I’ve used the graphical UI to connect the two channels to items: a switch and a color item. The switch item works fine, however the color item already shows up in the overview with UNDEF data. Setting a color using HABPanel works (i.e. the right PUT request with valid data is fired), but the color picker will be reset to “black” as soon as a new color was entered.
The log doesn’t output any errors.

Any thoughts on what I’ve missed / did wrong?

Karsten

Hey,

I’ve had a similar problem for a little while now and have narrowed it down to the way RGB colors are parsed. I believe to have fixed the issue with this pull request. This problem should’ve only occured with colorMode set to RGB though and in your given config it’s set to HSB, so if you always had it set to HSB this is likely not the problem you were facing. Still, if you want to try it, you can get my fixed http addon compiled for 3.1.0.M5 here.

I hope this helps.

Mirco