myTselection / telenet_telemeter

Telenet Telemeter Home Assistant custom component HACS for Belgian ISP and mobile phone network traffic.
MIT License
28 stars 5 forks source link

reporting wrongly used_percentage #24

Closed carloalbrile closed 1 year ago

carloalbrile commented 1 year ago

After installing version 0.9.3 these are the reported values. When time permits could you please advise what may be the issue or what inf. can I contribute to understand and solve the issue? Thanks,

attribution: Telenet Telemeter last update: '2023-03-24T17:06:00' used_percentage: 0 included_volume: 0 extended_volume: 0 total_volume: 0 wifree_usage: 0 includedvolume_usage: 0 extendedvolume_usage: 0 peak_usage: 0 offpeak_usage: 0 sequeezed: false period_start: '2023-03-08T00:00:00' period_end: '2023-04-07T00:00:00' period_days_left: 13.28 period_used_percentage: 55.7 product: Basic Internet download_speed: 0 upload_speed: 0 telemeter_json: internet: category: CAP specurl: https://api.prd.telenet.be/omapi/public/product/INTB0000 daysUntil: '14' validity: '2023-04-08T12:00:00.000Z' allocatedUsage: units: 175 usedUnits: 79.71 remainingUnits: 95.29 unitType: GB usedPercentage: '45.00' lastUsageDate: '2023-03-24T17:06:00' extendedUsage: eligibleToBuy: true volumeBlocks: '1' specurl: https://api.prd.telenet.be/omapi/public/product/IOPT0002 volume: 25 unit: GB price: '5.00' currency: EUR wifreeUsage: usedUnits: 0 unitType: GB totalUsage: units: 79.71 unitType: GB lastUsageDate: '2023-03-24T17:06:00' peakUsage: usedUnits: 0 startDate: '2023-03-08' endDate: '2023-04-07' productIdentifier: z123456 unit_of_measurement: '%' icon: mdi:check-network-outline friendly_name: Telenet Telemeter internet z123456

myTselection commented 1 year ago

Thanks for sharing these details. It's the first time I see the telenet data for a user connected to the new Telenet backend while not having an unlimited subscription. I expected the 'peakUsage' element would only be available for unlimited subscriptions, but apparently you still have this element. So a change will be required to make sure the correct data elements are retrieved for this case.

myTselection commented 1 year ago

Could you try latest release 0.9.4, I expect this would fix your case.

carloalbrile commented 1 year ago

Hello,

Thank you for your prompt replay. I have installed v 0.9.4.

Below is the outcome. In place of userd_percentage could we use the parameters?

allocatedUsage:
  units: 175
  usedUnits: 83.26
  remainingUnits: 91.74
  unitType: GB
  usedPercentage: '47.00'

attribution: Telenet Telemeter last update: null used_percentage: 0 included_volume: 0 extended_volume: 0 total_volume: 0 wifree_usage: 0 includedvolume_usage: 0 extendedvolume_usage: 0 peak_usage: 0 offpeak_usage: 0 sequeezed: false period_start: null period_end: null period_days_left: 0 period_used_percentage: 0 product: null download_speed: 0 upload_speed: 0 telemeter_json: internet: category: CAP specurl: https://api.prd.telenet.be/omapi/public/product/INTB0000 daysUntil: '13' validity: '2023-04-08T12:00:00.000Z' allocatedUsage: units: 175 usedUnits: 83.26 remainingUnits: 91.74 unitType: GB usedPercentage: '47.00' lastUsageDate: '2023-03-25T11:04:00' extendedUsage: eligibleToBuy: true volumeBlocks: '1' specurl: https://api.prd.telenet.be/omapi/public/product/IOPT0002 volume: 25 unit: GB price: '5.00' currency: EUR wifreeUsage: usedUnits: 0 unitType: GB totalUsage: units: 83.26 unitType: GB lastUsageDate: '2023-03-25T11:04:00' peakUsage: usedUnits: 0 startDate: '2023-03-08' endDate: '2023-04-07' productIdentifier: z917859 unit_of_measurement: '%' icon: mdi:check-network-outline friendly_name: Telenet Telemeter internet zxxxxxx Bye,

Carlo

On Fri, 24 Mar 2023 at 22:29, myT @.***> wrote:

Could you try latest release 0.9.4, I expect this would fix your case.

— Reply to this email directly, view it on GitHub https://github.com/myTselection/telenet_telemeter/issues/24#issuecomment-1483425650, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQWZ6SXJZP5LDBA3WZPPQ63W5YG47ANCNFSM6AAAAAAWGZXW4E . You are receiving this because you authored the thread.Message ID: @.***>

myTselection commented 1 year ago

strange, I see the 'last update' is still null, while this data was available in the response of Telenet. Do you see any other exception in the log? Could you restart with debug enabled and share anonymized logs? to get debug log, you'll have to add below in configuration.yaml and restart HA:

logger:
  default: debug
carloalbrile commented 1 year ago

Hello,

Nice of you to help sort this out. Please let me know if you need more data.

It was the first time I opened the home-assistant.log file. There is so much information in there. My file is quite big so difficult and slow to open.

I managed to find a portion that should be what you are interested in. "2023-03-27 17:51:08.096 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorInternet _last_update: 2023-03-27T17:34:00

2023-03-27 17:51:08.096 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorInternet _product: Basic Internet

2023-03-27 17:51:08.096 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorInternet _period_start_date: 2023-03-08 00:00:00

2023-03-27 17:51:08.096 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorInternet _period_end_date: 2023-04-07 00:00:00

2023-03-27 17:51:08.096 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorInternet tz_info: None

2023-03-27 17:51:08.096 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorInternet end date: 2023-04-07 00:00:00 - now 2023-03-27 17:51:08.096911 = perdiod_left 10.26, self._period_length 2592000.0

2023-03-27 17:51:08.097 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] specifications: [{'labelkey': 'spec.fixedinternet.volume.download.cap', 'value': '150', 'unit': 'GB', 'visible': True, 'weight': '10', 'localizedcontent': [{'locale': 'en', 'name': 'Downloadlimiet(en)'}, {'locale': 'nl', 'name': 'Downloadlimiet'}, {'locale': 'fr', 'name': 'Limite de téléchargement'}]}, {'labelkey': 'spec.fixedinternet.mailbox.volume', 'value': '5', 'unit': 'GB', 'visible': True, 'weight': '20', 'localizedcontent': [{'locale': 'en', 'name': 'Per mailbox(en)'}, {'locale': 'nl', 'name': 'Per mailbox'}, {'locale': 'fr', 'name': 'Par boîte e-mail'}]}, {'labelkey': 'spec.fixedinternet.webspace.volume', 'value': '1', 'unit': 'GB', 'visible': True, 'weight': '30', 'localizedcontent': [{'locale': 'en', 'name': 'Webruimte van(en)'}, {'locale': 'nl', 'name': 'Webruimte van'}, {'locale': 'fr', 'name': 'Espace Web de'}]}, {'labelkey': 'spec.fixedinternet.speed.download', 'value': '240', 'unit': 'Mbps', 'visible': True, 'weight': '40', 'localizedcontent': [{'locale': 'en', 'name': 'Downloadsnelheid: tot(en)'}, {'locale': 'nl', 'name': 'Downloadsnelheid: tot'}, {'locale': 'fr', 'name': "Vitesse de téléchargement : jusqu'à"}]}, {'labelkey': 'spec.fixedinternet.speed.upload', 'value': '30', 'unit': 'Mbps', 'visible': True, 'weight': '50', 'localizedcontent': [{'locale': 'en', 'name': 'Uploadsnelheid: tot(en)'}, {'locale': 'nl', 'name': 'Uploadsnelheid: tot'}, {'locale': 'fr', 'name': "Vitesse d'envoi: jusqu'à"}]}, {'labelkey': 'spec.fixedinternet.mailbox.included', 'value': '10', 'visible': True, 'weight': '60', 'localizedcontent': [{'locale': 'en', 'name': 'Mailboxes'}, {'locale': 'nl', 'name': 'Mailboxen'}, {'locale': 'fr', 'name': 'Boîtes e-mail'}]}]

2023-03-27 17:51:08.097 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] productdetails: {'labelkey': 'spec.fixedinternet.volume.download.cap', 'value': '150', 'unit': 'GB', 'visible': True, 'weight': '10', 'localizedcontent': [{'locale': 'en', 'name': 'Downloadlimiet(en)'}, {'locale': 'nl', 'name': 'Downloadlimiet'}, {'locale': 'fr', 'name': 'Limite de téléchargement'}]}

2023-03-27 17:51:08.097 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] productdetails: {'labelkey': 'spec.fixedinternet.mailbox.volume', 'value': '5', 'unit': 'GB', 'visible': True, 'weight': '20', 'localizedcontent': [{'locale': 'en', 'name': 'Per mailbox(en)'}, {'locale': 'nl', 'name': 'Per mailbox'}, {'locale': 'fr', 'name': 'Par boîte e-mail'}]}

2023-03-27 17:51:08.097 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] productdetails: {'labelkey': 'spec.fixedinternet.webspace.volume', 'value': '1', 'unit': 'GB', 'visible': True, 'weight': '30', 'localizedcontent': [{'locale': 'en', 'name': 'Webruimte van(en)'}, {'locale': 'nl', 'name': 'Webruimte van'}, {'locale': 'fr', 'name': 'Espace Web de'}]}

2023-03-27 17:51:08.097 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] productdetails: {'labelkey': 'spec.fixedinternet.speed.download', 'value': '240', 'unit': 'Mbps', 'visible': True, 'weight': '40', 'localizedcontent': [{'locale': 'en', 'name': 'Downloadsnelheid: tot(en)'}, {'locale': 'nl', 'name': 'Downloadsnelheid: tot'}, {'locale': 'fr', 'name': "Vitesse de téléchargement : jusqu'à"}]}

2023-03-27 17:51:08.097 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] productdetails: {'labelkey': 'spec.fixedinternet.speed.upload', 'value': '30', 'unit': 'Mbps', 'visible': True, 'weight': '50', 'localizedcontent': [{'locale': 'en', 'name': 'Uploadsnelheid: tot(en)'}, {'locale': 'nl', 'name': 'Uploadsnelheid: tot'}, {'locale': 'fr', 'name': "Vitesse d'envoi: jusqu'à"}]}

2023-03-27 17:51:08.097 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] productdetails: {'labelkey': 'spec.fixedinternet.mailbox.included', 'value': '10', 'visible': True, 'weight': '60', 'localizedcontent': [{'locale': 'en', 'name': 'Mailboxes'}, {'locale': 'nl', 'name': 'Mailboxen'}, {'locale': 'fr', 'name': 'Boîtes e-mail'}]}

2023-03-27 17:51:08.097 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorPeak _wifree_usage: 0.0

2023-03-27 17:51:08.097 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorPeak _includedvolume_usage: 93.55

2023-03-27 17:51:08.097 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorPeak _extendedvolume_usage: 25.0

2023-03-27 17:51:08.098 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorPeak _download_speed: 240 Mbps

2023-03-27 17:51:08.098 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorPeak _upload_speed: 30 Mbps

2023-03-27 17:51:08.098 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorPeak _squeezed: False

2023-03-27 17:51:08.098 DEBUG (MainThread) [custom_components.telenet_telemeter.sensor] SensorPeak _peak: True 2023-03-27 17:51:08.098 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.telenet_telemeter_internet_z012345 fails" Bye,

Carlo

On Sun, 26 Mar 2023 at 16:00, myT @.***> wrote:

strange, I see the 'last update' is still null, while this data was available in the response of Telenet. Do you see any other exception in the log? Could you restart with debug enabled and share anonymized logs? to get debug log, you'll have to add below in configuration.yaml and restart HA:

logger: default: debug

— Reply to this email directly, view it on GitHub https://github.com/myTselection/telenet_telemeter/issues/24#issuecomment-1484105061, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQWZ6SV6FLBHIQVNERL7GPLW6BKXVANCNFSM6AAAAAAWGZXW4E . You are receiving this because you authored the thread.Message ID: @.***>

myTselection commented 1 year ago

Hi Carlo, thx for the log. Based on this, I see no direct failure in the component itself, but within HA sensor update. Could you try updating to latest HA version? seems like a more general issue not directly bound to this component...

teranex commented 1 year ago

I have a very similar situation. For the past 10 to 20 days my usage has been (and still is) stuck at 13.3% (while the days left still count down correctly). Since I saw issues over here discussing the change to the new backend I suspected that was the problem (I was already switched as I had the new My Telenet), but I'm running the latest version of HA and this integration and it still shows the same percentage. When I look at My Telenet I see a higher usage. However I suspect this might be a problem in the new Telenet backend...

myTselection commented 1 year ago

and do you see any error or exception in the logs that you can share?

krisconinx commented 1 year ago

I have just checked the info of this integration vs info from My Telenet app and there is indeed a delta.

Seems that only peak usage is available in the attributes, but it differs than the value in My Telenet.

IMG_6435 IMG_6436 IMG_6437

teranex commented 1 year ago

I just rebooted my HA because of an update, but now the percentage is showing 0. However in the json I now see correct values, although the json seems shorter than before.

20230329_001 20230329_002

20230329_003

myTselection commented 1 year ago

@krisconinx Such distinction is possible: there is throttling setup in the component, in order to limit the number of requests going to Telenet. (I fear if too many very frequent requests would be launched, they may block this component someday) So that explains the distinction in your first screenshots (having peak 287GB). The throttling is currently set to update the sensor data with Telenet data every 15min. So that also means there is a local caching of the data. If the Telenet backend returns some errors (eg timeouts), the last data available in the component might still be shown for a longer period than 15min. But overal, it shows that it has worked correctly recently. So I guess some Telenet backend instability is causing the issue for now, not a bug in the component.

myTselection commented 1 year ago

Thanks for your input, I've created a new release 0.9.5, I hope it will solve your case.

carloalbrile commented 1 year ago

Hello,

Thank you for persistence and finding the right way to make use of all the different casa of TELENET. I contact does not monitor peak usage. Let me know if you need any other inf or eventually to test other versions. Version 0.9.5 works fine for me.

[image: image.png] Bye,

Carlo

On Sun, 2 Apr 2023 at 14:06, myT @.***> wrote:

Thanks for your input, I've created a new release 0.9.5, I hope it will solve your case.

— Reply to this email directly, view it on GitHub https://github.com/myTselection/telenet_telemeter/issues/24#issuecomment-1493314234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQWZ6SQYAQ57EDJZQPCLJDLW7FTVNANCNFSM6AAAAAAWGZXW4E . You are receiving this because you authored the thread.Message ID: @.***>

teranex commented 1 year ago

@myTselection thx for the update! for me this seems to have fixed it so far. It's a bit difficult to say since the month is only 2 days old, but now at least it shows 0.79% used instead of 0% so that's a good sign already :).