Auto discover Home Assistant node?


I’m building an app that is going to communicate with the Home Assistant REST API and I want the configuration to be as stream-lined and user friendly as possible. To be precise I do not want the user to have to enter an IP address of the server - if there are Home Assitant nodes in the LAN I would like the app to simply let the user select which of them to connect to and enter the appropriate credentials.

There’s a number of botch-solutions to this (including port scanning the entire segment) but I’m trying to find out if there is some built in mechanism that can be used?

The best I’ve come up with so far is for the app to pose as an uPnP (or similar) device and wait for the server to discover it (and from that figure out how to contact the server). But I’m keen to learn if there is already some other built-in way to do it (except hassio.local which isn’t very universal) or if it would be better if I added a component to the server that allows it to answer to broadcast queries about it’s whereabouts?

So, any thoughts are welcome!