Modbus switch+ sensor

I do not really see, what is unclear with the documentation of the binding. I was a totally newbee in the topic 4 weeks ago and found everything in the docs and in this forum.

But if I can help you, you are welcome.

Look at the basic example here:

Put in your IP-address, the register numbers of your modus device from manual and see what is happen. Post your config and the manual if you need help and I will see what I can do for you.

i am new here…
where do i see the configuration files??

how do i define switch in modbus?

You’d probably need to know a bit more about openHAB in general, before it makes much sense. Items, channels, things. Rules, sitemaps.

The specific modbus settings go into a file in the things folder, you can call it mymodbus.things or something like. There you can match your hardware details into things and channels for openHAB.
Elsewhere, you define Items and probably rules to work with the Items, and usually a sitemap to display some of them. This all general stuff you should find out from intro, demo, getting started etc.

Examples already posted of a real switch module setup and a meter connection.

1 Like

How about this practical example:
Read the docs! starting with the introduction, then read this, and then you can ultimately have the comeback of a true Jedi! :wink:

as mentioned before it is not clear…
i don’t understand where configuration files located …

Try this

Maybe someone can simply share configuration file for modbus switch ?

There is more than one model of modbus switch in the world made over the last fifty years.

Here again is an example of real things and items configuration. Click on it to see it nicely formatted.

so someone can explain in simple way?

if i got it correctly need to define modbus slave for the device

than define pool data for each coil?

how to make it a button on the control page?

You really, really need to read the general openHAB docs to get an idea of how it works with Items, things, channels. And how to get Items to interact with your user.

You’d need to install the modbus binding.
You’d need the appropriate hardware, an existing ethernet connection for Modbus-TCP or probably a USB-RS485 adaptor for Modbus-RTU

In a things file, you define a bridge thing that details the basic connection to your mystery modbus device.

You also define a poller thing that details each block of coils ,inputs, or registers you want to read or write.
You can have more than one poller per bridge.

You define channels as data things for each coil or register you want to read or write.
There’s usually several channels per poller.

In an items file, or using PaperUI, you defineItems as you wish of the type you want.
In an Item definition, you can link the Item to a bindings channel.

For development, you’ll be able to see your Items in PaperUI. But for real use, you’ll probably want to make a sitemap that includes at least some of your Items, and presents them the way you want e.g. as a switch that the user can see is on or off, and change it if they want.


You’re coming at this the wrong way. If you have existing modbus devices, openHAB can use them. Don’t worry about that.

The question is whether you can use openHAB, try installing it and playing with the demo setups…

Hey i have read the info and have adapter…

just cannot get the items into the control box …

can’t understand how to use configuration file, set samba folder and so on…

also managed to define modbus thing and pollers for my coils…

but i don’t understand how to link them to an actual switch…

Show us your things



Okay, you’ve decided to use Paper UI.

You’ve defined a serial Modbus thing.

You’e defined a poller thing belonging to that Modbus thing, This will read one coil, address 0, from your slave. Usually you’ll read many coils or registers here, but lets start simple.
This should already be polling now; if your mystery slave has any rx/tx LEDs you may be able to see activity.

Next, you need to define a data thing belonging to your poller. To describe what kind of data to read from what address, and how to write to it as well.
This seems like more work, but makes more sense when you have many data things.

Once you have a data thing, you have a channel that you can use in an Item definition to connect the Item with your modbus.

how do i create this channel…?

communication does work , but i cannot control the switch…

You can do that in PaperUI, right where you added the modbus serial and modbus poller things

This data thing is the channel that you will use in your Item definition.

any one can provide clear example of switch which is linked to serial modbus adapter?

There are many thousands of Modbus devices. You’ll need to offer a bit more of a clue.

i simply have modbus relay boards…

it have address which i define … and need to take coils data and translate into switch …

Alright, this thread is three years old now, with much advice already offered. Have far have you got with this now? What version of openHAB do you have installed now?