Skip to main content

CI License MIT

fritz-switch-profiles

A (Python) script to remotely set device profiles of an AVM Fritz!Box

Forked from https://github.com/flopp/fritz-switch-profiles.git to add a PyPi release.

Installation

git clone https://github.com/eifinger/fritz-switch-profiles.git
cd fritz-switch-profiles
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Usage

usage: fritz-switch-profiles.py [-h] [--url URL] [--user USER] --password
                                PASSWORD [--list-devices] [--list-profiles]
                                [DEVICE=PROFILE [DEVICE=PROFILE ...]]

positional arguments:
  DEVICE=PROFILE       Desired device to profile mapping

optional arguments:
  -h, --help           show this help message and exit
  --url URL            The URL of your Fritz!Box; default: http://fritz.box
  --user USER          Login username; default: empty
  --password PASSWORD  Login password
  --list-devices       List all known devices
  --list-profiles      List all available profiles
  1. Determine the ID of the device, whose profile you want to change
./fritz-switch-profiles.py --password YOURPASSWORD --list-devices

->

LOGGING IN TO FRITZ!BOX AT http://fritz.box...
FETCHING AVAILABLE PROFILES...
FETCHING DEVICES...
FETCHING DEVICE PROFILES...

DEVICE_ID        PROFILE_ID       DEVICE_NAME
landevice5007    filtprof1        android-1234567890123456 [NOT ACTIVE]
landevice6494    filtprof1        my kid's iphone
landevice5006    filtprof2        Chromecast
...
  1. Determine the available profiles
./fritz-switch-profiles.py --password YOURPASSWORD --list-profiles

->

LOGGING IN TO FRITZ!BOX AT http://fritz.box...
FETCHING AVAILABLE PROFILES...
FETCHING DEVICES...
FETCHING DEVICE PROFILES...

PROFILE_ID       PROFILE_NAME
filtprof1        Standard
filtprof2        Gast
filtprof3        Unbeschränkt
filtprof4        Gesperrt
  1. Actually change the profiles
./fritz-switch-profiles.py --password YOURPASSWORD landevice6494=filtprof4

->

LOGGING IN TO FRITZ!BOX AT http://fritz.box...
FETCHING AVAILABLE PROFILES...
FETCHING DEVICES...
FETCHING DEVICE PROFILES...

UPDATING DEVICE PROFILES...
  CHANGING PROFILE OF landevice6494/my kid's iphone TO filtprof4/Gesperrt

Note that you may change the profiles of multiple devices at once by supplying multiple DEVICE=PROFILE pairs on the command line.

Usage as a library

From example.py

from fritz_switch_profiles import FritzProfileSwitch

url = 'http://fritz.box'
user = ''
password = 'mysecurepassword'

fps = FritzProfileSwitch(url, user, password)
devices = fps.get_devices()
profiles = fps.get_profiles()

fps.print_devices()
fps.print_profiles()

profile_for_device = [devices[0]['id1'], profiles[2]['id']]

fps.set_profiles(profile_for_device)

Known Issues

  • Non-uniquely named devices may confuse the script.

License

MIT © 2018 Florian Pigorsch & contributors

Release files for fritz-switch-profiles 1.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fritz-switch-profiles 1.1.5
File Size Uploaded
fritz-switch-profiles-1.1.5.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fritz-switch-profiles 1.1.5
File Interpreter ABI Platform
fritz_switch_profiles-1.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 15.8 kB

Release files / fritz-switch-profiles-1.1.5.tar.gz

Download URL fritz-switch-profiles-1.1.5.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1571606c88db9b615a98182a3a365b9ef057cea5a243ae7c88f916d9b88a4e3b
BLAKE2b-256 checksum
How to use checksums
95a2430c0eb97e49a106b2929d86590465b140bdfcb0acc819615e3f7e45386b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.11

Release files / fritz_switch_profiles-1.1.5-py3-none-any.whl

Download URL fritz_switch_profiles-1.1.5-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8db19f5d76f9e81757c81923e5fe19eb6d41754a62ce332a8f05aafc0d33b46e
BLAKE2b-256 checksum
How to use checksums
fc54c75ea3151197b983a9bd96698125fe52d074ea984a6266e677380d540b31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.11

Release history Release notifications | RSS feed

This release

1.1.5 This release

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page