Custom MainUI URL on the Android App for own cloud instances

Hi dear community,

I want to use the openHAB Android app with my own cloud instance. I’ve successfully set up the cloud instance and would like to write a small overview of my setup for you (but that’s not part of this topic).

I have two domains:
Frontend Cloud: openhab.example.com
MainUI: home.openhab.example.com

If I enter openhab.example.com as the remote URL in the openHAB app, my push notification setup works correctly and the instance is recognized. However, when I open the “Main UI”, the app opens the MainUI WebView with the URL openhab.example.com (as I entered).

If I enter home.openhab.example.com as the remote URL, my push notifications no longer work, but the Main UI opens correctly.

Because of this, I took a quick look into the Android app and found the following:

MainUIWebViewFragment:

override fun modifyUrl(orig: HttpUrl): HttpUrl {
        var modified = orig
        if (orig.host == "myopenhab.org") {
            modified = modified.newBuilder()
                .host("home.myopenhab.org")
                .build()
        }

This explains why the Android app works correctly in both cases when I enter myopenhab.org as the remote cloud instance.

Now my question:
I would like to add a settings field in the app (similar to the frontail URL), where you can adjust the mainUI-URL for your own purposes.
I also found these issues/PRs:
Main UI URL is hard-coded to home.myopenhab.org by lsafelix75 · Pull Request #3257 · openhab/openhab-android · GitHub ← this one is closed, and I don’t understand what happened there
Allow custom Frontail URL by mueller-ma · Pull Request #3311 · openhab/openhab-android · GitHub ← this is the frontail PR

I could also contribute and implement these changes for the Android app, but I’m not sure if I should (I’ve never done this before).

Could you guide me to the correct procedure?

Thanks in advance.

1 Like