I finally got the time to sit down and migrate my modbus 1.0 binding config (~100 items) to the new v2 binding format. Got everything migrated and stuff is polling properly. However the speed in which items update is incredibly slow compared to the old v1 binding - to the point buttons and slider on habpanel don’t work properly, eg if I click it, it will take a noticeable amount of time to change state. Or the button will flicker (turn on, go back to off, then back on) if I leave autoupdate on
I think this illustrates what I’m seeing best. Here’s comparison of log outputs from me changing a thermostat item (modbus register on a plc).
On v1 binding it happens near instantly:
2019-06-20 04:57:45.981 [ome.event.ItemCommandEvent] - Item 'Thermostat' received command 78
2019-06-20 04:57:46.017 [vent.ItemStateChangedEvent] - Thermostat changed from 77 to 78
On v2 it takes much longer, and the item state flips back and forth:
2019-06-20 04:48:48.440 [ome.event.ItemCommandEvent] - Item 'Thermostat' received command 78
2019-06-20 04:48:48.441 [nt.ItemStatePredictedEvent] - Thermostat predicted to become 78
2019-06-20 04:48:48.443 [vent.ItemStateChangedEvent] - Thermostat changed from 77 to 78
2019-06-20 04:48:48.655 [vent.ItemStateChangedEvent] - Thermostat changed from 78 to 77
2019-06-20 04:48:49.079 [vent.ItemStateChangedEvent] - Thermostat changed from 77 to 78
Note that both installs have the same default of autoupdate being on. autoupdate was not disabled in either install. I tried disabling it with the v2 binding - it at least stopped the number flip flopping, however it made the item take a very long time to update - so much so that tapping the button in habpanel feels like it’s broken.
I don’t have much knowledge about the inner workings of either binding, but it seems it could possibly be a change in the way the modbus binding reports item state changes to openhab. I say this because it seems the v2 binding is actually polling my PLC faster than v1. To try and fix this by cutting down on poll time, I even combined ~110 registers needing polled to ~30, so I know the v2 binding is getting the data from my plc faster than before, but the way openhab is updating is several times slower.
short example of my new modbus config:
Bridge modbus:tcp:PLC [ host="192.168.1.18", port=502, id=2, connectTimeoutMillis=1000, timeBetweenTransactionsMillis=0, timeBetweenReconnectMillis=0, reconnectAfterMillis=60000 ] {
Bridge poller slave17 [ start=01, length=1, refresh=100, type="holding" ] {
Thing data thermostat [ readStart="01", readValueType="int16", writeStart="01", writeValueType="int16", writeType="holding" ]
}
Bridge poller slave38 [ start=04, length=1, refresh=100, type="coil" ] {
Thing data test [ readStart="04", readValueType="bit", writeStart="04", writeValueType="bit", writeType="coil" ]
}
Bridge poller slave54 [ start=06, length=1, refresh=100, type="holding" ] {
Thing data setback_thermostat [ readStart="06", readValueType="int16", writeStart="06", writeValueType="int16", writeType="holding" ]
}
Bridge poller slave60 [ start=15, length=4, refresh=100, type="holding" ] {
Thing data remote_temp_plc [ readStart="15", readValueType="int16", writeStart="15", writeValueType="int16", writeType="holding" ]
Thing data outdoor_temp_plc [ readStart="16", readValueType="int16", writeStart="16", writeValueType="int16", writeType="holding" ]
Thing data basement_bedroom_setpoint [ readStart="18", readValueType="int16", writeStart="18", writeValueType="int16", writeType="holding" ]
}
you’ll note I’ve already cranked the timing down as much as possible. Not sure what else to try. @ssalonen