MODBUS and System air

Hi, I purchased FTDI USB-RS485-PCBA and I have different pins for A ad B, so do you recommend that solid blue goes to B and strip blue and white goes to A? I will try to connect this today or probably over the weekend…so Gunnar are you sure that this wires goes like you said?

Hi, now I am confused, I finally bought FTDI USB and made modbus binding and don’t have any modbus.cfg file, so must I first create that file or is something wrong with modbus binding??

I guess it´s the modbus 2.4 binding… Then you need a thing file, not a cfg file.

I have modbus binding 2.5.0.M1, so How then I should put all the register in thing file? Like above did Gunnar

Can you capture picture of poller and thing to see how we can set modbus in binding v2? Some examples please please

Look at this thread… It may give you a hint.

Gunnar please copy your things file with binding v2 and item to see difference with new binding

Sorry, I’ve been a bit busy the last weeks. The 2x modbus configuration for a complete villavent setup is huge. I used hours to set up mine even when I knew how it was done. There is no way I’ll cover all of it, but here is a partial fan config.

First a modbus serial slave:

Then a poller for the register range you need, here 100 through 138 (start 100, length 38):

And lastly you need a data thing, here for register 111 (actually register 112 in the villavent docs. The config is 0 index):

Read this thread and the modbus pdf from villavent to find the registers you want to read.

Gunnar thx, I will try. Copy code from .items for Villavent and .sitemap and rules

So I am trying to do the same as you Gunnar, migrating to the modbus 2.5 binding.

However I can not get it to work.
I deleted the old modbus.cfg
I removed all {.*} in the villaVent.items file
I followed your description , but added a final step where I linked the dataThing Number channel to the Number VillaventFan "Fan speed" <fan> (Villavent, Persist)

  1. How do I know which USB port to select?
  2. To control Fan speed how come in the data thing you only specify read?
  3. My fan speed jumps around 3000 as a value, am I reading the wrong registry?
  4. Why do you poll so often?

Here is my error:

2019-05-23 23:55:39.819 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-modbus1'

2019-05-23 23:13:46.446 [vent.ItemStateChangedEvent] - VillaventFan changed from 3180 to 3300

2019-05-23 23:13:47.643 [vent.ItemStateChangedEvent] - VillaventFan changed from 3300 to 3180

2019-05-23 23:13:48.356 [ome.event.ItemCommandEvent] - Item 'VillaventFan' received command 1

==> /var/log/openhab2/openhab.log <==

2019-05-23 23:13:48.365 [WARN ] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:systemAirRpm 'systemAirFanSpeed': not processing command 1 since writeStart is missing and transformation output is not a JSON

What’s not working, you’re getting fan rpm?

Register 112 (address 111) is not a speed control, its sensing fan RPM
See Systemair pdf like @gskjold says.
The off-low-high type control is register 101 (address 100)

Why not, it’s free?
Poll as often or as little as you wish, Modbus polls are commonly once per second but it’s only a starting point.

That one is easy enough. You’ve got one of the write parameters set in your channel somewhere, so that the binding doesn’t think its read-only, but not all. Then you’ve sent this read-only speed sensor a command.


The binding will let you do something clever here, if you want to play.
First set autoupdate off for your fan Number Item. This to break the linkage between command and Item state.
Link the Item to the read-polled channel for RPM in register 112, you’ve done that part already.
Now modify that channel to include the write address and type for register 101, the actual speed control. The binding will let you read and write to different registers in one channel.
Now you have an Item whose state will be fan RPM but you can send it commands 0-4 to control speed range.

Looks like you found the usb port you need if you get a 3000rpm read from that register. It is correct as @rossko57 is writing. 111 and 112 is read registers for extract/supply fan rpm sensor. And 500ms poll is just a choice.

Thanks, was a bit late last night and i referred to the wrong register :wink:

However this morning I changed it to 101 to be able to control the fan, however I can not get to work, do you mind sharing how you set off,low,normal,max,auto ?

2019-05-24 08:05:40.652 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-modbus1'

==> /var/log/openhab2/events.log <==

2019-05-24 08:05:41.082 [ome.event.ItemCommandEvent] - Item 'VillaventFan' received command 3

2019-05-24 08:05:41.092 [nt.ItemStatePredictedEvent] - VillaventFan predicted to become 3

2019-05-24 08:05:41.114 [vent.ItemStateChangedEvent] - VillaventFan changed from 30 to 3

2019-05-24 08:05:41.124 [vent.ItemStateChangedEvent] - VillaventFan changed from 3 to 30

and how come this pop up all the time:

2019-05-24 08:05:40.652 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-modbus1'

I am running on rpi and to decrease the load I was thinking about using 50000ms poll , its noit like temperature or anything changes so quick…

You are remembering that Systemair register number 101 gets addressed in Modbus channels as 100 ??

You’ve still got autoupdate enabled on this Item.
That usually only confuses things when you read-poll with Modbus.
Although if you do opt for the slow read-poll, you might choose to leave autoupdate on for a better response at your UI

You’ve got some reference to modbus 1 binding in your addons.cfg or folder somewhere. Clear it out, it cannot coexist with modbus 2

Thanks for the feedback

Its always -1 for some reason, easy to FORGET!!

Here is my config:


how do you switch that off?

Its seems like my dongle went offline for some reason… I guess symlink are needed

Status: OFFLINE - COMMUNICATION_ERROR Error (ModbusConnectionException) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@d485c4[slaveId=1,functionCode=READ_MULTIPLE_REGISTERS,start=100,length=38,maxTries=3]. Description: ModbusConnectionException(Error connecting to endpoint=ModbusSerialSlaveEndpoint@b60de2[portName=/dev/ttyUSB1]). Message: Error connecting to endpoint ModbusSerialSlaveEndpoint@b60de2[portName=/dev/ttyUSB1]

When they invented Modbus in the 1970s, they decided Register Number 1 would be found at address 0. Ever since then, there has been confusion about whether people are talking about register numbers or register addresses.
Systemair talk register numbers.
openHAB talk register addresses.

It’s a property of the Item, I think there’s a box in PaperUI
If you are going to do slow polls, you could leave it enabled and you will get a faster response to clicking at your UI.

With the new binding we need two things for every item, a poller and a data thing. Isn’t that a bit overhead?

I will have a closer look this evening when I get home, kinda hard to debug remotely…

A poller can read a block of many registers. Last one that you showed us of yours read 38, for example.

You need a data thing to describe each register in that block and how to interpret it - 16/32 bit, signed etc. - if you want to create a channel. You need a channel to link Items with bindings because that’s how OH2 works.

A poller can have many data things. You do not need to have a data thing for every register in the polled block, unless you want to use them in a channel.

Sorry, but Modbus is quite new for an aerospace engineer so apologize for the newbie questions.
So we can use the poller and read out all from 101 to 602 at bulk from the system air register and then create a data thing for each register?

Not quite. A limitation of modbus protocol is that you can only read 120 or so registers in one poll. 1970s technology, remember.
You’d need to make several pollers to read 500 registers in chunks.
If you worry about using resource with fast polling, you’d probably want to be a bit more selective though.
It is efficient to have as few pollers as possible, even when parts of the block are unused. But pointless to fetch say 400-499 if you only want register 425.

Beware that some modbus devices allow you to read a block including registers undefined by the manufacturer. Some will not, and reject the attempt.

Part of the fiddly configuring is to allow you the flexibility to make choices about these things.