Monitor VPN Connection?

I just set up a VPN and would like to monitor if it changes or goes down. And if that is possible send me a message of the status. Would this be possible?

are you connecting to an external VPN server from your router? if so, my first thought it to check if your external IP address has changed.

this assumes you have notifications set up. and it’s probably not full proof since your internet provider or VPN service might also change your IP address.

sensor:
  platform: dnsip
  scan_interval: 60

automation:
  alias: notify me if IP address changes
  trigger:
    platform: state
    entity_id: sensor.myipopendnscom
  action:
    service: notify.notify
    data_template:
      title: 'VPN status changed?'
      message: 'IP changed: {{ trigger.from_state.state }} → {{ trigger.to_state.state }}'

the sensor uses this component.

Thanks. That will monitor my IP service provider. But the problem I have is using DuckDNS and I have to bypass the VPN to my internal IP for HASS to work. So it really doesn’t get the VPN IP adderss.

You could try to use the ping sensor to just ping the private IP address of the other end of your VPN. This ping will only work if the VPN is established.

Ya that was I was thinking. Just implemented it now. Will see how it works.