[SOLVED] Http Binding - does not support URL with e.g. code=9E61807F:NEC:32

Hello

I try to send this URL:

Switch Lade_Auf_Zu      { http=">[ON:GET:http://x.x.x.x/msg?code=9E61807F:NEC:32&out=4] }

But the target recived only

code=9E61807F

I think its because the syntax for http Binding.

http=">[<command>:<httpmethod>:<url>:<postcontent>]"

Is there a workarround/solution for this, without curl and Exec Binding?
Because I use OpenHab as docker container.

Regards
Steffen

Use URL encoding for the : characters.

1 Like

Hello,
I replaced the : with %3A

Switch Lade_Auf_Zu          { http=">[ON:GET:http://x.x.x.x/msg?code=9E61807F%3ANEC%3A32&out=4] }

If copy and paste the url into a browser it works.
If I use http Binding I get a warning:

2019-05-08 22:32:37.586 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=openhab/command/Lade_Auf_Zu] {item=Lade_Auf_Zu, bridgemarker=true, command=ON, timestamp=1557347557579} | {org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler}={service.id=427, service.bundleid=233, service.scope=bundle, event.topics=openhab/*, service.pid=org.openhab.http, component.name=org.openhab.binding.http, component.id=256} | Bundle(org.openhab.binding.http_1.13.0 [233])]

java.util.IllegalFormatConversionException: a != java.util.Date

	at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4302) ~[?:?]

	at java.util.Formatter$FormatSpecifier.printFloat(Formatter.java:2806) ~[?:?]

	at java.util.Formatter$FormatSpecifier.print(Formatter.java:2753) ~[?:?]

	at java.util.Formatter.format(Formatter.java:2520) ~[?:?]

	at java.util.Formatter.format(Formatter.java:2455) ~[?:?]

	at java.lang.String.format(String.java:2940) ~[?:?]

	at org.openhab.binding.http.internal.HttpBinding.formatAndExecute(HttpBinding.java:267) ~[?:?]

	at org.openhab.binding.http.internal.HttpBinding.internalReceiveCommand(HttpBinding.java:130) ~[?:?]

	at org.openhab.core.binding.AbstractBinding.receiveCommand(AbstractBinding.java:94) ~[?:?]

	at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:45) ~[?:?]

	at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415) [3:org.apache.karaf.services.eventadmin:4.2.1]

	at org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82) [3:org.apache.karaf.services.eventadmin:4.2.1]

	at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104) [3:org.apache.karaf.services.eventadmin:4.2.1]

	at org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166) [3:org.apache.karaf.services.eventadmin:4.2.1]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]


2 Likes

Solved! Thanks for help!