Giter Club home page Giter Club logo

Comments (5)

KillianMeersman avatar KillianMeersman commented on August 18, 2024

Hi,

Can't say I've seen this issue before. What type of Telenet subscription are you on? So far I have only tested this with a private Fiber200 subscription, it's possible others require a different flow.

I've pushed an update that adds some basic logging. Can you please enable debug-level logging using something like logging.basicConfig(level=logging.DEBUG), re-run, and post the logs here? There shouldn't be any personal information in them but please double check.

from telemeter.

patvdheyden avatar patvdheyden commented on August 18, 2024

Hy Killian,

Thx for the fast reply

I'm currently testing the program on a Basic internet subscription and i use Pycharm as IDE.
I've added this to my program:

import logging
logging.basicConfig(filename='debug.log', filemode='w', level=logging.DEBUG)

And i'm getting this as a result:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.prd.telenet.be:443
DEBUG:urllib3.connectionpool:https://api.prd.telenet.be:443 "GET /ocapi/oauth/userdetails HTTP/1.1" 401 77
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): login.prd.telenet.be:443
DEBUG:urllib3.connectionpool:https://login.prd.telenet.be:443 "GET /openid/oauth/authorize?client_id=ocapi&response_type=code&claims=%7B%22id_token%22%3A%7B%22http%3A%2F%2Ftelenet.be%2Fclaims%2Froles%22%3Anull%2C%22http%3A%2F%2Ftelenet.be%2Fclaims%2Flicenses%22%3Anull%7D%7D&lang=nl&state=ab77e9d3-5625-4e7f-b892-742f24053544&nonce=65512632-c2dc-451d-9639-595ecd52f868&prompt=login HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://login.prd.telenet.be:443 "GET /openid/login HTTP/1.1" 200 5365
DEBUG:urllib3.connectionpool:https://login.prd.telenet.be:443 "POST /openid/login.do HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://login.prd.telenet.be:443 "GET /openid/oauth/authorize?client_id=ocapi&response_type=code&claims=%7B%22id_token%22%3A%7B%22http%3A%2F%2Ftelenet.be%2Fclaims%2Froles%22%3Anull%2C%22http%3A%2F%2Ftelenet.be%2Fclaims%2Flicenses%22%3Anull%7D%7D&lang=nl&state=ab77e9d3-5625-4e7f-b892-742f24053544&nonce=65512632-c2dc-451d-9639-595ecd52f868&prompt=login HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://api.prd.telenet.be:443 "GET /ocapi/oauth/callback?code=iTJeTRHJXf5zpZEtF6M3T4nFYho2dulv&state=ab77e9d3-5625-4e7f-b892-742f24053544 HTTP/1.1" 307 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www2.telenet.be:443
DEBUG:urllib3.connectionpool:https://www2.telenet.be:443 "GET /nl/klantenservice/ HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://api.prd.telenet.be:443 "GET /ocapi/oauth/userdetails HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://api.prd.telenet.be:443 "GET /ocapi/public/?p=internetusage,internetusagereminder HTTP/1.1" 200 13347
DEBUG:telemeter:Parsing telemeter json: {
"producttype": "BI",
"specurl": "https://api.prd.telenet.be/omapi/public/product/555",
"squeezed": false,
"periodstart": "2021-06-11T00:00:00.0+02:00",
"periodend": "2021-07-10T00:00:00.0+02:00",
"includedvolume": 157286400,
"usedpercentage": 13,
"extendedvolume": {
"volume": 0,
"cost": 0.0,
"currency": "EUR"
},
"totalusage": {
"wifree": 0,
"dailyusages": [
{
"date": "2021-06-11T00:00:00.0+02:00",
"wifree": 0,
"included": 8593622,
"extended": 0
},
{
"date": "2021-06-12T00:00:00.0+02:00",
"wifree": 0,
"included": 3596358,
"extended": 0
},
{
"date": "2021-06-13T00:00:00.0+02:00",
"wifree": 0,
"included": 5795865,
"extended": 0
},
{
"date": "2021-06-14T00:00:00.0+02:00",
"wifree": 0,
"included": 2263873,
"extended": 0
}
],
"includedvolume": 20249718,
"extendedvolume": 0
}
}

Current data in the app: 19GB used of 150GB available. So the 13% [used percentage] (12,6667%) seems the right number.
And the number includevolume / 1024 / 1024 = 19.31GB seems also the right number.

Have a nice day,

Patrick

from telemeter.

patvdheyden avatar patvdheyden commented on August 18, 2024

Killian,

I forgot the includedvolume 157286400 /1024/1024 = 150GB and also this seems right.

from telemeter.

KillianMeersman avatar KillianMeersman commented on August 18, 2024

Thanks for the logs.
I've pushed 3.0.6, which should add support for plans without peak/offpeak usage.

Can you update and check if it works for you?

from telemeter.

patvdheyden avatar patvdheyden commented on August 18, 2024

Killian,

Thx for the fast action. It seems to be solved:

"C:\Program Files\Python\python.exe" C:/Users/pvdh/PycharmProjects/readTelenmeterNew/readValue.py
Telemeter for 2021-06-11 00:00:00+02:00 to 2021-07-10 00:00:00+02:00
Usage for BI: 21.87 GiB of 150.00 GiB

Process finished with exit code 0

PS.

Maybe change the usage info to include the print commando? Then is clear for everyone :)
import telemeter

telenet_session = telemeter.TelenetSession()
telenet_session.login("my_username", "my_password")

my_telemeter = telenet_session.telemeter()
print(my_telemeter)

from telemeter.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.