openhab-android icon indicating copy to clipboard operation
openhab-android copied to clipboard

[FR] OpenHAB UI 3 URL is hard-coded to myopenhab.orgmyopenhab.org

Open lsafelix75 opened this issue 2 years ago • 4 comments

Hi,

I plan to modify the following line of code in (org.openhab.habdroid.ui.activity.Oh3UiWebViewFragment) and add in a new setting to append user-configurable subdomain (etc “home.”) so that it will work for private OpenHab Cloud. What you think?


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

lsafelix75 avatar Jan 09 '23 15:01 lsafelix75

I'd rather add a new API endpoint on the cloud server that returns the URL for main UI or hard-code a new path, e.g. https://cloud/mainui -> return main UI.

mueller-ma avatar Jan 13 '23 09:01 mueller-ma

I thought the configurable url needs to be at the cloud server base url in order for firebase notification to work?

On Fri, Jan 13, 2023 at 5:22 PM mueller-ma @.***> wrote:

I'd rather add a new API endpoint on the cloud server that returns the URL for main UI or hard-code a new path, e.g. https://cloud/mainui -> return main UI.

— Reply to this email directly, view it on GitHub https://github.com/openhab/openhab-android/issues/3147#issuecomment-1381526599, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGIZDC6MQJOJMSRHVXWAJLWSENE3ANCNFSM6AAAAAATVRFTHU . You are receiving this because you authored the thread.Message ID: @.***>

lsafelix75 avatar Jan 16 '23 09:01 lsafelix75

I can tell for the official server:

  • myopenhab.org is required for notifications
  • home.myopenhab.org is required for Main UI

Everything else works with both URLs. There's also an error message when you enter the wrong URL in the settings: https://github.com/openhab/openhab-android/blob/main/mobile/src/main/res/values/strings.xml#L180

mueller-ma avatar Jan 22 '23 08:01 mueller-ma

It seems that the Main UI domain is hardcoded to home.: https://github.com/openhab/openhab-cloud/issues/332

mueller-ma avatar Jan 22 '23 09:01 mueller-ma