SAIC-iSmart-API/saic-home-assistant-addon

Possible problem when updating to 0.2.2 (SAIC_URI?)

Closed this issue · 2 comments

Hi,
I recently updated to v0.2.2, from v0.2.1. After the update it seemed like the MQTT client didn't have any contact with the API. The values didn't get refreshed and I couldn't send commands. Tried to login with the iSmart app, which worked. But when i returned to the addon (and did a restart of course), the problem persisted.

So, I did a complete uninstall of the addon and did a clean install of 0.2.2. After configuring everything it suddenly worked again.

One thing I noticed was that, when I entered the settings after the clean install, the field SAIC_URI was there, preconfigured with the "tap-eu..." URL. I don't think that I saw that field when I looked at the settings the first time (after upgrading 0.2.1 to 0.2.2). It got me thinking that this is an upgrade issue, where the SAIC_URI never gets added, so that the client won't connect to the API or so?

Anyway, it works for me now, but I thought that this maybe something to keep in mind if there are others with the same problem.

I can confirm the behavior (see logs)

EDIT: Add "https://tap-eu.soimt.com" in "SAIC_URI" field (as suggested from @DreamT80) fixes the problem for me without reinstall.


2023-06-05 00:01:40,328 Invalid URL '/TAP.Web/ota.mp': No scheme supplied. Perhaps you meant https:///TAP.Web/ota.mp?
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/saic_ismart_client/saic_api.py", line 583, in send_request
    response = requests.post(url=endpoint, data=hex_message, headers=headers, cookies=self.cookies)
  File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 573, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 484, in prepare_request
    p.prepare(
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 368, in prepare
    self.prepare_url(url, params)
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 439, in prepare_url
    raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL '/TAP.Web/ota.mp': No scheme supplied. Perhaps you meant https:///TAP.Web/ota.mp?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/app/./mqtt_gateway.py", line 418, in run
    login_response_message = self.saic_api.login()
  File "/usr/local/lib/python3.10/site-packages/saic_ismart_client/saic_api.py", line 109, in login
    login_response_hex = self.send_request(login_request_hex,
  File "/usr/local/lib/python3.10/site-packages/saic_ismart_client/saic_api.py", line 594, in send_request
    raise SaicApiException(f'{e}')
saic_ismart_client.saic_api.SaicApiException: Invalid URL '/TAP.Web/ota.mp': No scheme supplied. Perhaps you meant https:///TAP.Web/ota.mp?
Invalid URL '/TAP.Web/ota.mp': No scheme supplied. Perhaps you meant https:///TAP.Web/ota.mp?

With python gateway v0.2.2 it's necessary to fill out all fields with default values. I didn't know that yesterday while creating the update for my add-on. But I fixed it with 2 commits :)

It's not possible to push another update to home assistant because we use the docker image tag.