OpenHab 3 Binding Modbus configuration

Tags: #<Tag:0x00007f1741160940> #<Tag:0x00007f1741160850> #<Tag:0x00007f1741160760>

Hi everyone, I start by saying, I’m not a programmer, I have difficulty setting the ModBus association, can you help me?

Years ago with a lot of help, I made programming in OH1.8 and Modbus Binding and everything works perfectly, now I would like to try with OH3, but I can’t find a tutorial that can help me

If it can help you, place the OH1.8 default.cfg file

modbus:poll=500
modbus:writemultipleregisters=true

#TEMPERATURA ESTERNA ID28 DFTE = ( 28 ) // ESTERNA
modbus:serial.I28.connection=/dev/ttyUSB0:19200:8:none:1:rtu
modbus:serial.I28.id=1
modbus:serial.I28.start=28
modbus:serial.I28.length=1
modbus:serial.I28.type=holding

#STATO IMPIANTO BUS - DIAGNOSTICA DI SISTEMA
#bit0=modulo guasto, bit1=bus guasto, bit2=bus bloccato basso, bit3=bus bloccato alto, bit4=config. EEPROM non valida
modbus:serial.busstato.connection=/dev/ttyUSB0:19200:8:none:1:rtu
modbus:serial.busstato.id=1
modbus:serial.busstato.start=576
modbus:serial.busstato.length=1
modbus:serial.busstato.type=holding
modbus:serial.busstato.valuetype=bit

#MODULO DFCC - Potenza reale istantanea DFCC Unità di misura: Watt
modbus:serial.dfccpower.connection=/dev/ttyUSB0:19200:8:none:1:rtu
modbus:serial.dfccpower.id=1
modbus:serial.dfccpower.start=649
modbus:serial.dfccpower.length=1
modbus:serial.dfccpower.type=holding
modbus:serial.dfccpower.valuetype=uint16

INGRESSI

#MODULO INGRESSI ID29
modbus:serial.I29.connection=/dev/ttyUSB0:19200:8:none:1:rtu
modbus:serial.I29.id=1
modbus:serial.I29.start=29
modbus:serial.I29.length=1
modbus:serial.I29.type=holding
modbus:serial.I29.valuetype=bit

#MODULO INGRESSI ID30
modbus:serial.I30.connection=/dev/ttyUSB0:19200:8:none:1:rtu
modbus:serial.I30.id=1
modbus:serial.I30.start=30
modbus:serial.I30.length=1
modbus:serial.I30.type=holding
modbus:serial.I30.valuetype=bit

USCITE

#MODULO USCITE ID62 DFDM
modbus:serial.O62.connection=/dev/ttyUSB0:19200:8:none:1:rtu
modbus:serial.O62.id=1
modbus:serial.O62.start=318
modbus:serial.O62.length=1
modbus:serial.O62.type=holding
modbus:serial.O62.valuetype=int8

#MODULO USCITE ID63 DFDM
#modbus:serial.O63.connection=/dev/ttyUSB0:19200:8:none:1:rtu
#modbus:serial.O63.id=1
#modbus:serial.O63.start=319
#modbus:serial.O63.length=1
#modbus:serial.O63.type=holding
#modbus:serial.O63.valuetype=int8

#MODULO USCITE ID26 DF4R “legge lo stato”
modbus:serial.SO26.connection=/dev/ttyUSB0:19200:8:none:1:rtu
modbus:serial.SO26.id=1
modbus:serial.SO26.start=282
modbus:serial.SO26.length=1
modbus:serial.SO26.type=holding
modbus:serial.SO26.valuetype=bit

#MODULO USCITE ID26 DF4R “scrive il comando”
modbus:serial.O26.connection=/dev/ttyUSB0:19200:8:none:1:rtu
modbus:serial.O26.id=1
modbus:serial.O26.start=4496
modbus:serial.O26.length=4
modbus:serial.O26.type=coil

VIRTUALI

#MODULO USCITE ID 36 DF4R “legge lo stato”
modbus:serial.SOV36.connection=/dev/ttyUSB0:19200:8:none:1:rtu
modbus:serial.SOV36.id=1
modbus:serial.SOV36.start=292
modbus:serial.SOV36.length=1
modbus:serial.SOV36.type=holding
modbus:serial.SOV36.valuetype=bit

#MODULO USCITE ID 36 DF4R “scrive il comando”
modbus:serial.OV36.connection=/dev/ttyUSB0:19200:8:none:1:rtu
modbus:serial.OV36.id=1
modbus:serial.OV36.start=4656
modbus:serial.OV36.length=4
modbus:serial.OV36.type=coil

The Modbus binding docs do include a section near the bottom about how to convert from 1.x settings to version 2. (v2 is used in OH3)
Have a try.