Closed TrevisGordan closed 4 years ago
As you mentioned, this is unrelated to fritzconnection, which is TR-064 based.
As an example to get the "Bandwidth Saturation" please refer to the fritzstatus.py and fritzmonitor.py modules.
Please keep in mind that every web-scraping based solution may break with the next FritzOS release (projects working this way are unstable by design). The only reliable way to communicate with Fritz!Box routers is to use the official APIs published by the vendor: https://avm.de/service/schnittstellen/
["Maybe" unrelated to the overall project]
I just found (at least I think) by coincidence a awesome Goodie. With Fritzconection u can get the current Down-/Upstream to the ISP. But not the "Bandwidth Saturation" which would provide useful information. The Fritzbox has an "Online-Monitor" with a graph for that. I found that the browser makes a simple GET Req to a Url to retrieve that info and build the ajaxgraph every second.
Ok, turns out you need auth for the URL. You need to create a sid for the URL.
For me the URL looks like: "http://fritz.box/internet/inetstat_monitor.lua?sid=[YOUR-SID]&myXhr=1&action=get_graphic&useajax=1&xhr=1&t1569928285267=nocache"
Just go to the Online-Monitor page activate DevTools>Network and you will see the Packages coming in.
It should retrive Data simular to:
where the frist element of
ds_bps_curr
is the current Downstream viseversa tous_default_bps_curr
for upstream.I thought you might like that as well. Implementations for that are limitless. ;)