kbr / fritzconnection

Python-Tool to communicate with the AVM Fritz!Box by the TR-064 protocol and the AHA-HTTP-Interface
MIT License
303 stars 59 forks source link

FritzStatus: values expressed in dB multiplied by 10? Is that correct? #120

Closed energywave closed 2 years ago

energywave commented 2 years ago

If I get info about the WAN status using fc.call_action("WANDSLInterfaceConfig:1", "GetInfo") or i get FritzStatus object, every value expressed in dB (power attenuation and noise margin for down and uplink) are multiplied by 10 if I compare them to what I get looking in the router web interface. As an example please observe the result of the call_action and the values on the web page, collected at the same moment:

>>> fc.call_action('WANDSLInterfaceConfig:1', 'GetInfo')
{'NewEnable': True, 'NewStatus': 'Up', 'NewDataPath': 'Fast', 'NewUpstreamCurrRate': 15430, 'NewDownstreamCurrRate': 49078, 'NewUpstreamMaxRate': 15908, 'NewDownstreamMaxRate': 49078, 'NewUpstreamNoiseMargin': 60, 'NewDownstreamNoiseMargin': 50, 'NewUpstreamAttenuation': 280, 'NewDownstreamAttenuation': 190, 'NewATURVendor': '41564d00', 'NewATURCountry': '0400', 'NewUpstreamPower': 498, 'NewDownstreamPower': 515}

And here the values on the web page: image

Is that expected? In that case I suggest you to update the doc to say that dB values are expressed in tenth of a dB. If that's not expected maybe that value should be exposed as dB by dividing by 10 the values read from the router. If that's not maybe a problem in the reply of the router. If, for example, they're localized in italian regional settings the decimal separator here is "," and the thousand separator ".", the opposite of the english regional settings. That could maybe lead to interpret a reply of "5,0" as a "50" if using english settings.

I'm using a Fritzbox 7590 with latest Fritz!OS 7.27 and configured in Italian language.

energywave commented 2 years ago

@kbr can you please check this? Fritz official integration latest update that should be live in September depends on it.

kbr commented 2 years ago

Unfortunately this seems to be not very good documented by AVM, at least regarding the units of the returned values.

In my case I have activated the english settings and the results are the same as in italian. The reported values at the web-frontend are 6, 10, 15 and 16 db. So it seems the box returns all values in tenth of db.

>>> fc.call_action('WANDSLInterfaceConfig:1', 'GetInfo')
{'NewEnable': True,
 'NewStatus': 'Up',
 'NewDataPath': 'Fast',
 'NewUpstreamCurrRate': 46716,
 'NewDownstreamCurrRate': 116790,
 'NewUpstreamMaxRate': 46805,
 'NewDownstreamMaxRate': 131252,
 'NewUpstreamNoiseMargin': 60,
 'NewDownstreamNoiseMargin': 100,
 'NewUpstreamAttenuation': 150,
 'NewDownstreamAttenuation': 160,
  ...
 'NewUpstreamPower': 502,
 'NewDownstreamPower': 511}

Hardware and OS are the same as yours: 7590 with 7.27

chemelli74 commented 2 years ago

Hi, updating code from HA side to divide per 10.

Simone