Denkovi MQTT & SNMP IP Relay Configuration

Hello,

I am working on a Openhab automation setup for a client that has requested I implement a dry contact system that uses both an MQTT and SNMP Denkovi IP Relay.

SNMP: Denkovi Smartden IP Maxi smartDEN Maxi - I/O Relay Module SNMP, HTTP with DIN RAIL BOX - Denkovi A E LTD

MQTT: Denkovi Smartden IP-16R-MQ smartDEN IoT MQTT Ethernet 16 Relay Module - DIN RAIL BOX - Denkovi A E LTD

For the SNMP device I have been able to successfully create the SNMP “Thing” pointed at the relay and a “Channel” for a dry contact motion sensor that is connected directly to the device. However, the “item” that I have created pointed at the channel doesn’t seem to actually be doing anything. After doing some troubleshooting and research I think that I am simply configuring this wrong and may have missed something somewhere.

For the MQTT Device I was able to successfully create the MQTT broker and add it as a “bridge” in my things file, but am not really sure how to add my MQTT relay as a “thing” to the Bridge/Broker. On top of that I am not entirely sure how I would be able to pull data from devices connected to individual relays and get them added into openhab. It is important to note that in my MQTT relay websocket it shows that the device is connected to the bridge, I just need to integrate it into Openhab. This intention with this relay would be to monitor a backup generator via dry contacts so each “relay” would need to be a unique item in openhab (if this is even possible). I’m pretty new to openhab and have made some decent progress so far, but I have hit a bit of a wall here. I will provide my configs below if that helps at all.

SNMP Thing:
Thing snmp:target:DenkoviSNMP_Device1 “SNMP Denkovi Relay 1” [hostname=“xxx.xxx.xxx.xxx”, port=“161”, community=“public”, protocol=“v2c”, username=“N/A”, password=“N/A” ] {
Channels:
Type switch : motionChannel [ oid=“.1.3.6.1.4.1.42505.8.2.1.1.3.0”, onValue=“1”, offValue=“0” ]

SNMP Item:
Switch LAB_MOTION “Lab Motion Sensor” (LAB) [“Motion”] { channel=“snmp:target:DenkoviSNMP_Device1:.1.3.6.1.4.1.42505.8.2.1.1.3.0:binary-switch-value” }

MQTT Thing:
Bridge mqtt:broker:DenkoviMQTT “MQTT Broker” [ host=“xxx.xxx.xxx.xxx”, port=“1883”, username=“N/A”, password=“N/A” ]

So in summary, how do I properly integrate these relay systems into Openhab and how do I add devices connected to individual relays as their own “item/thing” in openhab? Any and all help is very much appreciated.

For MQTT, you need to create a new Generic MQTT Thing and manually ocnfigure the Channels for each MQTT topic you care about. This is exactly the example used in the Getting Started Tutorial. Adding Things - Advanced | openHAB

You’ ve done the first part of that tutorial already by creating the Bridge. You can jump to the “Create the Generic MQTT Thing” section.

You will need to know the names of the topics this device publishes and subscribes to as well as the format of those messages. MQTT Explorer can often help with this.

I do not know much about the SNMP binding so can’t help a whole lot with it. In the examples in the docs I see a bunch of properties which might be relevant like datatype and mode.

I set up SNMP in openHAB years ago but I haven’t used it recently. Hopefully I can give you enough information to get you started.

Object IDentifiers (OID) are needed in order to set up SNMP Channels. Ideally you would find these in the device’s documentation. If not, there is a Management Information Base (MIB) to provide that information. I used one of the free MIB browsers available on the internet.

Once you have the OIDs the Thing and Item configurations are straightforward.

Thing

Thing snmp:target:Diskstation "Synology Diskstation (SNMP)"[ hostname="192.168.0.10", protocol="v2c"] {
    Channels:        
        Type number : systemStatus      [oid=".1.3.6.1.4.1.6574.1.1.0", mode="READ"]
        Type number : systemTemperature [oid=".1.3.6.1.4.1.6574.1.2.0", mode="READ"]
        Type string : modelName         [oid=".1.3.6.1.4.1.6574.1.5.1.0", mode="READ"]
        Type string : serialNumber      [oid=".1.3.6.1.4.1.6574.1.5.2.0", mode="READ"]

Items

Number Diskstation_System_SystemStatus "System Status [%s]" {channel="snmp:target:Diskstation:systemStatus"}
Number Diskstation_System_Temperature  "Temperature [%s]"   {channel="snmp:target:Diskstation:systemTemperature"}
String Diskstation_System_ModelName    "Model Name [%s]"    {channel="snmp:target:Diskstation:modelName"}
String Diskstation_System_SerialNumber "Serial Number [%s]" {channel="snmp:target:Diskstation:serialNumber"}

Hope this helps.
Jim

Thank you for the response. I think I am getting a better grasp of how this should be formatted now.

So in order for my MQTT Relay to show as an available device in OpenHAB it needs to have Channels associated with it (similar to how the SNMP relay is set up). These channels would point to “topics” on the Relay (devices connected via dry contact).

Also, thank you for suggesting the MQTT Explorer. I was able to get this up and running and connected to my broker. I can see the MQTT relay and will be experimenting with connecting dry contact devices to the relay to see if they pop up as a topic in the Explorer. Fingers crossed.

This helps immensely. Getting a visual of how the Things, Channels, and items should be configured is definitely pointing me in the right direction. I’m going to try editing my current entries and see how things shake out. Also thank you for suggesting an MIB browser. I had no clue that this was a thing and had been using the snmpwalk command to query info from my relay.