[solved]Translate sendHttpGetRequest to url-Thing

Hello,
up to now I use
sendHttpGetRequest("http://localhost:1001/cmd=IT%20A%201%20LEARN%20ON")
and
sendHttpGetRequest("http://localhost:1001/cmd=IT%20A%201%20LEARN%20OFF")
for Dimming to e.g.55% it would be
sendHttpGetRequest("http://localhost:1001/cmd=IT%20A%201%20LEARN%2055")

in a rule to switch an lamp on an off.
I want to make this into a Item in Openhab3/binding-http.
Can someone please explain to me what I have to fill in wich fields?
HTTP - Bindings | openHAB is not very helpful to me.
Here is the Code I get, but not Working
UID: http:url:1e7e6088ff
label: Lightman_Thing
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: false
baseURL: http://localhost:1001/cmd=IT%20
refresh: 30
commandMethod: GET
contentType: text/plain
timeout: 3000
bufferSize: 2048
location: Other
channels:
- id: Channel1
channelTypeUID: http:dimmer
label: Channel1
description: “”
configuration:
onValue: ON
mode: WRITEONLY
offValue: OFF
commandExtension: A%201%20LEARN%20ON2$s

var/log/openhab/openhab.log says
2020-12-31 08:50:22.247 [WARN ] [nding.http.internal.HttpThingHandler] - Creating request for 'http://localhost:1001/cmd=IT%20/A%201%20LEARN%20ON2$s' failed: Conversion = '2'

Many thanks for help
Neuroplant

Hello
found the hint in other thread ([Solved] OH3 http binding creating request failed - #9 by Marfi)

  • The URL is not allowed to contain “%” (I replaced “+” with “%20”, " "should work too)
  • “/” is set by the binding
  • placeholder for value is “%2$s” (in the Doc is written “%2$” maybe someone can correct this)
    ->
    So in my case Only the fields “Base URL” (http://localhost:1001), “Command URL Extension” (cmd=IT+A+1+LEARN+%2$s) have to be filled

Gruß
Neuroplant

For completeness: it’s already there, just underneath:

After the parameter reference the format needs to be appended. See the link above for more information about the available format parameters (e.g. to use the string representation, you need to append s to the reference).

It might not always be s - depends what the value is.