Control lights via HTTP


I’ve recently upgraded to Openhab3 and want to control my lights (simple on/off and dimmers) via HTTP GET commands.

My relay modules expose a quite simple “API”
To turn a light ON I need to make an HTTP GET request to http://[ip-address]/api.html?method=sCh&ch=[relay-id]
To turn a light OFF I need to make an HTTP GET request to http://[ip-address]/api.html?method=cCh&ch=[relay-id]

For the dimmers it works in a similar way
ON : http://[ip-address]/api.html?method=sCh&ch=[relay-id]&val=100
OFF : http://[ip-address]/api.html?method=cCh&ch=[relay-id]&val=0
VALUE : http://[ip-address]/api.html?method=dCh&ch=[relay-id]&val=[selected-value]

I’m not used to the whole new setup with Things,Channels,Model, …
I had the config work with an older config method, but I want to switch to the graphical interface and do it according to the new model. No more fiddling around in config files myself. :slight_smile:

Can somebody explain me what I need to create inside the system in order to make my light bulbs work?

Things, Channels and Items should not have changed and you should be able to use your http-thing as before.

Only the model is new, but that’s optional.
I would first copy your previous configuration and then you can look into defining the model.