I use the WireGuard Add-On. I also have template sensors in my HA config that track which clients are connected to WireGuard and amount of data transferred/received. Here is a snippet:
- platform: rest
name: wireguard
resource: http://xxxxxxxx-wireguard #hostname from add-on home screen
json_attributes:
- iphone
value_template: "OK"
- platform: template
sensors:
wireguard_iphone_status:
friendly_name: "Wireguard iPhone Status"
value_template: >-
{% if state_attr('sensor.wireguard', 'iphone').latest_handshake > ( as_timestamp(now()) ) -180 %}
Connected
{% else %}
Disconnected
{% endif %}
It would be nice to be able to run WireGuard from my UDMP so I could VPN into the house even if the HA server is rebooting etc. But I presume it could mean that I’d no longer be able to use the sensors in my config because they require I enter the WireGuard hostname in the resource
field of the REST sensor.
Is anyone UDMP savvy such that they could tell me whether I’d have a way to know the hostname of the WireGuard instance running in UDMP? Perhaps via SSH?