Getting local IP address for RESTful request

I have implemented wireguard and have the client info status option listening on port 8124 which I can query from a web browser and using curl:

curl -X GET http://192.168.0.55:8124

However I am deploying this on a few different devices / LANS and for that reason I dont want to hardcode the IP address.

I have tried these and none work:

curl -X GET http://localhost:8124
curl -X GET http://127.0.0.1:8124
curl -X GET http://172.30.33.0/:8124
curl -X GET http://homeassistant.local:8124

172.30.33.0 - is the ip address of the hassio from ip addr.

So how can I get the local IP address, is it stored in some global variable

- platform: rest
  resource: http://MY_LOCAL_IP:8124
  name: Wireguard Status

Try searching for an integration called something like local IP.
It might be usefull