Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

callTelenet failed en other errors #54

Open
screenagerbe opened this issue Nov 9, 2024 · 2 comments
Open

callTelenet failed en other errors #54

screenagerbe opened this issue Nov 9, 2024 · 2 comments

Comments

@screenagerbe
Copy link

Current situation:
As of 07-11-2024 00:05 my HA instance cannot poll the Telenet api anymore.
image

Remarks:

  • Our Telenet subscription starts at the 7th of the month, so the values are reset each month on the 7th at 00:05.
  • Reloading the integration results in the same error
  • Removing and reinstalling the integration results also in the same error

Error in the log files after reloading/installing the Telenet Integration:

This error originated from a custom integration.

Logger: custom_components.telenet_telemeter.utils
Source: custom_components/telenet_telemeter/utils.py:83
integration: Telenet Telemeter (documentation, issues)
First occurred: 07:27:50 (2 occurrences)
Last logged: 07:27:50

callTelenet failed, trying once more:
Logger: homeassistant.components.switch
Source: helpers/entity_platform.py:365
integration: Switch (documentation, issues)
First occurred: 07:27:50 (1 occurrences)
Last logged: 07:27:50

Error while setting up telenet_telemeter platform for switch
Traceback (most recent call last):
  File "/config/custom_components/telenet_telemeter/utils.py", line 81, in callTelenet
    assert response.status_code == expectedStatusCode
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 365, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/telenet_telemeter/switch.py", line 26, in async_setup_entry
    await data.force_update()
  File "/config/custom_components/telenet_telemeter/switch.py", line 143, in force_update
    await self._hass.async_add_executor_job(lambda: self._session.login(self._username, self._password))
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/telenet_telemeter/switch.py", line 143, 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 119, in login
    self.callTelenet("https://api.prd.telenet.be/ocapi/oauth/userdetails","login")
  File "/config/custom_components/telenet_telemeter/utils.py", line 103, in callTelenet
    assert response.status_code == expectedStatusCode
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:365
integration: Sensor (documentation, issues)
First occurred: 07:27:50 (1 occurrences)
Last logged: 07:27:50

Error while setting up telenet_telemeter platform for sensor
Traceback (most recent call last):
  File "/config/custom_components/telenet_telemeter/utils.py", line 81, in callTelenet
    assert response.status_code == expectedStatusCode
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 365, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/telenet_telemeter/sensor.py", line 121, in async_setup_entry
    await dry_setup(hass, config, async_add_devices)
  File "/config/custom_components/telenet_telemeter/sensor.py", line 52, in dry_setup
    await data_internet._forced_update()
  File "/config/custom_components/telenet_telemeter/sensor.py", line 170, in _forced_update
    await self._hass.async_add_executor_job(lambda: self._session.login(self._username, self._password))
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/telenet_telemeter/sensor.py", line 170, 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 119, in login
    self.callTelenet("https://api.prd.telenet.be/ocapi/oauth/userdetails","login")
  File "/config/custom_components/telenet_telemeter/utils.py", line 103, in callTelenet
    assert response.status_code == expectedStatusCode
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

I've got the suspicion Telenet has changed something, but I do not know what exactly

@myTselection
Copy link
Owner

Thx for reporting. I see similar issue in my own sensor now, probably some changes in Telenet API. Will have to investigate...

@myTselection
Copy link
Owner

authentication scheme changes, will require to redo the reverse engineering to simulate this new authentication scheme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants