Properly configure http binding channel in openhab3 for URL with parameters

I’ve just installed openHab 3 and successfully setup my Homematic Rolleshutters with homegear. For my Somfy rollershutters I’ve created a separate solution with an ESP8266.

Here I’m sending the commands with a simple URL and URL parameters to activate my rollershutters like this (e.g. send UP command to my rollershutter #4):

http://heimfunker/somfy?remote=4&command=U

Now I’m trying to create in the new openHAB 3 UI a proper Thing via the http binding, but I’m not successful with it. This is the code that the UI created with my configuration:

UID: http:url:3ddbea21e7
label: Rolladen Schlafzimmer
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: false
baseURL: http://heimfunker/somfy?remote=4
refresh: 30
commandMethod: GET
timeout: 3000
bufferSize: 2048
location: Schlafzimmer
channels:

  • id: position
    channelTypeUID: http:rollershutter
    label: Position
    description: “”
    configuration:
    commandTransformation: “&command=”
    downValue: D
    stopValue: S
    upValue: U

Any hint what I’m doing wrong here or where to find a good resource in the documentation? I might be missing something very fundamental here.

Best,
Rui

Thanks. That’s the documentation I’ve found and that I’ve tried to apply my values. But it didn’t help as I might be misunderstanding the documentation.

As you can see in my code above I’ve set the commandTransformation and the values for downValue, stopValue and upValue. As it is not working I’m kind of lost now on what to try differently. Any hint on what I am doing wrong is highly appreciated.

The link points to a very specific section of the docs which shows how to transfer the command into the URL. Your YAML code shows that you are not using the notation documented, hence the link.

I think you probably want something like:

commandTransformation: "&command=%2$s"

Yeah!!! That did the trick! Together with using “commandExtension” instead of “commandTransformation”.

Here’s now my code that works (in case others are wondering what the complete solution looks like):
UID: http:url:3ddbea21e7
label: Rolladen Schlafzimmer
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: false
baseURL: http://heimfunker/somfy?remote=4
refresh: 30
commandMethod: GET
timeout: 3000
bufferSize: 2048
location: Schlafzimmer
channels:

  • id: position
    channelTypeUID: http:rollershutter
    label: Position
    description: “”
    configuration:
    commandExtension: “&command=%2$s”
    downValue: D
    stopValue: S
    upValue: U

Thanks so much for your help @hafniumzinc !

1 Like

Oh yeah, I didn’t spot that! :man_shrugging:

Good work!