belzetrigger / domoticz-FritzBox

Plugin that adds your Fritz!Box router as a device to domoticz
MIT License
3 stars 1 forks source link

Error on readStatus: msg ''NewX_AVM_DE_TotalBytesSent64''; #4

Open joro75 opened 4 years ago

joro75 commented 4 years ago

I updated the plugin to version 0.6.4.

However, now an error related to 'NewX_AVM_DE_TotalBytesSent64' is shown. The Domoticz Log contains:

2020-04-30 21:35:03.230 (Fritz!Box Plugin) Processing 'onHeartbeatCallback' message 2020-04-30 21:35:03.230 (Fritz!Box Plugin) Calling message handler 'onHeartbeat'. 2020-04-30 21:35:03.230 (Fritz!Box Plugin) onHeartbeat called 2020-04-30 21:35:03.230 (Fritz!Box Plugin) ---------------------------------------------------- 2020-04-30 21:35:03.230 (Fritz!Box Plugin) read status for fritz.box 2020-04-30 21:35:03.624 (Fritz!Box Plugin) model = FRITZ!Box Fon WLAN 7390 is_linked = True is_connected = True external_ip = xxx.xxx.xxx.xxx uptime = 14:03:38 max_bit_rate = ('953.7 MBit/s', '953.7 MBit/s') received = 0.0 Byte sent = 0.0 Byte delta received = 0.0 Byte delta sent = 0.0 Byte 2020-04-30 21:35:03.625 (Fritz!Box Plugin) Error and threshold reached -> so show error on devices 2020-04-30 21:35:03.625 (Fritz!Box Plugin) BLZ: Remains Unchanged 2020-04-30 21:35:03.625 (Fritz!Box Plugin) BLZ: Remains Unchanged 2020-04-30 21:35:03.625 (Fritz!Box Plugin) ---------------------------------------------------- 2020-04-30 21:35:03.624 Error: (Fritz!Box Plugin) Error on readStatus: msg ''NewX_AVM_DE_TotalBytesSent64''; hasError:True 2020-04-30 21:35:03.624 Error: (Fritz!Box Plugin) Uuups (Fritz!Box). Something went wrong ... Shouldn't be here.

My Fritz!Box version (a WLAN 7390) is 06.86.

I'm not sure, but I'm afraid that my version doesn't support the new 'NewX_AVM_DE_TotalBytesSent64'. Is it possible to include a detection if the key is present, and if it isn't, fallback to the old code that retrieves the transmitted/received bytes?

joro75 commented 4 years ago

I determined the value of 's' from FritzBoxHelper::getBytesFromAddOn()

{'NewByteSendRate': 14110, 'NewByteReceiveRate': 897332, 'NewPacketSendRate': 0, 'NewPacketReceiveRate': 0, 'NewTotalBytesSent': 3565879721, 'NewTotalBytesReceived': 47906525246, 'NewAutoDisconnectTime': 0, 'NewIdleDisconnectTime': 1, 'NewDNSServer1': 'xxx.xxx.xxx.xxx, 'NewDNSServer2': 'xxx.xxx.xxx.xxx', 'NewVoipDNSServer1': 'xxx.xxx.xxx.xxx', 'NewVoipDNSServer2': 'xxx.xxx.xxx.xxx', 'NewUpnpControlEnabled': False, 'NewRoutedBridgedModeBoth': 1}

The 'NewX_AVM_DE_TotalBytesSent64' key is not present in this dictionary.

An interesting fact is however, that a 'NewTotalBytesSent' and a 'NewTotalBytesReceived' key is present, and the 'NewTotalBytesReceived' value is bigger than a 32bit Integer, so that seems to be a 64bit value. Those values are also increasing during the next 5 minutes with reasonable values.

PS: I'm working on a patch.

joro75 commented 4 years ago

I'm currently using the plugin including the patch from the PR #5, and this doesn't raise an error anymore. Also expected transfer sizes are being shown in Domoticz.