[?] Configuring "KMTronic LAN Ethernet IP 8 channels WEB Relay board"


I am new to openHAB (currently using Domoticz).

I have a "KMTronic LAN Ethernet IP 8 channels WEB Relay board"

How would I go about setting this up on openHAB2?

Please point me in the right direction and I will stumble on…

You can use the http binding for this kind of hardware.

That was my initial thought.

I added the following to an items file:

Switch Relay7 { http=">[ON:POST:http://admin:admin@] >[OFF:POST:http://admin:admin@]" }

and in HABpanel linked a switch to this item.

The problem now is that it only sends the same command “ON” and never “OFF” how do I fix this?

Please try the Switch through REST API, just to ensure if the switch item itself works as expected.

As I wrote I am a beginner. REST API?

If not installed, you can install the REST API documentation, after installation it’s reachable under http://ip.of.openhab.installation:8080/doc/index.html
You can try to use Basic UI either, or try to switch through karaf console. There are several ways to switch a switch :wink:

By the way: I think you don’t need a POST body, so

Switch Relay7 { http=">[ON:POST:http://admin:admin@] >[OFF:POST:http://admin:admin@]" }

should suffice.

I checked it in BasicUI using:

Switch Relay7 { http=">[ON:POST:http://admin:admin@] >[OFF:POST:http://admin:admin@]" }


sitemap default label="My first sitemap"
    Switch item=Relay7 label="Relay 7"

and indeed according to the log and actual device the Relay toggles ON/OFF fine.

2017-07-30 20:24:02.321 [ItemCommandEvent          ] - Item 'Relay7' received command ON
2017-07-30 20:24:05.329 [ItemCommandEvent          ] - Item 'Relay7' received command OFF

but when activated from Switch in HABpanel it only sends the ON commmand:

2017-07-30 20:22:18.306 [ItemCommandEvent          ] - Item 'Relay7' received command ON
2017-07-30 20:22:19.010 [ItemCommandEvent          ] - Item 'Relay7' received command ON
2017-07-30 20:22:19.689 [ItemCommandEvent          ] - Item 'Relay7' received command ON
2017-07-30 20:22:20.313 [ItemCommandEvent          ] - Item 'Relay7' received command ON

Is there a problem in HABpanel or have I defined something wrong somewhere?

I think it’s clear that you made some mistake in configuration at habpanel. Unfortunately I can’t help with habpanel, as I don’t use it yet.

I restarted openHAB and now it is working :slight_smile: