Home network behind a VPN. How to detect I'm away?


I have a vpn server for my home network and Home assistant sits behind the vpn. I have come to realize when I head out of home, my phone will not update home assistant that I have disconnected from my wifi. I will need connect back home through the vpn when I’m outside in order to notify Home Assistant I am away.

Is there a better way to detect our phones are away?

Would one of these alternatives work?

unfortunately my router isn’t supported with an integration to home assistant.

I use…

  • GPS from companion app (require remote connection)
  • SSID from companion app (require remote connection)
  • ARP scan on router (require a device where the timeouts can be defined and some devices can go to sleep for longer periods of time, so there is a limit on how low you can set the timeout. Pinging the device can make it respond and update ARP tables, but will cost a bit on battery)
  • Bluetooth scan on ESPHome (device can go to sleep for long periods, so hard to know when you are away)

Pinging is also an option, if the device has a specific IP when on home network.

I found out my glinet router actually runs on a custom openwrt firmware. There is an integration called openwrt (luci), but I thought it wouldn’t work on my router, unless I flash it. Turns out the integration works.

So far so good! Devices with Mac addresses are popping up on home assistant. There’s about a 3 minute delay for home assistant to update away status when a device disconnects from WiFi. When devices coming online, it’s almost instant.

1 Like

The 3 minutes delay is the timeout of the ARP table entries.
It can’t be instant, because the devices do not report in when they leave. They just leave.