Disable internet connection of specific echo device on fritz box via script

Disable internet connection of specific echo device on fritz box via script

  1. Create an access profile for the echo device
    1.1 FRITZ!Box Web UI -> Internet -> Filter -> Access Profiles -> New Access Profile

  2. Map the access profile to the echo device
    2.1 FRITZ!Box Web UI -> Internet -> Filter -> Parental Control

  3. Get the access profile id
    3.1 Open the web developer tools - network monitor on Firefox (F12 -> Network)
    3.2 Edit the access profile created in step 1
    3.4 Select the first POST request with the file data.lua
    3.5 Select parameters of the request
    3.6 Copy the value of the „edit“ parameter (example filtprof1234)

  4. Run the attached script with the following parameters
    enable internet connection of the echo device -> fritzboxprofile.sh [ip] [password] [profileid] unlimited
    disable internet connection of the echo device -> fritzboxprofile.sh [ip] [password] [profileid] never

Example for openHAB


Group:Switch:OR(ON,OFF) echoanaus "Alle Echos" ["Switchable"]

Switch echoesszimmeranaus "Echo Esszimmer" (echoanaus) ["Switchable"]


rule "echoesszimmeranaus"
	Item echoesszimmeranaus changed
	createTimer(now) [|
		if (echoesszimmeranaus.state == OFF) {
			executeCommandLine("/etc/openhab2/scripts/fritzboxprofile.sh fritzboxpasswort filtprof1234 never", 5000)
		} else {
			executeCommandLine("/etc/openhab2/scripts/fritzboxprofile.sh fritzboxpasswort filtprof1234 unlimited", 5000)
  1. Search for the devices in the alexa app
  2. Say „Alexa, schalte Echo Esszimmer aus“ or „Alexa, schalte Alle Echos aus“
  3. Add the item to the sitemap to enable an echo device



challenge=$(curl -s "http://$1/login_sid.lua?username=" | grep -Po '(?<=<Challenge>).*?(?=</Challenge>)')
md5=$(echo -n ${challenge}"-"$2 | iconv -f ISO8859-1 -t UTF-16LE | md5sum -b | awk '{print substr($0,1,32)}') 
sid=$(curl -i -s -k -d "response=${response}&username=" "http://$1" | grep -Po -m 1 '(?<=sid=)[a-f\d]+' | tail -1)

curl -d "sid=${sid}&edit=$3&time=$4&budget=unlimited&apply=&page=kids_profileedit" "http://$1/data.lua" >/dev/null 2>&1


  1. https://administrator.de/wissen/informationen-webinterface-fritzbox-shellscript-auslesen-214598.html
  2. https://www.kuketz-blog.de/fritzbox-wlan-toggle-per-skript/

Only tested with FRITZ!Box 7590
Tested on RaspberryPi


Can i use this for OH3?
what do I have to convert?


it still works like it is for OH3.


Hi, in case anybody else wonders: with the latest 7.25 firmware there is a default username for the standard fritzbox admin user. Check it out in the fritzbox gui and add it behind ‘username=’ in the fritzbox.sh script. Took me few minutes to figure that one out…


Thanks for the solution!

I am still using this script and had to make some updates in recent FritzOS (7.39 in my case).
Previously, extracting the SID was done with this

grep -Po -m 1 '(?<=sid=)[a-f\d]+' | tail -1

I had to change it to that and it works again

grep -Po -m 1 '(?<=sid\":\")[a-f\d]+' | tail -1
1 Like