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

MG Vehicle Config: Please Add Region and/or API URL option #17497

Closed
mjhgmailcom opened this issue Nov 30, 2024 · 5 comments · Fixed by #17544
Closed

MG Vehicle Config: Please Add Region and/or API URL option #17497

mjhgmailcom opened this issue Nov 30, 2024 · 5 comments · Fixed by #17544
Labels
vehicles Specific vehicle support

Comments

@mjhgmailcom
Copy link
Contributor

mjhgmailcom commented Nov 30, 2024

Problem

MG has Multiple Regions, but the evcc MG Vehicle configuration only allows for EU.

MG accounts for one region do not work in other regions.

Solution

  1. Have a "REGION" option on the MG Vehicle configuration to chose the region (e.g. EU or AU)
  2. AND/OR allow URL to be specified for MG's API (e.g. https://gateway-mg-au.soimt.com/api.app/v1/ )

Background Information

MG configuration is hardcoded to EU URL:
https://gateway-mg-eu.soimt.com/api.app/v1/

image

However, there is also an AU region (and possibly more to come)
https://gateway-mg-au.soimt.com/api.app/v1/ <-- Works for Australia and New Zealand.

EU API does not allow MG vehicles to work in from the AU Region, as they receive the following error:

Request failed with status code 400.
cannot create vehicle type 'template': cannot create vehicle type 'mg': 1000036: The account is not registered..

However when using the said-python-mqtt-gateway with the following configuration, the account will log in.

services:
  saic-mqtt-gateway:
    image: "saicismartapi/saic-python-mqtt-gateway:latest"
    container_name: "saic-mqtt-gateway"
    environment:   
      - SAIC_REST_URI=https://gateway-mg-au.soimt.com/api.app/v1/
      - SAIC_REGION=au

Happy to assist if you need anyone to test or debug.

BTW I am a developer (Windows), but could not find a guide on compiling evcc that worked (and I attempted several different ways) - so I couldn't make the change myself. Let me know if there is a guide (on Windows?) that I have missed and I might be able to make the change myself.

Thankyou!

@mjhgmailcom mjhgmailcom changed the title MG Vehiclde Config: Please Add Region and/or API URL option MG Vehicle Config: Please Add Region and/or API URL option Nov 30, 2024
@andig andig added the vehicles Specific vehicle support label Nov 30, 2024
@andig
Copy link
Member

andig commented Nov 30, 2024

For developing please see https://github.com/evcc-io/evcc/blob/master/CONTRIBUTING.md or contact us on Slack.

@mjhgmailcom
Copy link
Contributor Author

Thankyou, I will give it ago.

@jomach
Copy link
Contributor

jomach commented Dec 2, 2024

@mjhgmailcom I use the integration over home assistant. This means evcc -> mqtt . This means evcc does not connect to mg at all.

@mjhgmailcom
Copy link
Contributor Author

@jomach

@mjhgmailcom I use the integration over home assistant. This means evcc -> mqtt . This means evcc does not connect to mg at all.

Yes, thanks. I've tried Home assistant and set that up aswell via mqtt using my own solar rules. Just wanted to see how evcc works, but couldn't do it properly because no AU region.

mjhgmailcom added a commit to mjhgmailcom/evcc that referenced this issue Dec 2, 2024
@mjhgmailcom
Copy link
Contributor Author

@andig
Added Pull Request here: #17544
First, time working with go, I think I'll stick with C# :)

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

Successfully merging a pull request may close this issue.

3 participants