SAIC-iSmart-API / saic-python-mqtt-gateway

A service that queries the data from an MG iSMART account and publishes the data over MQTT and to other sources
MIT License
71 stars 21 forks source link

Gateway settings for Australia #169

Closed callifo closed 2 weeks ago

callifo commented 8 months ago

Hi,

Can anyone assist what I would need to use for Australian servers? Previously I could use '--saic-uri=https://tap-au.soimt.com' and this has worked well, but since upgrading and saic-uri being removed, I am unable to login.

If I use default settings, I get: return code: 1000036, message: The account is not registered.

Changing the --saic-region to AU and saic-rest-uri with eu replaced with au, does not work.

nanomad commented 8 months ago

Did australia get the "facelift" of the MG app? Or is it still using the classic "black" version?

If so I fear you have to use the old gateway version. If you want to investigate more you can reach me out on telegram (@nanomad)

bullantmm commented 8 months ago

I believe I have the same issue... Any further details for configuring for Australia that you could provide would be great!

nanomad commented 8 months ago

@bullantmm see if you can provide an answer to the question above

jamescreer commented 8 months ago

@nanomad at this point I believe AU and NZ are still using the classic "black" version.

In the end I rolled back to the old gateway version and it worked again for me in Australia. IMG_8018

bullantmm commented 8 months ago

@jamescreer which version exactly are you using? 0.4.6 or one of the 0.5.x ones? Also are there any other region specific settings that you need for AUS other than --saic-uri=https://tap-au.soimt.com/ ?

callifo commented 8 months ago

I'm using 0.4.6 according to the changelog in my directory. Was on holiday from the 14th Jan, so wasn't able to test any interim build since.

For Aus, I did not use any other specific settings except --saic-uri=https://tap-au.soimt.com/

jamescreer commented 8 months ago

@bullantmm I'm also running 0.4.6 with https://tap-au.soimt.com as the saic-uri

nanomad commented 7 months ago

Solution is to stay on the 0.4.6 release. Help is more than welcome to back port fixes from the current version

Tonno87 commented 7 months ago

@nanomad I will try it out in the next few days. I think it's a good chance to learn more about python and github.

nanomad commented 7 months ago

@callifo @bullantmm off topic question... Can you confirm that you see negative values for the latitude in the API responses?

bullantmm commented 7 months ago

@nanomad yes position sensor returns negative for latitude (obviously still on 0.4.6 release).

hamishfagg commented 6 months ago

NZer here with a MG4 - I can see from DNS logs my phone is looking up these:

gateway-au.soimt.com
tap-au.soimt.com

The iSmart app reports version 1.0.4 under "My Profile" -> "About"

@nanomad can you say a little more about the work required to make 5.x work for AU/NZ? I'm interested in giving it a go.

nanomad commented 6 months ago

@hamishfagg I'd start by refactoring the existing https://github.com/SAIC-iSmart-API/saic-python-client To expose an API surface similar to the new one https://github.com/SAIC-iSmart-API/saic-python-client-ng

bullantmm commented 6 months ago

@hamishfagg have you had a try at this yet? Keen to see how you go - I’d love to be able to update to latest version when new releases come out rather than being stuck on 4.6

nanomad commented 5 months ago

@pmannk let's keep this to track the backporting to the legacy version

hamishfagg commented 5 months ago

@bullantmm i havent sorry. As usual life has got in the way of me starting something new :P

karter16 commented 1 month ago

Hi - for what it's worth I've just been playing round with this. I don't know if it's newly available, but https://gateway-mg-au.soimt.com/api.app/v1/ is now available and I have been able to use the latest version of this gateway to connect to my ZS EV.

SAIC_REST_URI: https://gateway-mg-au.soimt.com/api.app/v1/ SAIC_REGION: au

Hope this helps

bullantmm commented 1 month ago

Thanks @karter16! I just tried but looks like that URI is not available... Anyway it might mean we are getting closer!!

karter16 commented 1 month ago

Thanks @karter16! I just tried but looks like that URI is not available... Anyway it might mean we are getting closer!!

Interesting - so if you try to go to the URI (https://gateway-mg-au.soimt.com/api.app/v1/) from your browser what do you get? I get a {"code":6,"message":"The service is not available,please try again later."} response, which means that the API exists and is responding. If I use the latest version of "saic-python-client-ng" and specify that URI I'm able to use my iSmart username and password to connect to and control the vehicle - I have this working now.

bullantmm commented 3 weeks ago

Thanks @karter16! I just tried but looks like that URI is not available... Anyway it might mean we are getting closer!!

Interesting - so if you try to go to the URI (https://gateway-mg-au.soimt.com/api.app/v1/) from your browser what do you get? I get a {"code":6,"message":"The service is not available,please try again later."} response, which means that the API exists and is responding. If I use the latest version of "saic-python-client-ng" and specify that URI I'm able to use my iSmart username and password to connect to and control the vehicle - I have this working now.

I gave it some more work and now it works... Just had to spend some time ensuring the variables were correct. Thanks for the notifying about the updated address!

hamishfagg commented 3 weeks ago

Tried this and it doesn't seem to work in NZ. I get the 'service not available' at that endpoint, but when the gateway tried to log in it gets an "incorrect password" response (it's definitely the correct password).

@karter16 how did you find that endpoint? I might need to capture my phone's traffic

karter16 commented 3 weeks ago

Hi @hamishfagg - fyi I am NZ-based so don't think it's a NZ vs AU thing.

I believe that there is a separate known issue/limitation (here it is: https://github.com/SAIC-iSmart-API/saic-python-mqtt-gateway/issues/255) that your password can't contain special characters (needs to be only alpha-numeric) could it be that?

You won't get that endpoint by monitoring traffic when using the iSmart app. the NZ/AU iSmart app still uses the old endpoint. I found this endpoint by taking the new EU endpoint and substituting "au" in the place of "eu". (on the basis that they've probably stood up the endpoint and just not migrated AU/NZ to the new app yet, which indeed seems to be the case).

hamishfagg commented 3 weeks ago

My password is alpha-numeric, but you gave me an idea - turns out the app just ignores anything after the first 16 characters in your password (yay, security).

So, I just needed to set the env var to the first 16 chars of my password and now it's working! Thanks!

nanomad commented 3 weeks ago

Can you guys confirm it works for AU and NZ then? I'd love for you to update the README if so with the right settings to use

bullantmm commented 3 weeks ago

Can you guys confirm it works for AU and NZ then? I'd love for you to update the README if so with the right settings to use

Definitely working for me in AU using

SAIC_REST_URI: https://gateway-mg-au.soimt.com/api.app/v1/ SAIC_REGION: au

karter16 commented 3 weeks ago

So that's confirmed - works in both AU and NZ using:

SAIC_REST_URI: https://gateway-mg-au.soimt.com/api.app/v1/ SAIC_REGION: au