Colon in http binding

  • Platform information:
    • OS: Ubuntu Server 18.04.4 LTS
    • Java Runtime Environment: openjdk version “1.8.0_163”
      OpenJDK Runtime Environment (Zulu (build 1.8.0_163-b01)
      OpenJDK 64-Bit Server VM (Zulu (build 25.163-b01, mixed mode)
    • openHAB version: 2.5.1

Hello, I need to use url such

“h_ttp://” for switch ON (I cannot post the URL as a newbie in the forum, and I should use h_ttp instead)
My item

Switch MySwitch1 { http=">[ON:GET:''] >[OFF:GET:]" }

But it doesn’t work because this gets cut off at the colon after the cmd=6A


[DEBUG] [ab.binding.http.internal.HttpBinding] - Executing url ‘h_ttp://’ via method GET
[DEBUG] [ab.binding.http.internal.HttpBinding] - Executing url ‘h_ttp://’ via method GET

This issue was solved here:
But when I try item:

Switch MySwitch1 { http=">[ON:GET:] >[OFF:GET:]" }


Switch MySwitch1 { http=">[ON:GET:] >[OFF:GET:]" }

I get in the log:

Executing url ‘h_ttp://’ via method GET


Executing url ‘h_ttp://’ via method GET

but the switch does not work.
What’s the trick?
How can I send command with the Colons characters

Forum search features work

Are you sure you want to use GET ?

Yes, I’m sure, but I don’t think the method matters to this problem.

Changing method:

[DEBUG] Refreshing model 'http.items'
[DEBUG] [.internal.HttpGenericBindingProvider] - parsing this as an http out binding: ON:POST:
[DEBUG] [.internal.HttpGenericBindingProvider] - URL portion of binding config to be processed:
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 0:
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 1:
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 2: http:
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 3: http
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 4: //
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 5:
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 6: /sec/
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 7: ?pt=6&cmd=6A%%3A1
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 8: pt=6&cmd=6A%%3A1
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 9: null
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 10: null
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 11: null

Result is the same:

[DEBUG] Executing url '' via method POST

I can’t imagine anythings changed in the binding, but since the double %% is apparently passing unaltered you should try a single %3A

Result is the same

Executing url '' via method POST

I don’t undestand which device or service should decode from the characters “% 3A” to the character “:”.
And should I want to make url look like “cmd=6A:1” in the debug log?

No, I don’t think you do.
What you’d like to know is what message arrives at your remote service.

tcpdump and wireshark

In russian forum I find some info.
The url with colon worked on OH 1.8 version and stopped working on version 2
May be something wrong with url-decode?

The HTTP binding is still version 1.x, but of course it must run within OH2 framework. Yes, of course something may have changed, it may be in the way xxx.items files are parsed.

It might be worth you playing with a rule and HTTP action, see if that encodes better.

The OP could probably make the binding work with this URL by setting the format configuration setting to FALSE.

The format parameter has already been set to FALSE in http.cfg.
So, then there is no solution for this bug.
It’s a pity :frowning: