It might be worth while looking into a third party tool for the UI and using the REST API. That seems to be a common approach. https://community.openhab.org/t/alternative-uis-openremote-irule-iviewer/1839/6 thread might point you in some useful directions.