question from an absolute beginner, struggling with http…
Sending http://192.168.0.50/io.cgi?DOA2=10 activates a port on an ethernet module with relay for 1 sec.
I would like to have a pushbutton to send this request but can’t find the right setting.
Created a thing wit base url: http://192.168.0.50 and then added channels with the extension /io.cgi?DOA2=10.
Created an item as switch, didn’t work, then as string, didn’t work.
Has anyone a simple example/procedure on how to set this up?
No, but if you post your config we can probably tell you where things went wrong. There are a ton of details to get right when using a low level binding like this.
Please click the code tab and post the text code using code fences.
These are the settings. This is a relay switch with 8 ports ( ETH008 )were I tried 2 different settings on 2 ports, port 1 as switch, port 2 as string.
Just need to send out the URL command on my home network, URL: http://192.168.0.51/io.cgi?DOA2=10 tells to a relay switch box to close relay n° 2 for 1 second. I use it on some lights with pushbuttons, it simulates me pushing the lights pushbutton.
You are not using this like OH is deigned to work. Your Thing is defined using an http:switch Channel. That must be linked to a Switch Item. A Switch Item can only accept ON and OFF as a command.
The Thing is/should be where that ON and OFF are translated to to a URL and HTTP call. And that appears to be what you’ve done, or at least attempted. So your widgets will all work with a Switch. In your rules, when you command the Item you will only send ON and OFF as commands.