myTselection / telenet_telemeter

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

Missing Sensor #27

Closed unbekannt963 closed 1 year ago

unbekannt963 commented 1 year ago

I am trying to set up the Telenet telemeter integration. I think i am already using the new backend. I can log into the account via telenet website without a problem so email and password is correct. My problem is, that the integration doesn't provide the telemeter sensor.

I don't know if i'm doing something wrong so here are my latest steps:

  1. I've installed the integration trough HACS
  2. restarded Home Assistant (also did a restart of the system to make sure)
  3. Provided my email (as the old username isn't accepted anymore) and the correct password
  4. [no sensor availlable]
  5. restarded home assistant again, to make sure it's not another error, also hardware restart
  6. [Still not the sensor availlable]

Information:

  1. I do not have a mobile contract, so i've excluded it while setup
  2. My Home Assistant server is running in Germany, but as i can access the telenet client service website without a problem, i can change router settings and everything else from germany so i don't think it's geoblocked. I know, the API isn't equal to the Website but I don't see a reason why they should geoblock the API but not the website.
  3. I've tried it with a lot of versions by now and am now running 1.0.0
  4. I am running Home Assistant OS on an old PC

Greetings from Germany!

myTselection commented 1 year ago

Hi, any error visible in the log file?

unbekannt963 commented 1 year ago

I'm sorry, haven't had the time to share it with you.

Quick Sidenote: Updated to Supervisor version 2023.4 30min ago. Still not working

I hope it's the correct log file, as I'm pretty new to Home Assistant and have not quite figured everything out. As i understand it, there are multiple errors. I think it's more helpful for you to see the whole log entry so here it is:

Logger: homeassistant.components.sensor
Source: custom_components/telenet_telemeter/utils.py:60
Integration: Sensor (documentation, issues)
First occurred: 10:35:11 (1 occurrences)
Last logged: 10:35:11

Error while setting up telenet_telemeter platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/telenet_telemeter/sensor.py", line 118, in async_setup_entry
    await dry_setup(hass, config, async_add_devices)
  File "/config/custom_components/telenet_telemeter/sensor.py", line 51, in dry_setup
    await data_internet._forced_update()
  File "/config/custom_components/telenet_telemeter/sensor.py", line 153, in _forced_update
    await self._hass.async_add_executor_job(lambda: self._session.login(self._username, self._password))
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/telenet_telemeter/sensor.py", line 153, in <lambda>
    await self._hass.async_add_executor_job(lambda: self._session.login(self._username, self._password))
  File "/config/custom_components/telenet_telemeter/utils.py", line 76, in login
    self.callTelenet("https://api.prd.telenet.be/ocapi/oauth/userdetails","login", None, 200)
  File "/config/custom_components/telenet_telemeter/utils.py", line 60, in callTelenet
    assert response.status_code == expectedStatusCode
AssertionError
myTselection commented 1 year ago

Hi, it still seems to fail at the login. Could you change your password via the Telenet site and try with new password? Maybe some special characters in the password result in this strange behaviour. Some other user reported some similar strange behaviour too, but so far no root cause was found for this...

If you want to get more details, you could enable debug logging via configuration.yaml:

logger:
  default: info
  logs:
     cusomt_components.telenet_telemeter: debug
unbekannt963 commented 1 year ago

I've now changed the password to only use numbers and letters. Still not working for me. Have added the detailed logger in my configuration.yaml but i honestly have no idea where to find the detailed logs. As always, I've hardware-restarded Home Assistant just to make sure.

I don't see a change in the logs but maybe I'm missing something so here they are again:

Logger: homeassistant.components.sensor
Source: custom_components/telenet_telemeter/utils.py:60
Integration: Sensor (documentation, issues)
First occurred: 12:23:10 (1 occurrences)
Last logged: 12:23:10

Error while setting up telenet_telemeter platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/telenet_telemeter/sensor.py", line 118, in async_setup_entry
    await dry_setup(hass, config, async_add_devices)
  File "/config/custom_components/telenet_telemeter/sensor.py", line 51, in dry_setup
    await data_internet._forced_update()
  File "/config/custom_components/telenet_telemeter/sensor.py", line 153, in _forced_update
    await self._hass.async_add_executor_job(lambda: self._session.login(self._username, self._password))
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/telenet_telemeter/sensor.py", line 153, in <lambda>
    await self._hass.async_add_executor_job(lambda: self._session.login(self._username, self._password))
  File "/config/custom_components/telenet_telemeter/utils.py", line 76, in login
    self.callTelenet("https://api.prd.telenet.be/ocapi/oauth/userdetails","login", None, 200)
  File "/config/custom_components/telenet_telemeter/utils.py", line 60, in callTelenet
    assert response.status_code == expectedStatusCode
AssertionError
myTselection commented 1 year ago

very strange. I have no idea why the login keeps on failing for you... :(