Invalid URI host: null

i try to use a rule with sendHttpGetRequest with a json-url and actually i get some illegal characters errors.
I tried to find a solution and found urlencoder but i still get follow error.

==> openhab.log <==
2018-03-12 22:06:39.994 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Steckdose’: Invalid URI host: null (authority:

thats the rule file:


rule "Steckdose"
        Item gPower received command
        switch(receivedCommand) {
            	case ON :{
			var poweron = URLEncoder::encode('/?cmd=200&json={port:1,state:1}','UTF-8');		
			sendHttpGetRequest("" + poweron);
		case OFF:
			var poweroff = URLEncoder::encode('/?cmd=200&json={port:1,state:0}','UTF-8');
			sendHttpGetRequest("" + poweroff);

anybody know a solution?

Regards, Web

This shouldn’t be encoded this way. At the least, you need to not url encode the path separator and query operator:

Thanks for help,

does exist a converter for this? I need many adresses and dont like to convert each address manually.


i see i need only to convert the json content. not it works. thanks for help.

Regards, Web