Switching SainSmart Relay via HTTP Binding not working

  • Hallo ich bin ein Anfänger und brauche Hilfe.
    Ich habe openhab2 auf eimen Rasperry instaillert und möchte ein Sainsamrt 8er Relais (wlan-modul) mit dem Http-Binding schalten. Ich habe das Binding installiert das ist mein item

“Switch Relais1 {http=”>[ON:POST:] >[OFF:POST:]"}"

Das sind die Befehle für das sainsmart, die ich im Inet gefunden habe.

“ ; Relais-01 off”
“” " /30000/01 ; Relais-01 on"

Und das ist der Eintrag im Log-file

Über die Imatic App lassen sich die Relais schalten.

Ich habe im Inet gesucht aber komme leider nicht weiter.

Danke im voraus für Eure Tipps.

As this is an international forum, could you ask your question in English please? Thank you.

Are you sure your using the right URL to switch the Relais on and off?
SocketTimeoutException occurs from the java framework when a request to a network socket (ip+port) is taking to long and timesout.
And since your making HTTP posts I would suggest you to make a simple rule.
if it’s a json HTTP API you can try this:

var url = "http://yourURL"
    var contenttype = "application/json"
    var POSTrequest = '{"your JSON post command'"}'

    var output = sendHttpPostRequest(url, contenttype, POSTrequest)   
logInfo("filename", output)

But as I said, check in your router which IP adress you need.

And please use english since this is not just a german forum :wink:


Do you mean this manual?

Please first check, if the IP-Address of your relais is correct.

Second, it is not clear in above manual, if you need port 30000 or not.

Did you test it with a normal browser (e.g. Edge, Internet Explorer, Firefox, Chrome or Opera?)

What happens, if you copy the following to “address line” into your internet browser? or or

Which of above command(s) does switch your relais?

Third, check the syntax of your item.

Normally it should be:

 Switch Relais1 "Switch Relais1" { http=">[ON:POST:] >[OFF:POST:]" }

hello my english is bad but i try it. Thank you for your answer.

Yes it is the the sainsmart. I try the address line in my firefox browser but the relais dosn’t work.

The connect to the RJ45 is connect with a wifi fritz repeater, is this a problem.

Thanks a lot!

Don’t worry, a lot of not native English speakers here :grinning:

You could try to use a German language forum:


Normally Fritz!Box has IP-Address (if you didn’t change this manually). And all other network-devices will have 192.168.178.xxx.

Or do you have an other router and then a Fritz!Repeater connected?

Which IP-Address has your relais?

the relay has a fixed ip, I have set the ip on the router. The relays can also be switched with the app imatic

Ok. And IP-Address is ?

Settings of My imatic App from sainsmart

Ok. When you open with a browser on your smartphone, what do you get?

Error: network timeout.

And with

hallo the same. network timeout

i made a pingtest ist works at

You mean 192.168.1 4 or ?

oh sorry

In above manual I read the following:

“The Ethernet Controller board has integrated the web server, When you are on your office, you just need to open the page on your computer, pad or smartphone, and then control your devices…”

So should work with a browser…

Maybe only

Or you have to disconnect your imatic app, because it has exclusive access…

i don’t no, it’s crazy. imtic app works but explorer dident.

Thankt for your support

And what about??
. (=Enter)

What is the IP address of your router (gateway)?
This seems to be an IP range related issue.