Returning Public IP for sensor.ssid when iOS device not at home


Would it be possible to return Public IP for sensor.ssid when iOS device is not at home.
This information might be easily get in json through a webervice as

This would be really helpful to detect who’s logged on homeassistant from outside home. Today, using the community integration “Autenthicated” helps to check who’s connected to HA. But this is quite difficult to filter out if the logons are from an external authorized device or from some sort of hackers. This is because the ip that this integration return is a Public IP and the location information is very inaccurated. Per definition, the public IP of our own mobile device is not fixed. It changes when we move from an antenna to another one, when we turn on again the mobile… The Public IP cannot be static for any mobile device. But, if we create in HA an automation that send a request of the Public IP from the mobile device (through sensor.ssid and Requesting location updates Notification), we would be able to dynamically correlate logon in HA with current Public IP of the mobile device. So, we might remove the corresponding persistent data from ip_authenticated.yaml.

I thought using iOs shortcuts to get the Public IP and return it to HA but I cannot think a way to trigger an event from HA on iOS to lauch the corresponding iOS shortcut, get the IP and send it back to HA.

Thanks for considering this feature.