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 8.28.0.1-linux64) (build 1.8.0_163-b01)
      OpenJDK 64-Bit Server VM (Zulu 8.28.0.1-linux64) (build 25.163-b01, mixed mode)
    • openHAB version: 2.5.1

Hello, I need to use url such

“h_ttp://192.168.88.247/sec/?pt=6&cmd=6A:1” 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:'http://192.168.88.247/sec/?pt=6&cmd=6A:1'] >[OFF:GET:http://192.168.88.247/sec/?pt=6&cmd=6A:0]" }

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

DEBUG:

[DEBUG] [ab.binding.http.internal.HttpBinding] - Executing url ‘h_ttp://192.168.88.247/sec/?pt=6&cmd=6A’ via method GET
[DEBUG] [ab.binding.http.internal.HttpBinding] - Executing url ‘h_ttp://192.168.88.247/sec/?pt=6&cmd=6A’ via method GET

This issue was solved here:
https://community.openhab.org/t/colon-in-http-binding/26516
But when I try item:

Switch MySwitch1 { http=">[ON:GET:http://192.168.88.247/sec/?pt=6&cmd=6A%%3A1] >[OFF:GET:http://192.168.88.247/sec/?pt=6&cmd=6A%%3A0]" }

or

Switch MySwitch1 { http=">[ON:GET:http://192.168.88.247/sec/?pt=6&cmd=6A%25%3A1] >[OFF:GET:http://192.168.88.247/sec/?pt=6&cmd=6A%25%3A0]" }

I get in the log:

Executing url ‘h_ttp://192.168.88.247/sec/?pt=6&cmd=6A%%3A1’ via method GET

or

Executing url ‘h_ttp://192.168.88.247/sec/?pt=6&cmd=6A%25%3A1’ via method GET

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

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:http://192.168.88.247/sec/?pt=6&cmd=6A%%3A1
[DEBUG] [.internal.HttpGenericBindingProvider] - URL portion of binding config to be processed: http://192.168.88.247/sec/?pt=6&cmd=6A%%3A1
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 0: http://192.168.88.247/sec/?pt=6&cmd=6A%%3A1
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 1: http://192.168.88.247/sec/?pt=6&cmd=6A%%3A1
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 2: http:
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 3: http
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 4: //192.168.88.247
[DEBUG] [.internal.HttpGenericBindingProvider] - Group 5: 192.168.88.247
[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 'http://192.168.88.247/sec/?pt=6&cmd=6A%%3A0' 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 'http://192.168.88.247/sec/?pt=6&cmd=6A%3A1' 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: