All happens when I'm connected to my home network.
When I launch the app, it initially connects to the local URL and it responds fast, as expected.
If I move the app to the background and open it again after a while it says "Connecting to remote URL" and the response is much slower so it is clear that it gets it data over the internet.
If this happens and I completely close the app and reopen it, it connects to the local url again.
I expect the app to always connect to the local url while on the home network.
See "Actual behaviour"
Where can I get it?
Could you please test with current 2.3.3?
I installed the beta but it still has the same issue.
Exactly the same behaviour here with 2.2.0 on an aquaris X pro with Android 8.1.0.
I have the exact same problem using app version 2.5.0 on a Galaxy S8. Quite annoying. Anything I can do to help narrow down the problem?
I think the problem is that the app sometimes failes to connect to the local server, connects to the remote one and as long there is a connection to _some_ server, the app doesn't try to connect to a specific one (with exceptions for e.g. notifications that are always fetched from the remote server). I guess https://github.com/openhab/openhab-android/pull/780 could fix this issue.
Maybe if we're on a local network and can't connect to the local server, we should regularly retry to connect to the local server?
I've just reinstalled 2.5.0 (Built 24.11.2018) on my 6.0.1 Android to verify (and I still had the APK).
For me, in contrast to @anordvall on his S8 (which version btw?), the app consistently chooses the right path and switching causes to reconnect with the right path.
On 2.5.6 beta (10.01.2019) the app sometimes chooses to wrong path (mobile while in WIFI) as described. However, I've also noticed that I sometimes after changing connection have to forcefully close the app in order to cause it to reevaluate the correct path. Maybe this may be caused by MIUI "enhancements". But please keep this behavior in mind.
Exactly the same behaviour here with 2.5.0 on an Samsung J5 with Android 8.1.0.
it is annoying especially using nfc tag because in that case it is not visible why the process so slow
I guess #780 could fix this issue.
No, indeed, I don't see this issue anymore. Thanks for looking at it!