New modbus binding config problems


(Levi) #1

Hey

I do not get the configuration of the new modbus binding correctly?
I have been busy for a few days but It does not want to succeed.:frowning_face:
I am using the wellpro ADAM8025 and ADAM8026
This is my old configuration

#poll=1

#modbus:serial.slave1.connection=/dev/ttyUSB0:38400:8:none:1:rtu:1
#modbus:serial.slave1.id=1
#modbus:serial.slave1.type=coil
#modbus:serial.slave1.start=0
#modbus:serial.slave1.length=8

#modbus:serial.slave2.connection=/dev/ttyUSB0:38400:8:none:1:rtu:1
#modbus:serial.slave2.id=2
#modbus:serial.slave2.type=coil
#modbus:serial.slave2.start=0
#modbus:serial.slave2.length=8

#modbus:serial.slave3.connection=/dev/ttyUSB0:38400:8:none:1:rtu:1
#modbus:serial.slave3.id=3
#modbus:serial.slave3.type=coil
#modbus:serial.slave3.start=0
#modbus:serial.slave3.length=8

#modbus:serial.slave4.connection=/dev/ttyUSB0:38400:8:none:1:rtu:1
#modbus:serial.slave4.id=4
#modbus:serial.slave4.type=coil
#modbus:serial.slave4.start=0
#modbus:serial.slave4.length=8


#modbus:serial.slave10.connection=/dev/ttyUSB1:38400:8:none:1:rtu:1
#modbus:serial.slave10.id=10
#modbus:serial.slave10.type=discrete
#modbus:serial.slave10.start=0
#modbus:serial.slave10.length=16

#modbus:serial.slave11.connection=/dev/ttyUSB1:38400:8:none:1:rtu:1
#modbus:serial.slave11.id=11
#modbus:serial.slave11.type=discrete
#modbus:serial.slave11.start=0
#modbus:serial.slave11.length=16

Is there anyone who can help me on my way?


(Miika Jukka) #2

Search button will help you alot. Here’s to get started: Transition from Modbus1 to Modbus2. OpenHab2

You gotta try it yourself first. When you encounter problems, please ask more specific questions. I’m sure nobody’s going to write the configs for you: How to ask a good question / Help Us Help You


(Levi) #3

I’ve already read that piece, I think I have a problem about the start and length value this is what i made already.

Bridge modbus:serial:slave [ port="/dev/ttyUSB0", id=1, baud=38400, stopBits="1", parity="even", dataBits=8, encoding="rtu" ] 
{

    Bridge poller coilsOutputs [ start=0, length=8, refresh=500, type="coil" ]
    {
        Thing data do00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
        Thing data do01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
        Thing data do02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
        Thing data do03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
        Thing data do04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
        Thing data do05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
        Thing data do05 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
        Thing data do05 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]

    }      
    
   Bridge poller discreteInputs [ start=1200, length=4, refresh=1000, type="discrete" ] {
       Thing data di1 [ readStart="1", readValueType="bit" ]
       Thing data di2 [ readStart="1", readValueType="bit" ]
       Thing data di3 [ readStart="1", readValueType="bit" ]
       Thing data di4 [ readStart="1", readValueType="bit" ]
       Thing data di5 [ readStart="1", readValueType="bit" ]
       Thing data di6 [ readStart="1", readValueType="bit" ]
       Thing data di7 [ readStart="1", readValueType="bit" ]
       Thing data di8 [ readStart="1", readValueType="bit" ]
       Thing data di9 [ readStart="1", readValueType="bit" ]
       Thing data di10 [ readStart="1", readValueType="bit" ]
       Thing data di11 [ readStart="1", readValueType="bit" ]
       Thing data di12 [ readStart="1", readValueType="bit" ]
       Thing data di13 [ readStart="1", readValueType="bit" ]
       Thing data di14 [ readStart="1", readValueType="bit" ]
       Thing data di15 [ readStart="1", readValueType="bit" ]
       Thing data di16 [ readStart="1", readValueType="bit" ]
          
    }

}

The Bridge poller is not working en de data thing does not come online


(Miika Jukka) #4

Have you checked logs? What is the precise error? What does thing statuses say in PaperUI?

Are you sure all data things under one poller can have same readStart?


(Levi) #5

Hello I’m a bit further now everything stays online this is the config now

Bridge modbus:serial:slave [ port="/dev/ttyUSB0", id=1, baud=38400, stopBits="1", parity="even", dataBits=8, encoding="rtu" ] 
{

    Bridge poller coilsOutputs [ start=0, length=8, refresh=500, type="coil" ]
    {
        Thing data do00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
        Thing data do01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
        Thing data do02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
        Thing data do03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
        Thing data do04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
        Thing data do05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
        Thing data do05 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
        Thing data do05 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]

    }  
}    
Bridge modbus:serial:slave [ port="/dev/ttyUSB0", id=10, baud=38400, stopBits="1", parity="even", dataBits=8, encoding="rtu" ] 
{  

   Bridge poller discreteInputs [ start=0, length=16, refresh=1000, type="discrete" ] 
   {
       Thing data di1 [ readStart="0", readValueType="bit" ]
       Thing data di2 [ readStart="1", readValueType="bit" ]
       Thing data di3 [ readStart="2", readValueType="bit" ]
       Thing data di4 [ readStart="3", readValueType="bit" ]
       Thing data di5 [ readStart="4", readValueType="bit" ]
       Thing data di6 [ readStart="5", readValueType="bit" ]
       Thing data di7 [ readStart="6", readValueType="bit" ]
       Thing data di8 [ readStart="7", readValueType="bit" ]
       Thing data di9 [ readStart="8", readValueType="bit" ]
       Thing data di10 [ readStart="9", readValueType="bit" ]
       Thing data di11 [ readStart="10", readValueType="bit" ]
       Thing data di12 [ readStart="11", readValueType="bit" ]
       Thing data di13 [ readStart="12", readValueType="bit" ]
       Thing data di14 [ readStart="13", readValueType="bit" ]
       Thing data di15 [ readStart="14", readValueType="bit" ]
       Thing data di16 [ readStart="15", readValueType="bit" ]
          
    }

}

but I get the following error

2018-12-22 17:43:54.306 [ERROR] [et.wimpi.modbus.net.SerialConnection] - open port failed: gnu.io.PortInUseException: Modbus Serial Master

2018-12-22 17:43:54.309 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/1 error: open port failed: Modbus Serial Master. Connection SerialConnection@6d294c5b[portName=/dev/ttyUSB0,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@572bcf7e[portName=/dev/ttyUSB0]

2018-12-22 17:43:54.311 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - re-connect reached max tries 1, throwing last error: open port failed: Modbus Serial Master. Connection SerialConnection@6d294c5b[portName=/dev/ttyUSB0,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@572bcf7e[portName=/dev/ttyUSB0]

2018-12-22 17:43:54.314 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - Error connecting connection SerialConnection@6d294c5b[portName=/dev/ttyUSB0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@572bcf7e[portName=/dev/ttyUSB0]: open port failed: Modbus Serial Master

2018-12-22 17:43:54.317 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Could not connect to endpoint ModbusSerialSlaveEndpoint@572bcf7e[portName=/dev/ttyUSB0] -- aborting request ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@5ad73e61[slaveId=1,functionCode=READ_INPUT_DISCRETES,start=0,length=16,maxTries=3] [operation ID dea14266-a3c5-421a-b4a5-ebf0091866cb]

It looks like there is something with the serial port or with the config i think?


(Miika Jukka) #6

Both your serial bridges are trying to use the same device. T̶h̶a̶t̶ ̶w̶o̶n̶’̶t̶ ̶w̶o̶r̶k̶.̶ ̶Y̶o̶u̶ ̶h̶a̶v̶e̶ ̶t̶o̶ ̶u̶s̶e̶ o̶n̶e̶ ̶s̶e̶r̶i̶a̶l̶ ̶b̶r̶i̶d̶g̶e̶ ̶l̶i̶k̶e̶ ̶i̶t̶ ̶w̶a̶s̶ ̶i̶n̶ ̶y̶o̶u̶r̶ ̶f̶i̶r̶s̶t̶e̶x̶a̶m̶p̶l̶e̶.̶

Edit: Yes it works. See below.


(Levi) #7

I removed the second serial bridge now i have a lot of error’s.
How and where do i set multiple unit id’s?Because i have more then 1 unit id?

2018-12-22 18:03:41.992 [vent.ItemStateChangedEvent] - modbus_data_slave_discreteInputs_di10_lastReadError changed from 2018-12-22T18:03:35.517+0100 to 2018-12-22T18:03:41.966+0100

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

2018-12-22 18:03:43.486 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 01 01 00 00 00 08 3d cc

2018-12-22 18:03:43.489 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)

2018-12-22 18:03:43.491 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadCoilsRequest@67340112 (unit id 1 & transaction 43). Serial parameters: SerialParameters@3dbd0f3a[portName=/dev/ttyUSB0,baudRate=38400,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2018-12-22 18:03:43.494 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadCoilsRequest@67340112 (unit id 1 & transaction 43). Serial parameters: SerialParameters@3dbd0f3a[portName=/dev/ttyUSB0,baudRate=38400,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2018-12-22 18:03:43.496 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 1 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3b744d74[slaveId=1,functionCode=READ_COILS,start=0,length=8,maxTries=3]). Will try again soon. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID 14b62b86-191d-4ea7-9f75-fc71cf7a48f8]

2018-12-22 18:03:45.099 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 01 01 00 00 00 08 3d cc

2018-12-22 18:03:45.100 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)

2018-12-22 18:03:45.103 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadCoilsRequest@7bbf4fc4 (unit id 1 & transaction 44). Serial parameters: SerialParameters@3dbd0f3a[portName=/dev/ttyUSB0,baudRate=38400,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2018-12-22 18:03:45.105 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadCoilsRequest@7bbf4fc4 (unit id 1 & transaction 44). Serial parameters: SerialParameters@3dbd0f3a[portName=/dev/ttyUSB0,baudRate=38400,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2018-12-22 18:03:45.107 [ERROR] [rt.modbus.internal.ModbusManagerImpl] - Last try 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3b744d74[slaveId=1,functionCode=READ_COILS,start=0,length=8,maxTries=3]). Aborting. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID da21e7ce-2591-45d5-8160-b58240ddbd81]

2018-12-22 18:03:45.162 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:slave:coilsOutputs:do01 'Modbus data' had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null)

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

2018-12-22 18:03:45.171 [vent.ItemStateChangedEvent] - modbus_data_slave_coilsOutputs_do01_lastReadError changed from 2018-12-22T18:03:22.579+0100 to 2018-12-22T18:03:45.166+0100

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

2018-12-22 18:03:45.172 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:slave:coilsOutputs:do02 'Modbus data' had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null)

2018-12-22 18:03:45.173 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:slave:coilsOutputs:do00 'Modbus data' had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null)

2018-12-22 18:03:45.175 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:slave:coilsOutputs:do04 'Modbus data' had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null)

2018-12-22 18:03:45.178 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:slave:coilsOutputs:do03 'Modbus data' had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null)

2018-12-22 18:03:45.179 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:slave:coilsOutputs:do05 'Modbus data' had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null)

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

2018-12-22 18:03:45.183 [vent.ItemStateChangedEvent] - modbus_data_slave_coilsOutputs_do04_lastReadError changed from 2018-12-22T18:03:22.595+0100 to 2018-12-22T18:03:45.176+0100

(Miika Jukka) #8

I’m not familiar with serial modbus devices but I looked into source code. Here’s what it says when it’s throwing and catching ModbusSlaveIOException:

// IO exception occurred, we re-establish new connection hoping it would fix the issue (e.g.
// broken pipe on write)

So I’d say something’s wrong with serial parameters or the device itself. And you are sure nothing on the hardware side has changed?


(Miika Jukka) #9

I saw that when you were using two serial bridges they had identical names:

Bridge modbus:serial:slave

Try naming them differently and try again with that configuration.


(Ssalonen) #10

Also, why is the parity different in the new configuration? I believe the old configuration did not have parity (“none”).

@gitMiguel is correct, you can specify many serial things but they must have different ids for openHAB to pick them up correctly. Btw it is OK to have many serial things using
the same port but different unit id.

Please note this disclaimer in the docs

With the exception of id parameters should be equal to all serial things sharing the same port .


(Rossko57) #11

It’s not that obvious, but here is where you give your slave a unique name. Perhaps something to remind, like
Bridge modbus:serial:adam10 [ ... id=10 ...

You might follow along with
Bridge poller adam10coils [ start=0, ...

These names you choose need to be unique in your configuration


(Levi) #12

Hello everyone

I indeed had a mistake in my serial bridge parity had to be none.
I adjusted it and adjusted the ID’s like you suggested. And now I do not have any errors anymore. But now I can not switch my switch yet. This is my configuration now

Bridge modbus:serial:slave1 [ port="/dev/ttyUSB0" ,id=1 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{

Bridge poller slave1coils [ start=0, length=8, refresh=500, type="coil" ]{
    
        Thing data do00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
        Thing data do01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
        Thing data do02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
        Thing data do03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
        Thing data do04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
        Thing data do05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
        Thing data do06 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
        Thing data do07 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]

    } 
}     
Bridge modbus:serial:slave2 [ port="/dev/ttyUSB0" ,id=2 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{

Bridge poller slave2coils [ start=0, length=8, refresh=500, type="coil" ]{
    
        Thing data do08 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
        Thing data do09 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
        Thing data do10 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
        Thing data do11 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
        Thing data do12 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
        Thing data do13 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
        Thing data do14 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
        Thing data do15 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]

    } 
} 
Bridge modbus:serial:slave3 [ port="/dev/ttyUSB0" ,id=3 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{

Bridge poller slave3coils [ start=0, length=8, refresh=500, type="coil" ]{
    
        Thing data do16 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
        Thing data do17 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
        Thing data do18 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
        Thing data do19 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
        Thing data do20 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
        Thing data do21 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
        Thing data do22 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
        Thing data do23 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]

    } 
}
Bridge modbus:serial:slave4 [ port="/dev/ttyUSB0" ,id=4 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{

Bridge poller slave4coils [ start=0, length=8, refresh=500, type="coil" ]{
    
        Thing data do24 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
        Thing data do25 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
        Thing data do26 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
        Thing data do27 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
        Thing data do28 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
        Thing data do29 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
        Thing data do30 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
        Thing data do31 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]

    } 
}          
Bridge modbus:serial:slave10 [ port="/dev/ttyUSB0" ,id=10 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{ 
   
Bridge poller slave10Inputs [ start=0, length=16, refresh=1, type="discrete" ]{ 
    
       Thing data di00 [ readStart="0", readValueType="bit" ]
       Thing data di01 [ readStart="1", readValueType="bit" ]
       Thing data di02 [ readStart="2", readValueType="bit" ]
       Thing data di03 [ readStart="3", readValueType="bit" ]
       Thing data di04 [ readStart="4", readValueType="bit" ]
       Thing data di05 [ readStart="5", readValueType="bit" ]
       Thing data di06 [ readStart="6", readValueType="bit" ]
       Thing data di07 [ readStart="7", readValueType="bit" ]
       Thing data di08 [ readStart="8", readValueType="bit" ]
       Thing data di09 [ readStart="9", readValueType="bit" ]
       Thing data di10 [ readStart="10", readValueType="bit" ]
       Thing data di11 [ readStart="11", readValueType="bit" ]
       Thing data di12 [ readStart="12", readValueType="bit" ]
       Thing data di13 [ readStart="13", readValueType="bit" ]
       Thing data di14 [ readStart="14", readValueType="bit" ]
       Thing data di15 [ readStart="15", readValueType="bit" ]
          
    }
}   
Bridge modbus:serial:slave11 [ port="/dev/ttyUSB0" ,id=11 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{ 
   
Bridge poller slave11Inputs [ start=0, length=16, refresh=1, type="discrete" ]{ 
    
       Thing data di16 [ readStart="0", readValueType="bit" ]
       Thing data di17 [ readStart="1", readValueType="bit" ]
       Thing data di18 [ readStart="2", readValueType="bit" ]
       Thing data di19 [ readStart="3", readValueType="bit" ]
       Thing data di20 [ readStart="4", readValueType="bit" ]
       Thing data di21 [ readStart="5", readValueType="bit" ]
       Thing data di22 [ readStart="6", readValueType="bit" ]
       Thing data di23 [ readStart="7", readValueType="bit" ]
       Thing data di24 [ readStart="8", readValueType="bit" ]
       Thing data di25 [ readStart="9", readValueType="bit" ]
       Thing data di26 [ readStart="10", readValueType="bit" ]
       Thing data di27 [ readStart="11", readValueType="bit" ]
       Thing data di28 [ readStart="12", readValueType="bit" ]
       Thing data di29 [ readStart="13", readValueType="bit" ]
       Thing data di30 [ readStart="14", readValueType="bit" ]
       Thing data di31 [ readStart="15", readValueType="bit" ]
          
    }
}    



And this is my item config

Switch do00 "keuken1" ["Lighting"] { channel="modbus:data:serial:slave1coils:do00:switch" }

What could be wrong with it?


(Miika Jukka) #13

Do you get any hints from logs?


(Levi) #14

No error log’s only itemCommandEvent

2018-12-23 12:18:33.040 [ome.event.ItemCommandEvent] - Item 'do00' received command ON

(Rossko57) #15

Try { channel="modbus:data:slave1:slave1coils:do00:switch }"

There are a couple of too-short polling refresh settings as well

you’ll want refresh=500 or something, more like the other data things


(Levi) #16

Thank you everyone everything is working now.:grinning:
This is the .things

Bridge modbus:serial:slave1 [ port="/dev/ttyUSB0" ,id=1 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{

Bridge poller slave1coils [ start=0, length=8, refresh=500, type="coil" ]{
    
        Thing data do00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
        Thing data do01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
        Thing data do02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
        Thing data do03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
        Thing data do04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
        Thing data do05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
        Thing data do06 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
        Thing data do07 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]

    } 
}     
Bridge modbus:serial:slave2 [ port="/dev/ttyUSB0" ,id=2 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{

Bridge poller slave2coils [ start=0, length=8, refresh=500, type="coil" ]{
    
        Thing data do08 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
        Thing data do09 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
        Thing data do10 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
        Thing data do11 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
        Thing data do12 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
        Thing data do13 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
        Thing data do14 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
        Thing data do15 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]

    } 
} 
Bridge modbus:serial:slave3 [ port="/dev/ttyUSB0" ,id=3 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{

Bridge poller slave3coils [ start=0, length=8, refresh=500, type="coil" ]{
    
        Thing data do16 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
        Thing data do17 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
        Thing data do18 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
        Thing data do19 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
        Thing data do20 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
        Thing data do21 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
        Thing data do22 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
        Thing data do23 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]

    } 
}
Bridge modbus:serial:slave4 [ port="/dev/ttyUSB0" ,id=4 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{

Bridge poller slave4coils [ start=0, length=8, refresh=500, type="coil" ]{
    
        Thing data do24 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
        Thing data do25 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
        Thing data do26 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
        Thing data do27 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
        Thing data do28 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
        Thing data do29 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
        Thing data do30 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
        Thing data do31 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]

    } 
}          
Bridge modbus:serial:slave10 [ port="/dev/ttyUSB0" ,id=10 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{ 
   
Bridge poller slave10Inputs [ start=0, length=16, refresh=500, type="discrete" ]{ 
    
       Thing data di00 [ readStart="0", readValueType="bit" ]
       Thing data di01 [ readStart="1", readValueType="bit" ]
       Thing data di02 [ readStart="2", readValueType="bit" ]
       Thing data di03 [ readStart="3", readValueType="bit" ]
       Thing data di04 [ readStart="4", readValueType="bit" ]
       Thing data di05 [ readStart="5", readValueType="bit" ]
       Thing data di06 [ readStart="6", readValueType="bit" ]
       Thing data di07 [ readStart="7", readValueType="bit" ]
       Thing data di08 [ readStart="8", readValueType="bit" ]
       Thing data di09 [ readStart="9", readValueType="bit" ]
       Thing data di10 [ readStart="10", readValueType="bit" ]
       Thing data di11 [ readStart="11", readValueType="bit" ]
       Thing data di12 [ readStart="12", readValueType="bit" ]
       Thing data di13 [ readStart="13", readValueType="bit" ]
       Thing data di14 [ readStart="14", readValueType="bit" ]
       Thing data di15 [ readStart="15", readValueType="bit" ]
          
    }
}   
Bridge modbus:serial:slave11 [ port="/dev/ttyUSB0" ,id=11 , baud=38400, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{ 
   
Bridge poller slave11Inputs [ start=0, length=16, refresh=500, type="discrete" ]{ 
    
       Thing data di16 [ readStart="0", readValueType="bit" ]
       Thing data di17 [ readStart="1", readValueType="bit" ]
       Thing data di18 [ readStart="2", readValueType="bit" ]
       Thing data di19 [ readStart="3", readValueType="bit" ]
       Thing data di20 [ readStart="4", readValueType="bit" ]
       Thing data di21 [ readStart="5", readValueType="bit" ]
       Thing data di22 [ readStart="6", readValueType="bit" ]
       Thing data di23 [ readStart="7", readValueType="bit" ]
       Thing data di24 [ readStart="8", readValueType="bit" ]
       Thing data di25 [ readStart="9", readValueType="bit" ]
       Thing data di26 [ readStart="10", readValueType="bit" ]
       Thing data di27 [ readStart="11", readValueType="bit" ]
       Thing data di28 [ readStart="12", readValueType="bit" ]
       Thing data di29 [ readStart="13", readValueType="bit" ]
       Thing data di30 [ readStart="14", readValueType="bit" ]
       Thing data di31 [ readStart="15", readValueType="bit" ]
          
    }
}    



And this is my .items

Group Verlichting <verlichting>

 
Switch keuken1 "keuken1" ["Lighting"] { channel="modbus:data:slave1:slave1coils:do00:switch" }
Switch keuken2 "keuken2" ["Lighting"] { channel="modbus:data:slave1:slave1coils:do01:switch" } 
Switch keuken3 "keuken3" ["Lighting"] { channel="modbus:data:slave1:slave1coils:do02:switch" }
Switch living1 "living1" ["Lighting"] { channel="modbus:data:slave1:slave1coils:do03:switch" }
Switch living2 "living2" ["Lighting"] { channel="modbus:data:slave1:slave1coils:do04:switch" }
Switch eetkamer1 "eetkamer1" ["Lighting"] { channel="modbus:data:slave1:slave1coils:do05:switch" }
Switch eetkamer2 "eetkamer2" ["Lighting"] { channel="modbus:data:slave1:slave1coils:do06:switch" }
Switch livingwand "livingwand" ["Lighting"] { channel="modbus:data:slave1:slave1coils:do07:switch" }

Switch bureau "bureau" ["Lighting"] { channel="modbus:data:slave2:slave2coils:do08:switch" }
Switch inkomhal "inkomhal" ["Lighting"] { channel="modbus:data:slave2:slave2coils:do09:switch" }
Switch wasplaats "wasplaats" ["Lighting"] { channel="modbus:data:slave2:slave2coils:do10:switch" }
Switch voordeur "voordeur" ["Lighting"] { channel="modbus:data:slave2:slave2coils:do11:switch" }
Switch garage "garage" ["Lighting"] { channel="modbus:data:slave2:slave2coils:do12:switch" }
Switch douche "douche" ["Lighting"] { channel="modbus:data:slave2:slave2coils:do13:switch" }
Switch kelder "kelder" ["Lighting"] { channel="modbus:data:slave2:slave2coils:do14:switch" }
Switch voor "voor" ["Lighting"] { channel="modbus:data:slave2:slave2coils:do15:switch" }

Switch zijkant "zijkant" ["Lighting"] { channel="modbus:data:slave3:slave3coils:do16:switch" }
Switch achter "achter" ["Lighting"] { channel="modbus:data:slave3:slave3coils:do17:switch" }
Switch hal "hal"  ["Lighting"] { channel="modbus:data:slave3:slave3coils:do18:switch" }
Switch orientatie "orientatie" ["Lighting"] { channel="modbus:data:slave3:slave3coils:do19:switch" }
Switch masterbedroom "masterbedroom" ["Lighting"] { channel="modbus:data:slave3:slave3coils:do20:switch" }
Switch badkamer "badkamer" ["Lighting"] { channel="modbus:data:slave3:slave3coils:do21:switch" }

Switch open1 "open1" { channel="modbus:data:slave4:slave4coils:do22:switch" }
Switch open2 "open2" { channel="modbus:data:slave4:slave4coils:do23:switch" }
Switch open3 "open3" { channel="modbus:data:slave4:slave4coils:do24:switch" }
Switch open4 "open4" { channel="modbus:data:slave4:slave4coils:do25:switch" }
Switch open5 "open5" { channel="modbus:data:slave4:slave4coils:do26:switch" }
Switch open6 "open6" { channel="modbus:data:slave4:slave4coils:do27:switch" }
Switch open7 "open7" { channel="modbus:data:slave4:slave4coils:do28:switch" }
Switch open8 "open8" { channel="modbus:data:slave4:slave4coils:do29:switch" }
Switch open9 "open9" { channel="modbus:data:slave4:slave4coils:do30:switch" }
Switch open10 "open10" { channel="modbus:data:slave4:slave4coils:do31:switch" }

Group Verlichtinginputs <verlichting>


Contact verlichting1 "verlichting1[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di00:contact" }
Contact verlichting2 "verlichting2[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di01:contact" }
Contact verlichting3 "verlichting3[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di02:contact" }
Contact verlichting4 "verlichting4[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di03:contact" }
Contact verlichting5 "verlichting5[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di04:contact" }
Contact verlichting6 "verlichting6[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di07:contact" }
Contact verlichting7 "verlichting7[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di05:contact" }
Contact verlichting8 "verlichting8[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di06:contact" }
Contact verlichting9  "verlichting9[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di08:contact" }
Contact verlichting10 "verlichting10[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di09:contact" }
Contact verlichting11 "verlichting11[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di10:contact" }
Contact verlichting12 "verlichting12[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di11:contact" }
Contact verlichting13 "verlichting13[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di12:contact" }
Contact verlichting14 "verlichting14[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di13:contact" }
Contact verlichting15 "verlichting15[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di14:contact" }
Contact verlichting16 "verlichting16[MAP(en.map):%s]"  { channel="modbus:data:slave10:slave10Inputs:di15:contact" }

Contact verlichting17 "verlichting17[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di16:contact" }
Contact verlichting18 "verlichting18[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di17:contact" }
Contact verlichting19 "verlichting19[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di18:contact" }
Contact verlichting20 "verlichting20[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di19:contact" }
Contact verlichting21 "verlichting21[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di20:contact" }
Contact verlichting22 "verlichting22[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di21:contact" }
Contact verlichting23 "verlichting23[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di22:contact" }
Contact verlichting24 "verlichting24[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di23:contact" }
Contact verlichting25 "verlichting25[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di24:contact" }
Contact verlichting26 "verlichting26[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di25:contact" }
Contact verlichting27 "verlichting27[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di26:contact" }
Contact verlichting28 "verlichting28[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di27:contact" }
Contact verlichting29 "verlichting29[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di28:contact" }
Contact verlichting30 "verlichting30[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di29:contact" }
Contact verlichting31 "verlichting31[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di31:contact" }
Contact verlichting32 "verlichting32[MAP(en.map):%s]"  { channel="modbus:data:slave11:slave11Inputs:di32:contact" }


Modbus switch+ sensor
Modbus switch+ sensor
(Miika Jukka) #17

Nice! :+1: