This integration allows you to control WireGuard VPN connections on an AVM Fritz!Box directly through Home Assistant.
- Automatic detection of all WireGuard VPN connections
- Turn VPN connections on/off via Switch entities
- Easy configuration through the Home Assistant UI
- Support for multiple VPN connections
- Automatic configuration from existing Fritz!Box Tools
- Automatic FritzBox discovery via SSDP/UPnP
- Configurable update interval (5-300 seconds)
- Open HACS in Home Assistant
- Go to Integrations
- Click on Custom repositories
- Add this repository:
- Repository:
https://github.com/rosch100/fritzbox-vpn - Category: Integration
- Repository:
- Search for Fritz!Box VPN and install it
- Restart Home Assistant
- Copy the
custom_components/fritzbox_vpnfolder to your Home Assistantcustom_componentsdirectory - Restart Home Assistant
- Go to Settings > Devices & Services
- Click on Add Integration
- If a FritzBox is found on your network, it will be automatically discovered
- The integration will try to use credentials from Fritz!Box Tools if available
- Enter your credentials if needed and click Submit
Note: For automatic discovery to work, UPnP should be enabled in your FritzBox (recommended, but not required). If UPnP is disabled, you can still configure the integration manually. TR-064 is always required for API access (see Requirements section).
- Go to Settings > Devices & Services
- Click on Add Integration
- Enter the following information:
- FritzBox IP Address: e.g.
192.168.178.1 - Username: Your FritzBox username
- Password: Your FritzBox password
- FritzBox IP Address: e.g.
- Click Submit
Important: Make sure TR-064 is enabled in your FritzBox (see Requirements section above). If you encounter authentication errors, check that TR-064 is enabled.
The integration automatically detects all WireGuard VPN connections on your FritzBox and creates a Switch entity for each one.
You can configure the update interval (how often the integration checks for VPN status changes) in the integration options:
- Go to Settings > Devices & Services
- Find your Fritz!Box VPN integration
- Click on Configure
- Adjust the Update interval (5-300 seconds, default: 30 seconds)
- Click Submit
The update interval determines how frequently the integration polls the FritzBox for VPN status updates. Lower values provide more frequent updates but may increase network traffic and FritzBox load. Higher values reduce network traffic but may delay status updates.
All credentials (username and password) are securely stored by Home Assistant:
- Credentials are encrypted and stored in Home Assistant's secure storage
- They are never exposed in logs or configuration files
- Access is restricted to the integration itself
After configuration, you will find the following entities for each VPN connection:
- Purpose: Turn VPN connections on and off (Enabled/Disabled)
- Entity ID:
switch.fritzbox_vpn_<connection_uid>_switch - Name: Uses the VPN connection name from the device
- Status: Shows if the VPN is activated (on) or deactivated (off)
- Connected Binary Sensor
- Purpose: Shows if the VPN connection is actively connected
- Entity ID:
binary_sensor.fritzbox_vpn_<connection_uid>_connected - Value:
onif connected,offif not connected
-
Status Sensor
- Purpose: Shows the combined VPN status as text
- Entity ID:
sensor.fritzbox_vpn_<connection_uid>_status - Values:
connected- VPN is enabled and connectedenabled- VPN is enabled but not connecteddisabled- VPN is disabledunknown- Status could not be determined
-
UID Sensor (disabled by default)
- Purpose: Shows the unique connection ID (Connection UID)
- Entity ID:
sensor.fritzbox_vpn_<connection_uid>_uid - Value: The connection UID string (same as
<connection_uid>)
-
VPN UID Sensor (disabled by default)
- Purpose: Shows the internal VPN UID of the FritzBox
- Entity ID:
sensor.fritzbox_vpn_<connection_uid>_vpn_uid - Value: The internal VPN UID string (from
conn.get('uid'))
You can use these entities to:
- Turn VPN connections on and off (switch)
- Monitor connection status (connected binary sensor)
- View detailed status information (status sensor)
- Access technical identifiers (UID sensors, disabled by default)
- Create automations based on connection status
Each VPN switch entity provides the following attributes:
- name: The name of the VPN connection (as configured on the FritzBox)
- uid: The unique connection ID (Connection UID)
- vpn_uid: The internal VPN UID of the FritzBox
- active:
trueif the VPN connection is activated,falseif deactivated - connected:
trueif the VPN connection is actively connected,falseif not connected - status: Textual status description:
"connected"- VPN is activated and connected"active_not_connected"- VPN is activated but not connected"inactive"- VPN is deactivated"unknown"- Status could not be determined
- AVM FritzBox with WireGuard VPN support
- FritzBox firmware with WireGuard enabled
- User with appropriate permissions on the FritzBox
- TR-064 must be enabled in the FritzBox settings (required for API access)
- UPnP recommended for automatic discovery via SSDP (optional, but recommended)
Before configuring the integration, you need to enable the required settings in your FritzBox:
- Open the FritzBox web interface
- Go to Home Network > Network > Network settings
- Click on Access Settings in the Home Network
- Enable TR-064 (Permit access for apps) - Required for API access
- Enable UPnP (Transmit status information over UPnP) - Recommended for automatic discovery
- Click Apply
Note:
- TR-064 is required - The integration cannot work without it
- UPnP is recommended - Enables automatic discovery of your FritzBox via SSDP. If UPnP is disabled, you can still configure the integration manually by entering the IP address
For problems or questions:
- Create an issue on GitHub
- Check the Home Assistant logs
This project is licensed under the Apache License 2.0, the same license as Home Assistant, to ensure compatibility and consistency with the Home Assistant ecosystem.