Switch your FRITZ!Box device access profiles from Home Assistant.
This component will set up the following platforms.
Platform | Description |
---|---|
select |
Show current access profile per network device and select a new one. |
- Install HACS.
- Add
https://github.com/mithomas/ha-fritzprofiles/
as a custom repository - In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "AVM FRITZ!Box Access Profiles", enter url, user and password to access your FRITZ!Box.
- Using the tool of choice open the directory (folder) for your HA configuration (where you find
configuration.yaml
). - If you do not have a
custom_components
directory (folder) there, you need to create it. - In the
custom_components
directory (folder) create a new folder calledhttps://github.com/mithomas/ha-fritzprofiles
. - Download all the files from the
custom_components/https://github.com/mithomas/ha-fritzprofiles/
directory (folder) in this repository. - Place the files you downloaded in the new directory (folder) you created.
- Restart Home Assistant
- In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "AVM FRITZ!Box Access Profiles", enter url, user and password to access your FRITZ!Box.
All your uniquely named network devices will be set up as select
entities, showing the currently chosen profile and allow you to change it.
It is not advised to change the profiles of multiple devices at once (e.g. via a scene, script or automation) as this may likely overstrain your FRITZ!Box - if you actually have such a use case, the implementation of a respective service within this integration would be the far better way. Feel free to raise a PR or an issue for that :-).
Changes made outside of Home Assistant will be synched hourly.
This integration uses the device name (as defined in your FRITZ!Box) as the device key.
It can be that a device name is used more then once in your FRITZ!Box, usually when it is/was connected both via WIFI & cable LAN: Each network adapter has its own MAC address and as such a dedicated entry in your network device list.
In such a case simply rename them so that their names are different and wait for the next synchronization (may take up to 1 hour) or restart Home Assistant.
Even if you only log into your FRITZ!Box with password only, there's a standard admin user account associated with this - it's named fritzNNNN
(the numbers are random) and you find it in your FRITZ!Box web interface under System > FRITZ!Box User.
Simply remove and re-add the integration with the new credentials. Don't worry, since the names of the devices haven't changed their history is preserved.
The FRITZ!Box changes the device id on the respective form, depending on whether these device use the standard profile (then it's something like landeviceNNNN
) or a user-defined profile (then it's something like userNNNN
) - thus this not usable as an id as new entities would pop uup after every change. Also, there's no mapping from one to the other except the name so we might as well us that directly.
Web scraping is slow and places a significant load on the FRITZ!Box, so there needs to be balance between timeliness and resource consumption.
Why not integrate this into the official AVM FRITZ!Box Tools integration?
Web scraping is not allowed for core integrations, see ADR-0004. Unfortunately setting the device profile is not part of any API offered by the FRITZ!Box so far.
If you want to contribute to this please read the Contribution guidelines
This project was generated from @oncleben31's Home Assistant Custom Component Cookiecutter template. Code template was mainly taken from @Ludeeus's integration_blueprint template.
The backend code for communicating with the FRITZ!Box is based on the fritz-switch-profiles script, originally from flopp, adapted by eifinger
- https://github.com/flopp/fritz-switch-profiles
- https://github.com/eifinger/fritz-switch-profiles
- https://github.com/AaronDavidSchneider/fritzprofiles
- https://boxmatrix.info/wiki/Property:kids_userlist.lua