How to send http request?

The -u option is passing the username/password for basic Auth on the Web page. You can do the same thing by embedding it as part of the URL itself


Or in your case since it doesn’t appear to require a password you omit the :



I guess I’m still doing something wrong… I was able to make it work using the EXEC binding and Curl… but for some reason, below will not work.

The only problem I have now is that I am unable to receive status updates. I think I found something online that uses MQTT to speak to OpenHab and the use a rule to get a status update… But that’s another monster in and of itself…

I have tried escaping both [] and (), as well as escaping just [] and just (). Nothing. I keep getting the same log failure…

21:43:05.527 [WARN ] [.internal.HttpGenericBindingProvider] - bindingConfig is NULL (item=Popcorn (Type=SwitchItem, State=Uninitialized)) -> process bindingConfig aborted!

Switch Popcorn “Popcorn Machine” { http=">[ON:POST:http://admin:PASSWORD@[7].instances[0].commandClasses[0x20].Set(255)] >[OFF:POST:'http://admin:PASSWORD@[7].instances[0].commandClasses[0x20].Set(0) ]" }

At this point you need to decide is getting this working with the HTTP binding really something that you want to spend your time and effort getting it to work, or live with the working solution through the Exec binding and move on to solving more interesting problems. I would go with what works and move on.

By escaping, do you mean you added the ‘’ before each or you used the URL encoded version of the character?

I think you’re right, I’m just gonna use the EXEC binding to make it work. I just need to figure a way to get feedback. Otherwise, this is just a switch on my phone.

Thank you so much for taking the time to help me through this.

And I used “” before each [].

If you wanted to try one more test you can try replacing the brackets and parens with the URL encoded character.


I attempted the URL encoded, no luck. Either way I think I’ll consider this closed, but unsolved. I was able to get it to work using the EXEC binding (curl) and additionally ended up switching it over to a Vera and using the MiOS binding which turned out to be much better than expected!

Thank you so much for helping me. I’ve gone through a ton of these forums and your name continually pops up. Thank you for helping out newbs like me!

I actually opened up a new topic. If you find the time, I’d appreciate it if you could take a look!

this worked for me. It is much easier to setup NodeMCU with HTTP request than with MQTT channels.
Thanks a lot.

Mikey, could you share the Item/thing/Sitemap config for the pan/tilt camera control? I’ve been struggling with it.


You need to make a rule to do it.

My rule for handling positions is looking like this

rule "Garage cam position"
	Item GarageCamPosition received command
	sendHttpGetRequest("" + receivedCommand.toString)
1 Like

how do you do it in openhab, i cant link it

I don’t succeed controlling my player by using http-command, based on TRYAK - Sonoé iEast - API Manual by AndersFluur. I have tried Item Configuration and through rules with sendHttpGetRequest and with executeCommandLine, neither works for me.

This is my Item:
Switch Roxcore_Control “Control” (Office) { http=">[ON:GET:] >[OFF:GET:]" }

The http://xxxx.m3u address is a link to a streeming radio channel. The http-links works fine using a web-browser.

This is my rule:
rule “Roxcore control”
Item Roxcore_Control received command
logInfo(“roxcore control”, "Command was " + receivedCommand)
if(Roxcore_Control = ON) {
else if (Roxcore_Control = OFF) {

Running the rule, I get this error message in the log:
2018-10-10 20:48:13.494 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Roxcore control’: An error occurred during the script execution: Cannot assign a value in null context.

I am running openHAB 2.2.0 on raspberry Pi 3 B.

Any suggestion on what I am doing wrong would be appreciated?

Please How to use code fences.

I strongly recommend using VSCode to edit .rules files.

You have some very basic syntax errors and one logic problem.

  1. To access the state of an Item you must call .state, as in Roxcore_Control.state
  2. To do a comparison you must use ==. '=` is an assignment.
  3. The logic error is described here

Thanks so much, the rule works fine after taking care of 1 and 2 in your answer (thought I picked up these basics after making a number of rules already). Need to remember the other recommendations for the future.