Hi there,
for weeks I’m trying to get the modbus binding to work
with our central heating. Our central heating has a modbus-tcp interface, it’s configured and working with a modbus-client from my computer.
Data is in modbus holding register at 40210 and 40211.
I can get the wanted values in openhab, the sitemap always shows the following:
holding210: 0
holding211: 0
I set up the following in openhab:
modbus.things
Bridge modbus:tcp:holzheizung [ host="192.168.11.240", port=502 ] {
Bridge poller holding [ start=210, length=2, refresh=60000, type="holding" ] {
Thing data holding210 [readStart="210", readValueType="int16", readTransform="default"]
Thing data holding211 [readStart="211", readValueType="int16", readTransform="default"]
}
}
heizung.items
Number holding210 "Modbus1 [%d]" {channel="modbus:data:holzheizung:holding:holding210:number"}
Number holding211 "Modbus2 [%d]" {channel="modbus:data:holzheizung:holding:holding211:number"}
Sitemap
Text item=holding210
Text item=holding211
I set the log level to debug for the following components
org.openhab.binding.modbus
org.openhab.io.transport.modbus
net.wimpi.modbus
When I have a look at the debug log, the following appears (Note, that it is getting a value from modbus (483)!):
2019-11-11 12:06:02.646 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Executing scheduled (60000ms) poll task BasicPollTaskImpl@50de34eb[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@7c4da78f[slaveId=0,functionCode=READ_MULTIPLE_REGISTERS,start=210,length=2,maxTries=3],endpoint=ModbusTCPSlaveEndpoint@4469cab2[address=192.168.11.240,port=502],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@18d1e3a6]. Current millis: 1573470362646
2019-11-11 12:06:02.647 [DEBUG] [wimpi.modbus.net.TCPMasterConnection] - connect()
2019-11-11 12:06:02.675 [DEBUG] [handler.ModbusPollerThingHandlerImpl] - Thing modbus:poller:holzheizung:holding received registers RegisterArrayWrappingInputRegister(00 00 01 e3) for request ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@7c4da78f[slaveId=0,functionCode=READ_MULTIPLE_REGISTERS,start=210,length=2,maxTries=3]
==> /var/log/openhab2/events.log <==
2019-11-11 12:06:02.677 [vent.ItemStateChangedEvent] - holding211 changed from 0 to 483
==> /var/log/openhab2/openhab.log <==
2019-11-11 12:06:02.678 [DEBUG] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:holzheizung:holding:holding211 channels updated: {modbus:data:holzheizung:holding:holding211:number=483}. readValueType=int16, readIndex=Optional[211], readSubIndex(or 0)=0, extractIndex=1 -> numeric value 483 and boolValue=true. Registers RegisterArrayWrappingInputRegister(00 00 01 e3) for request ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@7c4da78f[slaveId=0,functionCode=READ_MULTIPLE_REGISTERS,start=210,length=2,maxTries=3]
==> /var/log/openhab2/events.log <==
2019-11-11 12:06:02.682 [vent.ItemStateChangedEvent] - holding211 changed from 483 to 0
==> /var/log/openhab2/openhab.log <==
2019-11-11 12:06:02.682 [DEBUG] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:holzheizung:holding:holding210 channels updated: {modbus:data:holzheizung:holding:holding210:string=0, modbus:data:holzheizung:holding:holding210:number=0}. readValueType=int16, readIndex=Optional[210], readSubIndex(or 0)=0, extractIndex=0 -> numeric value 0 and boolValue=false. Registers RegisterArrayWrappingInputRegister(00 00 01 e3) for request ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@7c4da78f[slaveId=0,functionCode=READ_MULTIPLE_REGISTERS,start=210,length=2,maxTries=3]
2019-11-11 12:06:02.683 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Modbus operation ended, timing info: {total: 36 ms, connection: 1, transaction=27, callback=8} [operation ID 02e35b5b-f036-4623-a8f1-19059c1c3776]
2019-11-11 12:06:02.684 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Execution of scheduled (60000ms) poll task BasicPollTaskImpl@50de34eb[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@7c4da78f[slaveId=0,functionCode=READ_MULTIPLE_REGISTERS,start=210,length=2,maxTries=3],endpoint=ModbusTCPSlaveEndpoint@4469cab2[address=192.168.11.240,port=502],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@18d1e3a6] finished at 1573470362684. Was started at millis: 1573470362646 (=duration of 38 millis)
How can I fix this?
Thank you all!