Luebbo
(Uwe)
December 23, 2018, 1:40pm
1
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:http://192.168.1.4:30000/01 ] >[OFF:POST:http://192.168.1.4:30000/00 ]"}"
Das sind die Befehle für das sainsmart, die ich im Inet gefunden habe.
“192.168.1.4/30000/00 ; 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.
Maurits28
(Maurits)
December 23, 2018, 1:59pm
2
As this is an international forum, could you ask your question in English please? Thank you.
Nico111
(Nico F.)
December 23, 2018, 2:08pm
3
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
Celaeno1
(Alex)
December 23, 2018, 2:51pm
4
@Luebbo
Do you mean this manual?
Control switches remotely together with 16 Channel relay! Support for 16 Channels relay which means you could controll more to 16 different devices at the same time. RJ45 interface, via RJ45 telecommunications connection for network control. Unique...
Price: $39.99
Brand: SainSmart
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?
http://192.168.1.4/30000/01 or http://192.168.1.4/30000/00
http://192.168.1.4:30000/01 or http://192.168.1.4:30000/00
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:http://192.168.1.4:30000/01] >[OFF:POST:http://192.168.1.4:30000/00]" }
Luebbo
(Uwe)
December 23, 2018, 3:27pm
5
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!
sihui
(SiHui)
December 23, 2018, 3:29pm
6
Don’t worry, a lot of not native English speakers here
You could try to use a German language forum:
https://openhabforum.de/
Celaeno1
(Alex)
December 23, 2018, 3:37pm
7
Normally Fritz!Box has IP-Address 192.168.178.1 (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?
Luebbo
(Uwe)
December 23, 2018, 3:41pm
8
the relay has a fixed ip, I have set the ip on the router. The relays can also be switched with the app imatic
Celaeno1
(Alex)
December 23, 2018, 3:42pm
9
Ok. And IP-Address is 192.168.1.4 ?
Luebbo
(Uwe)
December 23, 2018, 3:57pm
10
Settings of My imatic App from sainsmart
Celaeno1
(Alex)
December 23, 2018, 4:28pm
11
Ok. When you open http://192.168.1.4:30000 with a browser on your smartphone, what do you get?
Celaeno1
(Alex)
December 23, 2018, 4:56pm
13
Luebbo
(Uwe)
December 23, 2018, 5:43pm
14
hallo the same. network timeout
i made a pingtest ist works at 192.1.168.4
Celaeno1
(Alex)
December 23, 2018, 5:47pm
15
You mean 192.168.1 4 or 192.1.168.4 ?
Celaeno1
(Alex)
December 23, 2018, 6:02pm
17
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 http://192.168.1.4/30000 should work with a browser…
Maybe only http://192.168.1.4
Or you have to disconnect your imatic app, because it has exclusive access…
Luebbo
(Uwe)
December 23, 2018, 6:29pm
18
i don’t no, it’s crazy. imtic app works but explorer dident.
Thankt for your support
Celaeno1
(Alex)
December 23, 2018, 6:42pm
19
RolfV
(Rolf Vermeer)
December 23, 2018, 7:15pm
20
What is the IP address of your router (gateway)?
This seems to be an IP range related issue.