klejejs / python-thermia-online-api

A Python API for Thermia heat pumps using https://online.thermia.se
GNU General Public License v3.0
23 stars 10 forks source link

Authentification error #35

Open Vovanoso opened 6 days ago

Vovanoso commented 6 days ago

Launching example.py I have got issue Traceback (most recent call last): File "C:\Users\ganet\PycharmProjects\pythonProject\Thermia\Sql\example.py", line 13, in thermia = Thermia(USERNAME, PASSWORD) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ganet\Pycharm\Lib\site-packages\ThermiaOnlineAPI__init.py", line 13, in init__ self.api_interface = ThermiaAPI(username, password) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ganet\Pycharm\Lib\site-packages\ThermiaOnlineAPI\api\ThermiaAPI.py", line 73, in init self.authenticated = self.authenticate() ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ganet\Pycharm\Lib\site-packages\ThermiaOnlineAPI\api\ThermiaAPI.py", line 680, in authenticate "code": request_confirmed.url.split("code=")[1],


IndexError: list index out of range

Process finished with exit code 1
fclauson commented 6 days ago

It seems that the portal has a new agreement you have to agree to So sign in on line and click ok to the new T&Cs this will work again Francis On 27 Jun 2024, at 11:50, Vovanoso @.***> wrote: Launching example.py I have got issue Traceback (most recent call last): File "C:\Users\ganet\PycharmProjects\pythonProject\Thermia\Sql\example.py", line 13, in thermia = Thermia(USERNAME, PASSWORD) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ganet\Pycharm\Lib\site-packages\ThermiaOnlineAPIinit.py", line 13, in init self.api_interface = ThermiaAPI(username, password) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ganet\Pycharm\Lib\site-packages\ThermiaOnlineAPI\api\ThermiaAPI.py", line 73, in init self.authenticated = self.authenticate() ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ganet\Pycharm\Lib\site-packages\ThermiaOnlineAPI\api\ThermiaAPI.py", line 680, in authenticate "code": request_confirmed.url.split("code=")[1],


IndexError: list index out of range
Process finished with exit code 1

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
klejejs commented 6 days ago

@Vovanoso can you please confirm if that is the case @fclauson mentioned? Some other people have also commented on this issue and it has not yet been clear to me what exactly is wrong.

wouterse commented 6 days ago

I had the same issue, and the fix that @fclauson mentioned worked for me.

Gjorret commented 5 days ago

I can confirm the same, got the same error and couldnt connect. After logging into their web portal and accepting the agreement then it works again.

Exception has occurred: IndexError list index out of range File "C:\Scripts\Thermia\ThermiaOnlineAPI\api\ThermiaAPI.py", line 655, in __authenticate "code": request_confirmed.url.split("code=")[1],


  File "C:\Scripts\Thermia\ThermiaOnlineAPI\api\ThermiaAPI.py", line 78, in __init__
    self.authenticated = self.__authenticate()
                         ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Scripts\Thermia\ThermiaOnlineAPI\__init__.py", line 14, in __init__
    self.api_interface = ThermiaAPI(username, password, api_type)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Scripts\Thermia\collectdata.py", line 15, in <module>
    thermia = Thermia(USERNAME, PASSWORD, "classic")
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

image

Swifster commented 4 days ago

Hi!

I can also confirm the same. Same error and couldn't connect I went to online and agreed to the new terms and all worked after this.