AVM FRITZ!Box Tools

The AVM FRITZ!Box Tools integration allows you to control your AVM FRITZ!Box router and have presence detection for connected network devices.

There is support for the following platform types within Home Assistant:

  • Device trackerDevice trackers are used to track the presence, or location, of a device. [Learn more] - presence detection by looking at connected devices.
  • Binary sensorA binary sensor returns information about things that only have two states - such as on or off. [Learn more] - connectivity status.
  • ImageThe Image integration allows other integrations to display a static image. [Learn more] - QR code for Guest Wi-Fi.
  • ButtonA button entity can fire an event, or trigger an action towards a device or service. It can be compared to a physical push button. The button entity does not have a state like on or off, but keeps the timestamp of when it was last pressed in the Home Assistant UI or via an action. [Learn more] - reboot, reconnect, firmware update.
  • SensorSensors return information about a thing, for instance the level of water in a tank. [Learn more] - external IP address, uptime and network monitors.
  • SwitchSwitches are things that have two states you can select between, such as turning on or off a socket. [Learn more] - call deflection, port forward, parental control and Wi-Fi networks.
  • UpdateAn update entity is an entity that indicates if an update is available for a device or service. [Learn more] - firmware status of the device.

Configuration

To add the AVM FRITZ!Box Tools integration to your Home Assistant instance, use this My button:

AVM FRITZ!Box Tools can be auto-discovered by Home Assistant. If an instance was found, it will be shown as Discovered. You can then set it up right away.

Manual configuration steps

If it wasn’t discovered automatically, don’t worry! You can set up a manual integration entry:

  • Browse to your Home Assistant instance.

  • Go to Settings > Devices & Services.

  • In the bottom right corner, select the Add Integration button.

  • From the list, select AVM FRITZ!Box Tools.

  • Follow the instructions on screen to complete the setup.

Important

Both the TR-064 (Permit access for apps) and UPnP (Transmit status information over UPnP) protocol needs to be enabled in the FRITZ!Box under Home Network > Network > Network settings > Access Settings in the Home Network for Home Assistant to login and read device info.

Username

It is recommended to create a separate user to connect Home Assistant to your FRITZ!Box. To create a user, in the FRITZ!Box go to System > FRITZ!Box Users > Users > Add User. Make sure the user has the FRITZ!Box Settings permission.

Note

If you still want to use the predefined user, please note that as of FRITZ!OS 7.24, the FRITZ!Box creates a random username for the admin user if you didn’t set one yourself. This can be found after logging into the FRITZ!Box and visiting System > FRITZ!Box Users > Users. The username starts with fritz followed by four random numbers. Under properties on the right it says created automatically. Prior to FRITZ!OS 7.24, the default username was admin.

Actions

Available actionsActions are used in several places in Home Assistant. As part of a script or automation, actions define what is going to happen once a trigger is activated. In scripts, an action is called sequence. [Learn more]: set_guest_wifi_password

Action set_guest_wifi_password

Set a new password for the guest wifi. The password Length must be between 8 and 63 characters long.

Data attribute Required Description
device_id yes Only act on a specific router
password no New password for the guest wifi (will be auto-generated if not defined)
length no Length of the auto-generated password. (default 12)

Integration options

It is possible to change some behaviors through the integration options. To change the settings, go to Settings > Devices & services. Select the AVM FRITZ!Box Tools integration, then select Configure.

Consider home

Number of seconds that must elapse before considering a disconnected device “not at home”.

Enable old discovery method

Needed on some scenarios like no mesh support (FritzOS <= 6.x) or mixed brands network devices or LAN switches.

Additional information

Parental control switches

Parental control switchesSwitches are things that have two states you can select between, such as turning on or off a socket. [Learn more] can be used to enable and disable internet access of individual devices. You can also find the current blocking state of the individual devices in the UI of the FRITZ!Box under Internet > Filters > Parental Controls > Device Block.

Device tracker

Note: If you don’t want to automatically track newly detected devices, disable the integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] system option Enable new added entities.

Port forward switches

Due to security reasons, AVM implemented the ability to enable/disable a port forward rule only from the host involved in the rule. As a result, this integration will create entities only for rules that have your Home Assistant host as a destination.

Note 1: On your FRITZ!Box under Internet > Permit Access, enable the setting Permit independent port sharing for this device for the device which runs HA.

Note 2: Only works if you have a dedicated IPv4 address (it won’t work with DS-Lite)

Example Automations and Scripts

Script: Reconnect / get new IP

The following scriptScripts are components that allow users to specify a sequence of actions to be executed by Home Assistant when turned on. [Learn more] can be used to easily add a reconnect button to your UI. If you want to reboot your FRITZ!Box, you can use fritz.reboot instead.

fritz_box_reconnect:
  alias: "Reconnect FRITZ!Box"
  sequence:
    - action: button.press
      target:
        entity_id: button.fritzbox_7530_reconnect

Automation: Reconnect / get new IP every night

automation:
- alias: "Reconnect FRITZ!Box"
  triggers:
    - trigger: time
      at: "05:00:00"
  actions:
    - action: button.press
      target:
        entity_id: button.fritzbox_7530_reconnect

Automation: Phone notification with Wi-Fi credentials when guest Wi-Fi is created

automation:
  - alias: "Guests Wi-Fi Turned On -> Send Password To Phone"
    triggers:
      - trigger: state
        entity_id: switch.fritzbox_7530_wifi_myssid
        to: "on"
    actions:
      - action: notify.notify
        data:
          title: "Guest Wi-Fi is enabled"
          message: "Password: ..."

Troubleshooting

In any case, when reporting an issue, please enable debug logging, restart the integration, and as soon as the issue re-occurs stop the debug logging again (download of debug log file will start automatically). Further if still possible, please also download the diagnosticsThe diagnostics integration provides a way to download diagnostic data from a device or integration for sharing in issue reports. Sharing diagnostics data when reporting an issue allows developers to diagnose and fix your reported problem quicker. [Learn more] data. If you have collected the debug log and the diagnostics data, provide them with the issue report.

Device presence detection is not working as expected

Check if one of the following cases applies:

  • You see a device as still present, even if it is offline or disconnected for more than the configured consider home seconds.
  • You’re using additional network equipment like a network switch or Wi-Fi access point other than an AVM Fritz!Repeater or other AVM components, but not configured as a mesh in your home network.

If one of the above cases applies to your setup, try enabling the old discovery method in the integration options. This might resolve the issue.