kbr / fritzconnection

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

NewX_AVM properties not available on older Fritz!OS #82

Closed m0wlheld closed 3 years ago

m0wlheld commented 3 years ago

Can you please have a look at https://github.com/home-assistant/core/issues/43518? This library is used by Home Assistant‘s fritz_netmonitor component and currently broken because apparently the NewX_AVM properties are not available on older Fritz!OS versions < 7.

Maybe it‘s possible to read another value for OS < 7 or at least report a value indicating an error (like -1)?

I posted an output of the device capabilities of an older FritzBox here.

Problematic for example at this line

m0wlheld commented 3 years ago

My assumption is, that for the absence of NewX_ properties for total bytes sent/received the following properties should be used:

    <action>
        <name>GetAddonInfos</name>
        <argumentList>
            [...]
            <argument>
                <name>NewTotalBytesSent</name>
                <direction>out</direction>
                <relatedStateVariable>TotalBytesSent</relatedStateVariable>
            </argument>
            <argument>
                <name>NewTotalBytesReceived</name>
                <direction>out</direction>
                <relatedStateVariable>TotalBytesReceived</relatedStateVariable>
            </argument>
            [...]
        </argumentList>
    </action>
m0wlheld commented 3 years ago

Obviously, the change/error was introduced with this commit. The attributes for older Fritz!OS versions are matched by my assumption above.

kbr commented 3 years ago

Yes, this seems to be a backward incompatibility introduced with version 1.3.0. The change fixed an integer overflow on reporting the accumulated traffic with a new FritzOS feature introduced for exactly this reason by AVM.

This should get fixed with the next release.

m0wlheld commented 3 years ago

Nice, thanks. I can contribute idggdesc.xml, tr64desc.xml and igdconnSCPD.xml of a Fritz!Box 7270v3 using FritzOS 6.06, would you like?

kbr commented 3 years ago

Thank you, but I don't need these files.

kbr commented 3 years ago

Fixed with 1.4.1