Code Monkey home page Code Monkey logo

Comments (81)

striebwj avatar striebwj commented on August 23, 2024 4

I spent some time decompiling the APK for the NA app. Looks like the API endpoints are in the sources/com/toyota/oneapp/network/api directory. Going to spend some time now looking for the base url and seeing if they match the endpoints in the code.

from mytoyota.

widewing avatar widewing commented on August 23, 2024 2

I thought I can use the retrieved token to access the APIs, but failed unfortunately..
the list vehicle API should be https://oneapi.telematicsct.com/v2/vehicle/guid
it does accept some kind of bearer token. when it's not provided, it will return 401 Unauthorized. after adding the AUTHORIZATION: Bearer [ACCESS_TOKEN] to the header, it will return 500 Internal Server Error

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024 2

@widewing

Nice work!

Yeah, this should be a separate module then. Apparently NA customers have a lot more features available to them in the app then us in Europe 😞. Feel free to use anything from this repository as a base (If it is of any value)

from mytoyota.

widewing avatar widewing commented on August 23, 2024 2

That's cool if they are similar:) no worries that's not my data, that's the data for the "demo mode" of that app 😆
FYI, the API is referenced as "17CYPLUS" internally, which is Entune generation: https://en.wikipedia.org/wiki/Toyota_Entune

from mytoyota.

widewing avatar widewing commented on August 23, 2024 2

@DurgNomis-drol got it. I can make a separate HA integration as POC instead.

from mytoyota.

widewing avatar widewing commented on August 23, 2024 2

BTW, I have made the Home Assistant integration for Toyota North America. As in the experimental stage, it requires complex steps to login and it cannot keep session forever. But other than that, it works pretty good for me. It can even track the real time location instead of last parking location as in the Toyota app.

from mytoyota.

chlanman avatar chlanman commented on August 23, 2024 2

Does this work for Canada?Having issues logging in

from mytoyota.

vanstinator avatar vanstinator commented on August 23, 2024 2

Toyota DMCA'd us which took the steam out of the project, unfortunately.

from mytoyota.

flatbrotato avatar flatbrotato commented on August 23, 2024 1

Its an app.

You can see odometer, estimated mileage, start engine, lock/unlock, you can also see parked location and door/window/moonroof status.

from mytoyota.

widewing avatar widewing commented on August 23, 2024 1

@striebwj the info you found should be correct.

it appears the app is using Retrofit2, which defines the API paths in the java file sources/com/toyota/oneapp/network/api/cy17/CY17ServiceAPI.java.

in sources\com\toyota\oneapp\network\RetrofitModule.java: provideRetrofit(...) it references baseUrlProvider.apiGatewayBaseUrl() which is https://oneapi.telematicsct.com

in sources\com\toyota\oneapp\network\api\ApiModule.java: provideCy17ServiceApi(...) it combines the base url with the API definition class

from mytoyota.

widewing avatar widewing commented on August 23, 2024 1

OK. I think I made the oauth2 login working.

  1. open Chrome dev tool and access the authorize url: https://login.toyotadriverslogin.com/oauth2/realms/root/realms/tmna-native/authorize?client_id=oneappsdkclient&scope=openid profile write&response_type=code&code_challenge=plain&redirect_uri=com.toyota.oneapp:/oauth2Callback&code_challenge_method=plain. login with the SSO provider (I used Google)
  2. It will redirect to com.toyota.oneapp:/oauth2Callback?***, of course it will fail, but you get the authorization code in the params
  3. use curl or equivalent to retrieve the access_token/refresh_token/id_token
curl --location --request POST 'https://login.toyotadriverslogin.com/oauth2/realms/root/realms/tmna-native/access_token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=oneappsdkclient' \
--data-urlencode 'code=[AUTHORIZATION_CODE]' \
--data-urlencode 'redirect_uri=com.toyota.oneapp:/oauth2Callback' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code_verifier=plain'

from mytoyota.

widewing avatar widewing commented on August 23, 2024 1

OK I made it:)

It requires several extra headers when calling the API.

  1. AUTHORIZATION: Bearer [ACCESS_TOKEN]
  2. X-API-KEY: Y1aVonEtOa18cDwNLGTjt1zqD7aLahwc30WvvvQE it's hard coded in sources\com\toyota\oneapp\network\dataproviders\NetworkDataProviderIml.java: apiKey()
  3. X-GUID: [USER_GUID] it's the sub in the previously fetched id_token decrypted as JWT string.

It apparently this API is completely different than in Europe. so the question is do you want to implement in this code repo? @DurgNomis-drol

from mytoyota.

widewing avatar widewing commented on August 23, 2024 1

Thanks @DurgNomis-drol @jlmaners
I created a very preliminary POC at widewing/toyota-na, it only implemented the login module and only a few APIs, but anyone can try out now.

from mytoyota.

visualage avatar visualage commented on August 23, 2024 1

@widewing, I think I get you the final piece for the headless integration. Use the following code to obtain the oauth code:

import requests
import hashlib
import base64
import secrets
from urllib.parse import urlparse, parse_qs

username = 'username'
password = 'password'

response = requests.post(
    url='https://login.toyotadriverslogin.com/json/realms/tmna-native/authenticate?authIndexType=service&authIndexValue=OneAppSDKLogin',
    headers={
        'ADRUM': 'isAjax:true',
        'ADRUM_1': 'isMobile:true',
        'Accept-API-Version': 'resource=2.1, protocol=1.0'
    })

data = response.json()

while data['callbacks'][0]['type'] != 'NameCallback':
    response = requests.post(
        url='https://login.toyotadriverslogin.com/json/realms/tmna-native/authenticate?authIndexType=service&authIndexValue=OneAppSDKLogin',
        json=data,
        headers={
            'ADRUM': 'isAjax:true',
            'ADRUM_1': 'isMobile:true',
            'Accept-API-Version': 'resource=2.1, protocol=1.0',
            'x-fr-version': '2021.7.1'
        })
    data = response.json()

data['callbacks'][0]['input'][0]['value'] = username

response = requests.post(
    url='https://login.toyotadriverslogin.com/json/realms/tmna-native/authenticate?authIndexType=service&authIndexValue=OneAppSDKLogin',
    json=data,
    headers={
        'ADRUM': 'isAjax:true',
        'ADRUM_1': 'isMobile:true',
        'Accept-API-Version': 'resource=2.1, protocol=1.0',
        'x-fr-version': '2021.7.1'
    })
data = response.json()

# Password
data['callbacks'][1]['input'][0]['value'] = password

response = requests.post(
    url='https://login.toyotadriverslogin.com/json/realms/tmna-native/authenticate?authIndexType=service&authIndexValue=OneAppSDKLogin',
    json=data,
    headers={
        'ADRUM': 'isAjax:true',
        'ADRUM_1': 'isMobile:true',
        'Accept-API-Version': 'resource=2.1, protocol=1.0',
        'x-fr-version': '2021.7.1'
    })
data = response.json()

token_id = data['tokenId']

challenge_method = 'S256'
challenge_data = base64.urlsafe_b64encode(secrets.token_bytes(64)).rstrip(b'=')
challenge_code = base64.urlsafe_b64encode(hashlib.sha256(challenge_data).digest()).rstrip(b'=').decode('utf-8')

response = requests.get(
    url='https://login.toyotadriverslogin.com/oauth2/realms/root/realms/tmna-native/authorize?client_id=oneappsdkclient&scope=openid%20profile%20write&response_type=code&redirect_uri=com.toyota.oneapp%3A%2Foauth2Callback&code_challenge=' + challenge_code + '&code_challenge_method=' + challenge_method,
    headers={
        'Accept-API-Version': 'resource=2.1, protocol=1.0',
        'Cookie': 'iPlanetDirectoryPro=' + token_id
    },
    allow_redirects=False
)

oauth_code = parse_qs(urlparse(response.headers['Location']).query)['code'][0]
print(oauth_code)

from mytoyota.

sphanley avatar sphanley commented on August 23, 2024

Do you have any sense of what's involved in adding support for another region? I'm a US-based developer with access to a recent model-year Toyota, and would love to try to help if given a bit of direction.

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

Where can you see you car? (website/app) 😄

What features is available?

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

Okay thanks for the info. This have given me an idea to understand how to do it.

Someone from North America would have to decompile the android app and find out if the API is anything similar to the European one and then implemented it or if not, write a second library/client, that i can then implement in this integration.

from mytoyota.

widewing avatar widewing commented on August 23, 2024

@DurgNomis-drol Hi I'm in US and would love to decompile the app. It appears the code is obfuscated. Can you guide in which file I can locate the api endpoints?

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

I just decompiled the European app and found the API in this folder app_folder\sources\toyota\frameworks\api but they may be stored else where in the American app. It took me some time to find them 😅

from mytoyota.

widewing avatar widewing commented on August 23, 2024

Is that iOS app path? I'm on Android guess I need to solve it some other way..

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

This is the path inside the Decompiled Android app, where app_folder is the app. It is not possible as far as I know to decompile IOS apps and the Android app should have all the features 😊 You have to use a service like APK extractor to get the APK and the kitling decompiler like http://www.javadecompilers.com/apkfor decompiling the app to Kotlin/Java

from mytoyota.

widewing avatar widewing commented on August 23, 2024

ah! ok I was expecting the file under somewhere under sources/com/toyota/. there's also sources/toyotaone but no sources/toyota I used the same decompiler. Let me explore more in the source.

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

toyotaone is probably the one then

from mytoyota.

striebwj avatar striebwj commented on August 23, 2024

I have hit a roadblock with this. Here are the urls I found in sources/com/toyota/oneapp/network/dataproviders/BaseUrlProviderImpl.java:

apiGatewayBaseUrl: https://oneapi.telematicsct.com

apiGatewayCertificateHostName: oneapi.telematicsct.com

flexBaseUrl: https://oneapi.telematicsct.com

idpBaseUrl: "https://login.toyotadriverslogin.com/" + "oauth2/realms/root/realms/tmna/"

mslBaseUrl: https://www.driverslogin.com/tfp/%s/%s/

tokenBaseUrl: "https://login.toyotadriverslogin.com/" + "oauth2/realms/root/realms/tmna/"

I can't see these urls actually used with the endpoints I found previously, this is my first time looking at java so maybe I am just missing something.

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

My knowledge about Java/Kotlin is on the same level as yours. So i can't really help you a lot.

It seems though that the American version uses oauth (The last url you posted is referring to this).

from mytoyota.

widewing avatar widewing commented on August 23, 2024

also there're a batch of demo API responses in resources\assets that we can utilize after we found a way to login...

from mytoyota.

widewing avatar widewing commented on August 23, 2024

and the oauth could be provided by ForgeRock, and the relevant definitions:

    <string name="forgerock_prod">ForgeRockProd</string>
    <string name="forgerock_prod_account_name">ForgeRock</string>
    <string name="forgerock_prod_auth_service">OneAppSDKLogin</string>
    <string name="forgerock_prod_oauth_client_id">oneappsdkclient</string>
    <string name="forgerock_prod_oauth_redirect_uri">com.toyota.oneapp:/oauth2Callback</string>
    <string name="forgerock_prod_oauth_scope">openid profile write</string>
    <string name="forgerock_prod_oauth_url">https://login.toyotadriverslogin.com/</string>
    <string name="forgerock_prod_realm">tmna-native</string>
    <string name="forgerock_prod_registration_service">OneAppSDKRegistration</string>
    <string name="forgerock_prod_url">https://login.toyotadriverslogin.com/</string>

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

Nice find!

from mytoyota.

jlmaners avatar jlmaners commented on August 23, 2024

@widewing Would be interested in trying to help out with this if you do start a new module

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

@widewing Nice job! Awesome to see that you're picking up the challenges 🚀

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

A few notes: (Though i know it is just a POC right now)

  • Consider using a oauth client library like rauch or see here for others, instead of using browser scraping.
  • Can you provide the JSON results returned from the endpoints, so we can compare them to the ones from Europe? (I'm curious if it just the URL that is different, but the data structure is the same)

from mytoyota.

widewing avatar widewing commented on August 23, 2024

The road block here is the auth service forces redirect_uri to be "com.toyota.oneapp:/oauth2Callback" only, and lot of the redirect / processing logic is in javascript and html. So I guess there'll be no easy way other than building native application and intercept the result...

from mytoyota.

widewing avatar widewing commented on August 23, 2024

@DurgNomis-drol the examples are included in the resource/assets folder in decompiled app (com.toyota.oneapp). I uploaded them to the Google Drive here: https://drive.google.com/file/d/1wHNF21jZHHUoKSoWRAwF2DM81I16RGtR/view?usp=sharing

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

@widewing

Right, that makes sense. I'm no expert in Oauth 😆

It is the same data, but it is structured differently. But a wrapper could be made between it so i can pass it in to the Home Assistant integration and not have to change much, but that is something i can do down the line when a library have been build 😄

BTW please be aware that the files you sent me contains location data and other details about your vehicle, including where it was bought, You should delete it and censor it again. I have a copy downloaded just so you know.

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

Wow, you have found a lot already. It seems to me that they produce the cars with two different infotainment units. And as far as i understand, it is the infotainment unit that handle the uploading of the data. Apparently here in Europe our cars are fitted with a sim card from the factory and a pre-paid plan (Number of years varies from country to country). I think they implement this differently in NA and that is why it is so different. but i digress. 😆

Good to hear, just wanted to make sure that nothing was leaked 😃

from mytoyota.

widewing avatar widewing commented on August 23, 2024

@DurgNomis-drol finally I got some time to improve my code. I uploaded to PyPI to make easier to install. also added the example responses matching the APIs I used. Please take a look to see if you can wrap it in Home Assistant plugin:) I only added some APIs most important to me for now, so let me know if you need other APIs. The full API list is here: https://drive.google.com/file/d/1JfM7MhZCUQit8_DmIi9UKxlMcZXbn4BD/view?usp=sharing.

Note that the username / password cannot be provided to HA directly, Before we found a better way, It need an authorization code generated locally and use that code as the login credential in HA set up, I described the process in the project readme.

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

@widewing Awesome work!!

I am quit busy right now with another feature request. So i don't have much time to look into it i am afraid. I also need a small break from this project after that (Though i will still be active on here helping).

Note that the username / password cannot be provided to HA directly, Before we found a better way, It need an authorization code generated locally and use that code as the login credential in HA set up, I described the process in the project readme.

This is the main challenge. I don't think that this will provide a good user experience in the integration. Also I haven'y figured out how to use to different libraries, though this shouldn't be a big challenge. But not having the possibility to use Username/Password makes it a no deal for me right now.

I have no knowledge of Oauth2 or how to fix this so i can't help sorry.

from mytoyota.

genebean avatar genebean commented on August 23, 2024

@widewing Could an “add-on” also be made that helps with the auth part? Asking because add-ons are containers, I think.

from mytoyota.

DurgNomis-drol avatar DurgNomis-drol commented on August 23, 2024

@genebean It would only be available for people who use Home Assistant OS then and not if you are running other installation types.

from mytoyota.

widewing avatar widewing commented on August 23, 2024

@genebean also container is not applicable in this case as the auth requires PyQT5 (or anything can intercept redirects) which can only be a desktop application.

from mytoyota.

visualage avatar visualage commented on August 23, 2024

Hopefully this is some helpful analysis. Toyota NA definitely uses ForgeRock as the identity provider. ForgeRock has an open source android SDK (https://github.com/ForgeRock/forgerock-android-sdk). Based on Toyota's most recent app (Toyota android 1.2.4), it indeed does have the ability to login without using the webview.

from mytoyota.

widewing avatar widewing commented on August 23, 2024

@visualage you are right. There should be a way to login using password. However I cannot find the entry point in the code. Are you familiar with forge rock?

from mytoyota.

visualage avatar visualage commented on August 23, 2024

From the decompiled Toyota android app, it uses org.forgerock.android.auth.ui.FRNative.login. Strangely, that class does not exist in the sdk in github. I traced down the calls and it seems ending up at org.forgerock.android.auth.FRUser.login (https://github.com/ForgeRock/forgerock-android-sdk/blob/dd709394b5dba4831e900630c9e93d6ebbef6e04/forgerock-auth/src/main/java/org/forgerock/android/auth/FRUser.java#L143).

from mytoyota.

widewing avatar widewing commented on August 23, 2024

@visualage I'm able to login using password and retrieve account information now. However, to call the APIs the ACCESS_TOKEN is required. I'm not sure how to retrieve it from a logged in session.

To login: use Postman to follow the steps below:

1. Login:

POST https://login.toyotadriverslogin.com/json/realms/tmna-native/authenticate
with empty body but include one extra header: Accept-API-Version: resource=2.0,protocol=1.0

It will return a json form. Paste the json form into the post body, modify necessary fields in the input sections, like username and password, and submit again. It will go back and forth several times for different information, the first two responses do not require any information so just paste the whole body directly. The third and fourth form will let you fill the username and password

2. Get user ID:

POST https://login.toyotadriverslogin.com/json/users?_action=idFromSession
with empty body but include one extra header: Accept-API-Version: resource=2.0,protocol=1.0

It will get you the internal user ID.

3. Get account information

GET https://login.toyotadriverslogin.com/json/realms/tmna-native/users/{USER_ID}

It get you the detailed account and device information

from mytoyota.

zefoo avatar zefoo commented on August 23, 2024

Nice progress @widewing !

When I POST with that header, I get this form response (where f1=rr2.json()['callbacks']):

In [44]: f1[1]
Out[44]:
{'type': 'HiddenValueCallback',
 'output': [{'name': 'value', 'value': ''},
  {'name': 'id', 'value': 'ui_locales'}],
 'input': [{'name': 'IDToken2', 'value': 'ui_locales'}]}

Are you getting a user/pass in input? I can help with similar testing, although my understanding may be somewhat limited here. I have an active subscription with the Toyota app.

from mytoyota.

widewing avatar widewing commented on August 23, 2024

@zefoo the response is correct. the first 2 responses are auto-filled and you just provide the response as input directly.

from mytoyota.

zefoo avatar zefoo commented on August 23, 2024

@widewing Thanks!

I'm getting b'{"code":415,"reason":"Unsupported Media Type","message":"Unsupported Media Type"}'

Here's what I do:


In [85]: response=requests.post("https://login.toyotadriverslogin.com/json/realms/tmna-native/authenticate", data={}, headers={"Ac
    ...: cept-API-Version": "resource=2.0,protocol=1.0"})

In [86]: response2=requests.post("https://login.toyotadriverslogin.com/json/realms/tmna-native/authenticate", data=response.json()
    ...: , headers={"Accept-API-Version": "resource=2.0,protocol=1.0"})

In [87]: response2
Out[87]: <Response [415]>

Which gives me the error above. Odd, perhaps I'm missing something? Using python requests

Thank you.

from mytoyota.

widewing avatar widewing commented on August 23, 2024

@zefoo I think you need to change data=response.json() into json=response.json()

from mytoyota.

zefoo avatar zefoo commented on August 23, 2024

@widewing Ok, I have confirmed it works and I can get device info. I wonder if the token in pushTokenId from device ID is what we want?

Also, what is the end goal here? Pulling mileage? Starting/locking vehicle? Getting vehicle status? Great job with figuring this out!

from mytoyota.

genebean avatar genebean commented on August 23, 2024

Also, what is the end goal here? Pulling mileage? Starting/locking vehicle? Getting vehicle status? Great job with figuring this out!

IMO, all of the above. The less I need to use the Toyota app, and more I can use HA, the better.

from mytoyota.

visualage avatar visualage commented on August 23, 2024

Of course, you could make it more robust so that in the loop, you look for NameCallback type and PasswordCallback type, until you get tokenId in the response. Then you can use the tokenId to exchange for the oauth authorization code.

from mytoyota.

widewing avatar widewing commented on August 23, 2024

OK I get the code updated and we can login directly :)
Try out at: https://github.com/widewing/ha-toyota-na

from mytoyota.

SeanPM5 avatar SeanPM5 commented on August 23, 2024

Thanks @widewing and @visualage just installed ha-toyota-na and logged into my 2020 Toyota RAV4. Got 26 entities with a lot of useful data and interesting automation possibilities (warn if moon roof left open and it's about to rain, etc).

Only thing missing is a switch for remote start, hope that can be added at some point. Sensor data is great though!

from mytoyota.

visualage avatar visualage commented on August 23, 2024

@widewing Great work! If you don't mind, would you please add the support so that it can be installed directly using HACS?
Also, my 2020 Toyota Sienna uses the legacy Toyota Connected Service (defined in com.toyota.oneapp.network.api.cy17.CY17ServiceAPI), not the new Toyota Connected 2.0 Service (defined in com.toyota.oneapp.network.api.cy17plus.CY17PlusServiceAPI). So none of the commands actually works for me, except getting the list of vehicles. In the list vehicle response, the generation field determines which service to call. If the value is 17CY or PRE17CY, it is the CY17ServiceAPI.
There is also another generation 'GR86', which uses a different set of methods in CY17PlusServiceAPI. You can look at com.toyota.oneapp.network.api.manager.RemoteServiceAPIManager for details, which encapsulates all logic to determine which API and which method to call.

from mytoyota.

zefoo avatar zefoo commented on August 23, 2024

Love the progress here, been eyeballing this for a while. I'm not looking for HA set up (just yet), but mostly looking to mimic pulling data on my vehicle from ipython first. I can mimic @visualage 's code (which I largely did prior to that message, less the oauth bit). I'm curious what kind of data I can get on 2020 4Runner (I am currently paying for the subscription to remote start / check miles / states / etc via Toyota app).

After I have my oauth code, how do I push to endpoints to grab data and/or remote start (which I don't think is possible yet)? I tried to use a fake cert with the app a few months back but wasn't able to get around Toyota's app to sniff traffic. I'm eyeballing this right now: https://github.com/widewing/toyota-na/blob/master/toyota_na/client.py

I might just end up setting up @widewing 's libraries since this likely already works and my "learning curve" is slowing me down. :) Thought I'd first try to manually do this in ipython, though.

from mytoyota.

visualage avatar visualage commented on August 23, 2024

@widewing's toyota-na pip package should have the ability to start/stop engine (though with my last generation Toyota, I can't test it). Try to run the following:

python -m toyota_na.app remote-request <vin> engine-start

You can look at https://github.com/widewing/toyota-na/blob/master/toyota_na/app.py for all other commands.

from mytoyota.

antasp3136 avatar antasp3136 commented on August 23, 2024

I get the error below when trying to connect home assistant custom component

2021-12-30 17:41:37 ERROR (MainThread) [custom_components.toyota_na] Error fetching data
Traceback (most recent call last):
File “/config/custom_components/toyota_na/init.py”, line 63, in update_vehicles_status
vehicle[“status”] = await client.get_vehicle_status(vin)
File “/usr/local/lib/python3.9/site-packages/toyota_na/client.py”, line 56, in get_vehicle_status
return await self.api_get(“v1/global/remote/status”, {“VIN”: vin})
File “/usr/local/lib/python3.9/site-packages/toyota_na/client.py”, line 38, in api_get
return await self.api_request(“GET”, endpoint, header_params)
File “/usr/local/lib/python3.9/site-packages/toyota_na/client.py”, line 28, in api_request
resp.raise_for_status()
File “/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py”, line 1004, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 500, message=‘Internal Server Error’, url=URL(‘https://oneapi.telematicsct.com/v1/global/remote/status’)

from mytoyota.

widewing avatar widewing commented on August 23, 2024

@antasp3136 are you still having this issue? Does this happen every time you try to login or it only occurs occasionally? Because I see this 500 error in the logs too but it only occurs very infrequently and not affecting the functions.

from mytoyota.

antasp3136 avatar antasp3136 commented on August 23, 2024

Yea I’m not seeing any entities in the system and also seeing this on the integration it’s self in homeassistant… Retrying setup: 500, message='Internal Server Error', url=URL('https://oneapi.telematicsct.com/v1/global/remote/status')

from mytoyota.

visualage avatar visualage commented on August 23, 2024

@antasp3136 the important question here is what is your car's model and model year? The current library only supports newer Toyota Connected services (which has the option to remote start), not yet the old ones (like mine, a 2020 Sienna). If you tries to use this library for an older model year car, it would throw 500.

from mytoyota.

antasp3136 avatar antasp3136 commented on August 23, 2024

We have two 2020s. A Tacoma and a 4Runner both are the limited models and both support remote start with remote connect and are both using the same Toyota account.

from mytoyota.

78hawkeye avatar 78hawkeye commented on August 23, 2024

@widewing's toyota-na pip package should have the ability to start/stop engine (though with my last generation Toyota, I can't test it). Try to run the following:

python -m toyota_na.app remote-request <vin> engine-start

You can look at https://github.com/widewing/toyota-na/blob/master/toyota_na/app.py for all other commands.

Unfortunately for me at least (2021 Tacoma), I can now pull a lot of awesome data with that module using the get arguments, but the remote_request argument returns what appears to be a success but nothing ever happens at the vehicle. Have opened an issue on that library for this. So we do have a NA solution to pull a lot of great information (thanks so much to widewing, DurgNomis-drol, and visualage ), but we don't yet have a way yet to send commands like remote start and door locking here in the States. Fingers crossed!

from mytoyota.

widewing avatar widewing commented on August 23, 2024

Unfortunately for me at least (2021 Tacoma), I can now pull a lot of awesome data with that module using the get arguments, but the remote_request argument returns what appears to be a success but nothing ever happens at the vehicle. Have opened an issue on that library for this. So we do have a NA solution to pull a lot of great information (thanks so much to widewing, DurgNomis-drol, and visualage ), but we don't yet have a way yet to send commands like remote start and door locking here in the States. Fingers crossed!

confirmed not working yet. looks like not as simple as sending an API request

from mytoyota.

widewing avatar widewing commented on August 23, 2024

Yea I’m not seeing any entities in the system and also seeing this on the integration it’s self in homeassistant… Retrying setup: 500, message='Internal Server Error', url=URL('https://oneapi.telematicsct.com/v1/global/remote/status')

@antasp3136 Can you try to run the commands in https://github.com/widewing/toyota-na directly and report what's the outputs?

from mytoyota.

antasp3136 avatar antasp3136 commented on August 23, 2024

Actually yes the commands do work I get info on my vehicles from that library running the python commands.

from mytoyota.

antasp3136 avatar antasp3136 commented on August 23, 2024
C:\Users\Administrator>python -m toyota_na.app get_user_vehicle_list
INFO 2022-01-06 09:28:43,717 - Response status: {'messages': [{'responseCode': 'ONE-VL-10000', 'description': 'Successfully retreived all vehicles', 'detailedDescription': 'Successfully retreived all vehicles'}]}

Thats the main message. I also get all the vehicles information which for privacy reasons I wont post here.

from mytoyota.

antasp3136 avatar antasp3136 commented on August 23, 2024

I do get this when i try to get the status of the vehicle using the vin.. I removed the vin see below.

C:\Users\Administrator>python -m toyota_na.app get_vehicle_status vin****************** Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\toyota_na\app.py", line 76, in <module> main() File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\toyota_na\app.py", line 61, in main result = run_async(getattr(cli, sub_command)(**sub_command_kwargs)) File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\toyota_na\app.py", line 72, in run_async return loop.run_until_complete(future) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\toyota_na\client.py", line 56, in get_vehicle_status return await self.api_get("v1/global/remote/status", {"VIN": vin}) File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\toyota_na\client.py", line 38, in api_get return await self.api_request("GET", endpoint, header_params) File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\toyota_na\client.py", line 28, in api_request resp.raise_for_status() File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\aiohttp\client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('https://oneapi.telematicsct.com/v1/global/remote/status')

from mytoyota.

antasp3136 avatar antasp3136 commented on August 23, 2024

So interesting.. One of the vehicles does not have a active remote connect subscription so when i try to poll the info on that VIN i get the error above. When i choose the VIN that does have the remote connect active i get data on it... Is there a way you can have a option to specify which VINs to pull info on?

from mytoyota.

widewing avatar widewing commented on August 23, 2024

Ok that explains... The ha component currently assume all your vehicles are supported and actively subscribed and doesn't do proper protection yet. I'll fix this bug later.

from mytoyota.

vanstinator avatar vanstinator commented on August 23, 2024

I've added support for remote start here widewing/ha-toyota-na#12

from mytoyota.

antasp3136 avatar antasp3136 commented on August 23, 2024

Hmm in HA im still not getting any data with the latest version installed. No errors either.

from mytoyota.

antasp3136 avatar antasp3136 commented on August 23, 2024

Any updates on this? Its enabled in Homeassistant but no entities are created.

from mytoyota.

vanstinator avatar vanstinator commented on August 23, 2024

Please file an issue in the na repo and I can take a look.

from mytoyota.

vipul128 avatar vipul128 commented on August 23, 2024

I know this is an old thread, but any chances of doing the same type of decompiling and creating an add-in for the Lexus app as well?

from mytoyota.

dkornahrens avatar dkornahrens commented on August 23, 2024

I know this is an old thread, but any chances of doing the same type of decompiling and creating an add-in for the Lexus app as well?

I've used the Toyota app with my Lexus vehicle and it works just fine. They use the same information, databases, just different branding.

from mytoyota.

dkornahrens avatar dkornahrens commented on August 23, 2024

@widewing Are you still updating the plugin? I see it's been awhile since movement, but I'm not able to login it appears.

from mytoyota.

vipul128 avatar vipul128 commented on August 23, 2024

I tried using this plugin with my lexus credentials but it didn't work. Are you saying I should sign up for an account under the Toyota app and add my VINs there first?

from mytoyota.

jamorenom avatar jamorenom commented on August 23, 2024

@widewing Are you still updating the plugin? I see it's been awhile since movement, but I'm not able to login it appears.

Same here! Hope we get a reply

from mytoyota.

wardwolfram avatar wardwolfram commented on August 23, 2024

@widewing Are you still updating the plugin? I see it's been awhile since movement, but I'm not able to login it appears.

Same here ++!

For my Lexus, I entered my username/PW and was able to log into the integration. I double checked - was able to login to the Lexus app but not with the integration with the same credentials.

Support for Lexus would be excellent!

from mytoyota.

RCG-SW avatar RCG-SW commented on August 23, 2024

image

from mytoyota.

CM000n avatar CM000n commented on August 23, 2024

@widewing Are you still updating the plugin? I see it's been awhile since movement, but I'm not able to login it appears.

Same here ++!

For my Lexus, I entered my username/PW and was able to log into the integration. I double checked - was able to login to the Lexus app but not with the integration with the same credentials.

Support for Lexus would be excellent!

At the moment we are all a bit busy with private stuff. But the first tests and initial work on support for LEyu's vehicles has already begun. See here: #316

Feel free to test it yourself, and create PRs if you have ideas for necessary adjustments. 😊

from mytoyota.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.