HTTP Binding RGB color

Hello,
i am trying to set some light colors using the HTTP Binding.
Using a switch channel and turning the light on and off works fine. For this i am using a url like this:
http://xyz/ew/?ew3=0 and http://xyz/ew/?ew3=1
To set the color i need to send a url like this:
http://xyz/ew/?ew3=1&R=0&G=0&B=255

But i dont know how to set up the channel configuration for this. Currently i do have this:

- id: xyz
    channelTypeUID: http:color
    label: Friseur
    description: ""
    configuration:
      onValue: "1"
      mode: WRITEONLY
      commandTransformation: /ew/?ew3=%2$s
      offValue: "0"

The linked color item is empty (?) … i can not select a color and i am getting this log warning:
[WARN ] [form.CascadedValueTransformationImpl] - Transformation ignore, failed to parse /ew/?ew3=%2$s: The transformation pattern must consist of the type and the pattern separated by a colon

Can someone help me to get the R, G and B in the URL? :slight_smile:

Use

REGEX:s/(.*),(.*),(.*)/\/ew\/?ew3=1&R=$1&G=$2&B=$3/g

to transform 1,2,3 into /ew/?ew3=1&R=1&G=2&B=3 - not sure whether I got the escaping right (untested).

Edit #1:
IIUC, you are after a transformation pattern for commandExtension (not commandTransformation), but AFAIK commandExtension doesn’t support transformations.

The solution is simple, but not obvious (at least to me …):

grafik

grafik

grafik

grafik

Requesting 'http://xyz/ew/?ew3=1&R=255&G=0&B=0' (method='GET', content='null')

1 Like