Custom component for Home Assistant to control your FRITZ!Box
Features:
- Turn on/off guest wifi
- Reconnect your FRITZ!Box / get new IP from provider
- Manage port forwardings for your HomeAssistant device
- Sensor for internet connectivity (with external IP and uptime attributes)
Install via HACS
The custom component is available via HACS
Manual Install
If you want to install the custom commponent manually, add the folder fritzbox_tools/
to YOUR_CONFIG_DIR/custom_components/
.
configuration.yml
:
fritzbox_tools:
host: "192.168.178.1"
username: "home-assistant"
password: "yourfritzboxpassword"
homeassistant_ip: "192.168.178.42" # Optional. Needed if you want to control port forwardings for the device running HomeAssistant
Port forwardings
It's possible to enable/disable port forwardings for the device which is running HomeAssistant.
Requirements:
- Set the
homeassistant_ip
in the configuration offritzbox_tools
- On your FRITZ!Box, enable the setting
Selbstständige Portfreigaben für dieses Gerät erlauben.
for the device which runs HA
The port forwards will be exposed as switches in your HA installation (search for port_forward
in your entity page to find the IDs).
Note: Currently only port forwards for the device which is running HA are supported!
Script: Reconnect / get new IP
The following script can be used to easily add a reconnect button to your UI.
fritz_box_reconnect:
alias: "Reconnect FRITZ!Box"
sequence:
- service: fritzbox_tools.reconnect
Automation: Reconnect / get new IP every night
automation:
- alias: "System: Reconnect FRITZ!Box"
trigger:
platform: time
at: '05:00:00'
action:
- service: fritzbox_tools.reconnect
Automation: Phone notification with wifi credentials when guest wifi is created
The custom component registers a switch for controlling the guest wifi and a service for triggering a reconnect. I use the following automation to send the guest wifi password to my wife's and my phones whenever we turn on the guest wifi:
automation:
- alias: "Guests Wifi Turned On -> Send Password To Phone
trigger:
platform: state
entity_id: switch.fritz_box_guest_wifi
to: 'on'
action:
- service: notify.pushbullet_max
data:
title: "Guest wifi is enabled"
message: "Password: ..."
service.reconnect
Reconnect to your ISPswitch.fritz_box_guest_wifi
Turns on/off guest wifisensor.fritz_box_connectivity
online/offline depending on your internet connectionswitch.port_forward_[description of your forward]
for each of your port forwards for your HA device