Local vs Remote from phone

More of curiosity than anything else… but how does the OpenHAB iPhone app determine whether to use local or remote IP for it’s connection?

Does it attempt a ping to the private IP? Or does it simply look at the IP address/mask on the network adapters on the phone and compare vs its configured private IP to see whether its in the same network?

I have OpenHAB on my iPhone (have for many years) and it generally works pretty well, either at home via Wifi or 3G/4G via my.openhab when out and about. However when testing SSL VPN software on my iPhone, if I connect to the VPN it still tries to connect remotely. The IP assigned via the SSL VPN is in a different subnet to the OpenHAB IP on my wireless network at home, so if it simply checks the network adapters IP address then that would make sense, however it would still be good for it to perhaps have a heat beat option and have it send ICMP requests to determine whether to use local or remote too?

No, the app uses the mDNS service started by the openHAB server. There is no need for IP information in the phone app for the openHAB instance to be discovered when connected to the local network.
When connecting remotely (that means outside the openHAB local network) an IP and proper port forwarding are needed for the app to connect to openHAB.

1 Like

Or use the my.openhab.org option…