I am wondering if it is possible for openHAB to not only act as Modbus Master (aka Client), but also as Modbus Slave (aka Server).
According to the Modbus Binding Page: https://www.openhab.org/addons/bindings/modbus/ this binding is only for Modbus Client.
yes actually i did write a modbus-server using the “modbus-stream” npm library and connected openHAB to this server.
here is the code: GitHub - nett-media/modbus-server
hope it is useful for you