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

[ISSUE] Integration cannot be loaded because of unsatisfied dependencies #104

Closed
2 of 4 tasks
bryce2071 opened this issue Feb 2, 2025 · 106 comments · Fixed by #117
Closed
2 of 4 tasks

[ISSUE] Integration cannot be loaded because of unsatisfied dependencies #104

bryce2071 opened this issue Feb 2, 2025 · 106 comments · Fixed by #117
Assignees
Labels
bug Something isn't working solved Issue solved and released

Comments

@bryce2071
Copy link

Home Assistant Version

2025.1

MG/SAIC Integration Version

0.9.2

Installation Method

HACS

Did you check for existing issues?

  • Yes, I have checked for existing issues
  • No, I have not checked for existing issues

Did you enable debug logging before and are ready to post logs?

  • Yes, I have enabled debug logging
  • No, I have not enabled debug logging

Describe the Issue

hi,
since a few Updates i cant use IT anymore.
i deleted IT and tried to Reinstall, but i Always get this error.
what can i do?

error
The configuration flow could not be loaded: 500 Internal Server Error Server got itself in trouble.

in logs i See that an issue IS for Version 0.6 ???

Logs

Setup failed for custom integration 'mg_saic': Requirements for mg_saic not found: ['saic-ismart-client-ng==0.6.0'].

Additional Context

No response

@bryce2071 bryce2071 added the bug Something isn't working label Feb 2, 2025
@bryce2071
Copy link
Author

2025-02-02 12:20:54.034 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'mg_saic': Requirements for mg_saic not found: ['saic-ismart-client-ng==0.6.0'].

@ad-ha
Copy link
Owner

ad-ha commented Feb 2, 2025

So it seems like your system is not getting the latest saic-ismart-client-ng.

I can get that without a problem on my end. Try to find which version do you have installed on your instance and manually update it to 0.6.0. This will depend on whether you have HassOS, supervised or docker

@bryce2071
Copy link
Author

Hi thx for your reply. I have the ha blue

@ad-ha
Copy link
Owner

ad-ha commented Feb 2, 2025

So just go into SSH on your instance and write:

pip show saic-python-client-ng

It should show as:

Name: saic_ismart_client_ng
Version: 0.6.0
Summary: SAIC next gen client library (MG iSMART)
Home-page: https://github.com/SAIC-iSmart-API/saic-python-client-ng
Author: Giovanni Condello
Author-email: saic-python-client@nanomad.net
License:
Location: /usr/local/lib/python3.13/site-packages
Requires: dacite, httpx, pycryptodome, tenacity
Required-by:

If it shows a different version just run:

pip install --upgrade saic-python-client-ng==0.6.0

Cheers

@framar82
Copy link

framar82 commented Feb 2, 2025

Me too! This errors, happens after updating to the new:
HA:
Core 2025.2.0b6
Supervisor 2025.01.2
Operating System 14.2
Frontend 20250131.0

MG/SAIC Integration Version
0.9.2

I've tried to install manually via git and i've obtained this:

(myenv) ➜ ~ pip show saic_ismart_client_ng ### --> Shut be used "-" instead of "_"

Name: saic_ismart_client_ng
Version: 0.6.0
Summary: SAIC next gen client library (MG iSMART)
Home-page: https://github.com/SAIC-iSmart-API/saic-python-client-ng
Author: Giovanni Condello
Author-email: saic-python-client@nanomad.net
License:
Location: /root/myenv/lib/python3.12/site-packages
Requires: dacite, httpx, pycryptodome, tenacity
Required-by:

@framar82
Copy link

framar82 commented Feb 2, 2025

Impossibile caricare il flusso di configurazione: 500 Internal Server Error Server got itself in trouble

FROM LOGs:
homeassistant.requirements.RequirementsNotFound: Requirements for mg_saic not found: ['saic-ismart-client-ng==0.6.0'].

Registratore: homeassistant.util.package
Fonte: util/package.py:159
Prima occorrenza: 17:48:40 (3 occorrenze)
Ultimo accesso: 17:48:42
Unable to install package saic-ismart-client-ng==0.6.0: × No solution found when resolving dependencies: ╰─▶ Because saic-ismart-client-ng==0.6.0 depends on httpx>=0.27.0,<0.28.0 and httpx==0.28.1, we can conclude that saic-ismart-client-ng==0.6.0 cannot be used. And because you require saic-ismart-client-ng==0.6.0, we can conclude that your requirements are unsatisfiable.

@ad-ha
Copy link
Owner

ad-ha commented Feb 2, 2025

Hi,

@bryce2071 and @framar82

Can you both try to edit the integration manifest.json (custom_components\mg_saic\manifest.json) and replace the actual 0.6.0 by 0.5.4? Restart HA and check if it works.

So it reads:

"requirements": ["requests", "pycryptodome", "saic-ismart-client-ng==0.5.4"],

Let me know if it works this way.

I am not having issues with 0.6.0, but I am on Supervised installation, so that might be the reason why it works fine on my end. Although, my test machine is HassOS and is working fine.

@ad-ha ad-ha self-assigned this Feb 2, 2025
@bryce2071
Copy link
Author

I can not download a 0.5.4 cause after 0.5.2 comes 0.6.0

@bryce2071
Copy link
Author

I am on supervised too

@ad-ha
Copy link
Owner

ad-ha commented Feb 2, 2025

I can not download a 0.5.4 cause after 0.5.2 comes 0.6.0

Try to change the manifest either way to 0.5.3, the old version I was using, and you should be back to normal.

On a supervised the manual update is different, because you need to go into the HA docker and upgrade from pip inside it.

@bryce2071
Copy link
Author

Nothing is working ...
At the moment i cant install any version of mg.

I removed the mg in hacs and removed the entities, then installed mg new in hacs.
Now i am not able to add the mg integration:
Same error:

error
The configuration flow could not be loaded: 500 Internal Server Error Server got itself in trouble.

@ad-ha
Copy link
Owner

ad-ha commented Feb 2, 2025

@bryce2071

Did you try to change mabisfet. Json as I mentioned before?

@bryce2071
Copy link
Author

Yes

@bryce2071
Copy link
Author

I think it should be possible toncompletely new install it. But the same error comes after reinstalled. Where must depend3ncies be removed?
I manually deleted the directory from custom_components, too

@ad-ha
Copy link
Owner

ad-ha commented Feb 2, 2025

@bryce2071

Try these steps.

  1. Download from HACS
  2. Go to custom_components/mg_saic and edit manifest.json replace 0.6.0 by 0.5.2. Save and close file.
  3. Restart Home Assistant
  4. Try to add the integration again

In theory, by doing this, you should be able to reinstall it.

@bryce2071
Copy link
Author

No. Same error. Sorry.

@framar82
Copy link

framar82 commented Feb 2, 2025

No, same error I'm receiving.
I have replaced the string from 0.6.0 to 0.5.2 but the error is still appearing.

I:ve verified and I've installed the 0.6.0 on my HA environment, but if I try with command line:
"PIP SHOW saic-ismart-client-ng"

it returns that there are no installed packages.
But searching as below, it confirms that I've the 0.6.0 installed:

"PIP SHOW saic_ismart_client_ng"

Result:

Name: saic_ismart_client_ng
Version: 0.6.0
Summary: SAIC next gen client library (MG iSMART)
Home-page: https://github.com/SAIC-iSmart-API/saic-python-client-ng
Author: Giovanni Condello
Author-email: saic-python-client@nanomad.net
License:
Location: /root/myenv/lib/python3.12/site-packages
Requires: dacite, httpx, pycryptodome, tenacity
Required-by:

@ad-ha
Copy link
Owner

ad-ha commented Feb 2, 2025

@bryce2071 and @framar82

That's really odd.

The package is available on PyPi: https://pypi.org/project/saic_ismart_client_ng/#history

If you guys are using supervisor, you need SSH to your instance and then:

docker exec -it homeassistant bash
pip show saic-python-client-ng
pip install --upgrade saic-python-client-ng==0.6.0
pip show saic-python-client-ng

If you do not do docker exec -it homeassistant bash you'll be installing it on the root system and HA will have no access to it.

@framar82
Copy link

framar82 commented Feb 2, 2025

@bryce2071 and @framar82

That's really odd.

The package is available on PyPi: https://pypi.org/project/saic_ismart_client_ng/#history

If you guys are using supervisor, you need SSH to your instance and then:

docker exec -it homeassistant bash
pip show saic-python-client-ng
pip install --upgrade saic-python-client-ng==0.6.0
pip show saic-python-client-ng

If you do not do docker exec -it homeassistant bash you'll be installing it on the root system and HA will have no access to it.

Ohhhh!!! Thanks! Now it works!
Probably was installed out of the scope of Ha env.

With you last suggestion, the issue is solved.
I've also restored the version required to 0.6.0 inanifest.json file.

I appreciate your support!

@ad-ha
Copy link
Owner

ad-ha commented Feb 2, 2025

Glad it did work out for you.

Cheers

@jgayobla
Copy link

jgayobla commented Feb 5, 2025

Hoy actualice Home assistant y me encuentro con lo que creo que es el mismo error:

Registrador: homeassistant.util.package
Fuente: util/package.py:159
Ocurrió por primera vez: 23:45:53 (3 ocurrencias)
Última vez registrado: 23:45:54

Unable to install package saic-ismart-client-ng==0.6.0: × No solution found when resolving dependencies: ╰─▶ Because saic-ismart-client-ng==0.6.0 depends on httpx>=0.27.0,<0.28.0 and httpx==0.28.1, we can conclude that saic-ismart-client-ng==0.6.0 cannot be used. And because you require saic-ismart-client-ng==0.6.0, we can conclude that your requirements are unsatisfiable.

@bryce2071
Copy link
Author

@bryce2071 and @framar82

That's really odd.

The package is available on PyPi: https://pypi.org/project/saic_ismart_client_ng/#history

If you guys are using supervisor, you need SSH to your instance and then:

docker exec -it homeassistant bash
pip show saic-python-client-ng
pip install --upgrade saic-python-client-ng==0.6.0
pip show saic-python-client-ng

If you do not do docker exec -it homeassistant bash you'll be installing it on the root system and HA will have no access to it.

i dont use docker. what to do then?
many thx for your great Support.

@matboy66
Copy link

matboy66 commented Feb 6, 2025

Hello, same problem for me 😭

@ad-ha
Copy link
Owner

ad-ha commented Feb 6, 2025

Hello, same problem for me 😭

Hi @matboy66

Did you try any of the solutions above?

@ghislaingaillot
Copy link

ghislaingaillot commented Feb 6, 2025

Upgrading saic-python-client-ng worked partially for me, some entities remains in a "non provided state".
homeassistant:/config# pip show saic_ismart_client_ng
Name: saic_ismart_client_ng
Version: 0.6.0
Summary: SAIC next gen client library (MG iSMART)
Home-page: https://github.com/SAIC-iSmart-API/saic-python-client-ng
Author: Giovanni Condello
Author-email: saic-python-client@nanomad.net
License:
Location: /usr/local/lib/python3.13/site-packages
Requires: dacite, httpx, pycryptodome, tenacity
Required-by:

Image

logs:
2025-02-06 07:50:16.739 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:19.803 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:22.881 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:25.932 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:28.991 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:32.056 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:35.145 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:38.200 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:41.256 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:44.313 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:47.364 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 1499986138, but no data 2025-02-06 07:50:47.364 ERROR (MainThread) [custom_components.mg_saic] API call failed: return code: 4, message: The remote control instruction failed, please try again later., event_id: 1499986138 2025-02-06 07:50:47.364 ERROR (MainThread) [custom_components.mg_saic] Error retrieving vehicle status: return code: 4, message: The remote control instruction failed, please try again later., event_id: 1499986138 2025-02-06 07:50:47.365 WARNING (MainThread) [custom_components.mg_saic] Vehicle status returned None. 2025-02-06 07:50:47.365 WARNING (MainThread) [custom_components.mg_saic] Error fetching vehicle status: Vehicle status is None.. Retrying in 15 seconds... (Attempt 1/5) 2025-02-06 07:51:02.488 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 181345457, but no data 2025-02-06 07:51:05.741 INFO (MainThread) [saic_ismart_client_ng.api.base] Retrying since we got event-id in headers: 853341020, but no data

@ad-ha
Copy link
Owner

ad-ha commented Feb 6, 2025

Hey everyone,

Since it seems that there are some instances with the same issue, I just amended the manifest.json to address the dependency issues, so now requirement is saic-ismart-client-ng >= 0.5.2

EDIT: Release 0.9.3 removed

@ad-ha ad-ha closed this as completed Feb 6, 2025
@matboy66
Copy link

The instructions earlier from @JoakimNordin are pretty clear and worked well for me on my Green box. Make sure you disable Protection Mode in the SSH app and restart it before you enter the commands and make sure you are using the correct add-on - "Advanced SSH & Web Terminal". This was the reason I could not get mine to work earlier. Good luck!

Hi, can you give a procedure for green box with Hos it doesn't work for me please ?????
Enregistreur: homeassistant.setup Source: setup.py:275 S'est produit pour la première fois: 14:01:52 (1 occurrences) Dernier enregistrement: 14:01:52
Setup failed for custom integration 'mg_saic': Requirements for mg_saic not found: ['saic-ismart-client-ng==0.6.0'].
Enregistreur: homeassistant.util.package Source: util/package.py:159 S'est produit pour la première fois: 14:01:50 (3 occurrences) Dernier enregistrement: 14:01:52
Unable to install package saic-ismart-client-ng==0.6.0: × No solution found when resolving dependencies: ╰─▶ Because saic-ismart-client-ng==0.6.0 depends on httpx>=0.27.0,<0.28.0 and httpx==0.28.1, we can conclude that saic-ismart-client-ng==0.6.0 cannot be used. And because you require saic-ismart-client-ng==0.6.0, we can conclude that your requirements are unsatisfiable.

Yes but for me I am in HassOS and not in Supervised/Docker so the procedure must change for me?

@EACourts
Copy link

Then (AFIK) you simply don't need the first command ("docker exec -it homeassistant bash"). Everything else is the same, so the commands are:
pip show saic-ismart-client-ng
pip install --upgrade saic-ismart-client-ng==0.6.0
pip show saic-ismart-client-ng

Remember to disable protection mode and restart the system.

@matboy66
Copy link

Then (AFIK) you simply don't need the first command ("docker exec -it homeassistant bash"). Everything else is the same, so the commands are: pip show saic-ismart-client-ng pip install --upgrade saic-ismart-client-ng==0.6.0 pip show saic-ismart-client-ng

Remember to disable protection mode and restart the system.

Unfortunately this is not enough for me this procedure does not work for me

@ad-ha
Copy link
Owner

ad-ha commented Feb 10, 2025

Hi everyone,

So FYI, the API has just been updated to cover for this issue. As soon as I can, I will test it and do a new release with the versioning fix.

Cheers

@ad-ha ad-ha closed this as completed in 30ded1f Feb 10, 2025
ad-ha added a commit that referenced this issue Feb 10, 2025
Bump saic-ismart-client-ng version (closes #104)
@ad-ha
Copy link
Owner

ad-ha commented Feb 10, 2025

This should now be fixed on version 0.9.3

Anyone that wants to give it a shout and check it, please let me know the outcome. On my production instance this is working just fine and I had no issues with the update.

@jamespreedy
Copy link

0.9.3 with 2025.2.2 - all good.
Thanks for all your help @ad-ha! 😀

@ad-ha ad-ha added solved Issue solved and released and removed solved. solution on post Solved and the solution is posted labels Feb 10, 2025
@k-lofnes
Copy link

Same here, works again after updated 🎉

@EACourts
Copy link

Given that I had so many problems previously, the update to 0.9.3 was seamless, and consequently after the HA Core 2025.2.2 upgrade everything continues to work!
THANK YOU!

@zorak1103
Copy link

0.9.3 with 2025.2.2 - working flawlessly
thank you very much for your work

@EACourts
Copy link

EACourts commented Feb 14, 2025

I suspect HA V2025.2.4 has broken the integration again :(
It's no longer initialising for me.

@ad-ha
Copy link
Owner

ad-ha commented Feb 14, 2025

I suspect HA V2025.2.4 has broken the integration again :(
It's no longer initialising for me.

Did you check the logs? Is it something related to the dependencies... Or the API not sending data?

@EACourts
Copy link

Sorry, you'll need to hand-hold me a little. Following the HA update it sits for a long time (10 minutes or so) "initialising", then fails to initialise.
Reloading the integration has not helped.
Where can I find logs, etc., to send?

I suspect HA V2025.2.4 has broken the integration again :(
It's no longer initialising for me.

Did you check the logs? Is it something related to the dependencies... Or the API not sending data?

@EACourts
Copy link

I've now deleted the integration and reinstalled it from scratch. After entering username and password it recognises the vehicle and I can confirm the capabilities. Then it sits for about 10 minutes and "fails to initialise". There seem to be lots of warnings and errors in the system log, but this seems to be the most pertinent VIN obscured):

Logger: homeassistant.config_entries
Source: config_entries.py:637
First occurred: 01:26:53 (1 occurrences)
Last logged: 01:26:53

Error setting up entry MG SAIC - LSJWH4091xxxxxxx for mg_saic
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 637, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mg_saic/init.py", line 47, in async_setup_entry
await coordinator.async_setup()
File "/config/custom_components/mg_saic/coordinator.py", line 373, in async_setup
await self.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 307, in async_config_entry_first_refresh
await self._async_refresh(
log_failures=False, raise_on_auth_failed=True, raise_on_entry_error=True
)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 380, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mg_saic/coordinator.py", line 458, in _async_update_data
data["charging"] = await self._fetch_with_retries(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "/config/custom_components/mg_saic/coordinator.py", line 743, in _fetch_with_retries
data = await fetch_func()
^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mg_saic/api.py", line 105, in get_charging_info
charging_status = await self._make_api_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
self.saic_api.get_vehicle_charging_management_data, self.vin
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/config/custom_components/mg_saic/api.py", line 46, in _make_api_call
return await api_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/saic_ismart_client_ng/api/vehicle_charging/init.py", line 24, in get_vehicle_charging_management_data
return await self.execute_api_call_with_event_id(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<6 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/saic_ismart_client_ng/api/base.py", line 139, in execute_api_call_with_event_id
return await execute_api_call_with_event_id_inner(event_id='0')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/init.py", line 189, in async_wrapped
return await copy(fn, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/init.py", line 121, in call
await self.sleep(do) # type: ignore[misc]
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/asyncio/tasks.py", line 718, in sleep
return await future
^^^^^^^^^^^^
asyncio.exceptions.CancelledError: Global task timeout

@ad-ha
Copy link
Owner

ad-ha commented Feb 15, 2025

So the issue is that the API is not reporting nay of the data needed for the vehicle. It might be an issue with the connection to the vehicle or the API directly, but not the integration.

This is happening to me as well. Usually is something that lasts a couple of days and is always an issue on MG side.

Are you able to get data updates on the iSmart App?

@EACourts
Copy link

I'm not getting any errors in the app, but at the same time the vehicle status doesn't seem to be updated either. Last update was last night at 20:02 which was about an hour or so before I updated HA and these problems began.

@EACourts
Copy link

I just deleted and reinstalled the integration again. This time the configuration seemed to complete quickly (previously it hung), but it's still not started. Below is the message in the log:

This error originated from a custom integration.

Logger: custom_components.mg_saic
Source: custom_components/mg_saic/init.py:66
integration: MG SAIC (documentation, issues)
First occurred: 10:09:28 (1 occurrences)
Last logged: 10:09:28

Failed to set up MG SAIC integration: return code: 500, message: API call POST /oauth/token failed unexpectedly

@ad-ha
Copy link
Owner

ad-ha commented Feb 15, 2025

Let me see how can I say this. Removing and readding the integration has not effect whatsoever on this case, it is not an issue form the integration!

As you can see on the app, the vehicle is not updating to MG servers, so if MG does not get data, the integration does not get data. It's a matter of waiting as having it working on the vehicle <-> MG server connection.

I have been myself with this issue for over a week, now. MG solution seems to be going to the dealership to reset the TBOX, but this is something recurrent and that happens every now and then... so it is just a matter of waiting. I've never been down for so long, only a couple of days, but it shall come back at any time.

If mostly happens on weekends.. lets know why.

@jamespreedy
Copy link

@ad-ha - a possible counterpoint here. I thought initially that the issue might be on the MG side - completely agree that they aren't great for being reliable at the moment. I removed your integration temporarily, and added the SAIC add-on instead. (URL below for reference). On firing that up, I was able to connect to the car, and perform lock / unlock etc immediately. My guess is that if it was a server issue, I should have had issues with both the HACS custom integration and the HASS Add-on?

https://github.com/SAIC-iSmart-API/saic-home-assistant-addon

@ad-ha
Copy link
Owner

ad-ha commented Feb 15, 2025

@jamespreedy

You are partially right. The add-on works on a different way than this integration.

As in the iSmart App, right now, even if you do not get updates from the car (like SOC, or others) you can still use the lock/unlock command and AC as well... the issue is that after the iSmart sends the command, it will fail to update and will not know the status of the vehicle, nor if the command sent was successful.

This integration relies first on obtaining the updated data and get those from the car to make sure that every sensor displays correctly. There is no much on sending commands to the vehicle and after not being able to know if they were successful or not, right?

You can try it. Use the iSmart App (if your case is that the app also shows that last update was 1 or 2 days ago). Send a command to the vehicle and the vehicle will most probably flash and start the command, but the app will not show the status update (will show an error after a while saying remote command failed, or something along these lines). That's exactly the problem the integration has, that as no updated data comes in, nothing can be updated.

Therefore, if no data, no integration.

@ad-ha
Copy link
Owner

ad-ha commented Feb 15, 2025

I was able to connect to the car, and perform lock / unlock etc immediately.

@jamespreedy btw, were you able to get updated status data? Or just been able to send commands?

@ad-ha
Copy link
Owner

ad-ha commented Feb 15, 2025

@jamespreedy and @EACourts

If you both activate the debug logs for the integration, you will see that the integration keeps trying to get data but the response from the API server will be something like this:

Error fetching charging info: Charging info is None.. Retrying in 15 seconds... (Attempt 1/5)
Error fetching vehicle status: Vehicle status is None.. Retrying in 15 seconds... (Attempt 2/5)
Error fetching vehicle status: Vehicle status is None.. Retrying in 15 seconds... (Attempt 3/5)
Error fetching vehicle status: Vehicle status is None.. Retrying in 15 seconds... (Attempt 4/5)
Error fetching vehicle status: Vehicle status is None.. Retrying in 15 seconds... (Attempt 5/5)

Plus:

Error retrieving charging information: return code: 4, message: The remote control instruction failed, please try again later., event_id: 1181009075

This last one is stating that the connection to the vehicle was not possible and that updated data was not retrieved by the server directly, not the integration. That's why most probably your iSmart App is not showing updated data as well, cause they are not being able to retrieve data from the car..

It's odd, I know, that you can send commands, but not get updated data, right?

I sent MG a ticket on this and their response was:

Thanks for your email.

I recommend that you go to a local MG dealer to do a diagnosis.
Please bring the below information to the dealer:
Conduct the vehicle diagnosis, and check TBOX in a high priority,
Create a SNW ticket.
If the TBOX is with error, then do a replacement of TBOX with SIPS, but DO NOT replace the hardware.

And after added on another email:

Thanks for your email.

No, it's not just about API services, it's also about connecting with vehicles. That is, the connection cannot be kept stable.

That's why I recommended reset Tbox.

As you see, if MG cannot have a stable connection to the vehicle (which is odd that lasts so much time.. even with having the vehicle, in my case, on different locations and open-sky).. but again, is an issue on MG side, not the integration.

@EACourts
Copy link

I've found d the problem. It was related to the vehicle itself. My MG app has been consistently showing the last sata update to be 20:02 last night which was the time I last left the car and about an hour before the HA upgrade. I loaded the app on another device and logged in and got the same update time (no error, as is often the case if the MG servers are on the blink). I DO get an error if I try to unlock the car or turn on HVAC. I've now been back to the car and rebooted the OBC. The apps on both platforms has now updated status and I can reach the car from the app to turn things on and off. I've reloaded the integration on HA and that works too.
From all of this I deduce that the integration and the MG servers were fine, but the car itself had effectively gone offline after I left it yesterday. It was clearly a bad coincidence that I updated HA shortly after and associated the integration failure with that, as I knew that previous updates had broken it.
My apologies for the panic and wasted time.
Edwin

@ad-ha
Copy link
Owner

ad-ha commented Feb 15, 2025

Thanks @EACourts. That pretty much sums up what I was saying, that its an issue communicating with the car.

Btw, how did you reboot the OBC?

Glad you were able to sort it out and solve the issue on your end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working solved Issue solved and released
Projects
None yet
Development

Successfully merging a pull request may close this issue.