Toyota Connect

Cheers! That fixed it :slight_smile:

1 Like

Hi, everyone
does anyone know about Postmann?
I have a little problem with the API.
To better understand the API, I would like to test the API with Postmann. When I log in, I get an error message:

400 - {“message”: "org.xml.sax.SAXParseException; columnNumber: 0; cvc-complex-type.2.4.b: The content of element
‘ps1: authenticate’ is not complete. One of ‘{\ "http: //taas.toyota-europe.com ": username}’ is expected. "}

I set the username and password correctly.

Strangely enough, the generated PythonCode does not return an error message, but rather the result 200.
The generated JS code brings the same error message as Postmann

import requests
url = "https://ssoms.toyota-europe.com/authenticate"
payload = {'username': 'xx',
'password': 'yy'}
files = []
headers = {
  'X-TME-BRAND': 'TOYOTA',
  'X-TME-LC': 'de-de',
  'Accept': 'application / json, text / plain, * / *',
  'Sec-Fetch-Dest': 'empty'
}
response = requests.request ("POST", url, headers = headers, data = payload, files = files)
print (response.text)

Can someone help me please?

RG
Stefan

What and why are you trying to achieve? (Just curious, as I am the person behind the Python Client library (GitHub - DurgNomis-drol/mytoyota: Python client for Toyota Connected Services API)

Hi
yes i know you did a very good job. But I would like to understand the API call better and build an adapter with JS for the IOBroker.

RG
Stefan

Sorry, read your post again, and now i understand what you are trying to do. I have no experience with Postmann, but I am probably one the persons who knows the quirks of there API the best. Please see this python file for a better understanding and feel free to contact me over on the github repository (Just open a discussion) if you need help with anything.

And cool! Awesome to see more clients for different languages!

And this file contains some of the available endpoints.

yes i know you did a very good job

And thank you very much!

Hi I can’t get a successful login to the Toyota API with Postmann, I think there is probably a problem with the header.

I use the google translator for DE-EN
R
Stefan

Headers should be:

"Content-Type": "application/json;charset=UTF-8",
"Accept": "application/json, text/plain, */*",
"Sec-Fetch-Dest": "empty",
"X-TME-BRAND": "TOYOTA",
"X-TME-LC": "en-gb",

Changing X-TME-LC to you locale does not matter, it just have to be a valid European one i believe.

Second of all, the payload should be sent as JSON and not just normal data. Use the json argument instead of the payload argument. Leave out the files argument as it should not be sent.

And thirdly, you get an JSON response. :smiley:

Hope this helps

Hi
thank you that was the right tip
The API Connect with Postmann is now working.

‘Content-Type’: ‘application/json’

payload = json.dumps({
  "username": "xxx",
  "password": "yyy"
})

headers={
  'X-TME-BRAND':'TOYOTA',
  'X-TME-LC':'de-de',
  'Accept':'application/json,text/plain,*/*',
  'Sec-Fetch-Dest':'empty',
  'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, data=payload)

R
Stefan

1 Like

Literally, all I want in life is for this to work for US. :frowning:

Someone was working on it, but I have no idea if came to anything.

Anyone else getting this when trying to setup the toyota_na integration?

image

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’)

1 Like

Maybe because you are in NorthAmerica? The Integration is only for Europe as far as I know.
No one has yet reverse engineered the corresponding Toyota servers for the other countries/continents from the respective apps

Hello apologies ahead of time. I am a HA noob. I recently installed the NA toyota integration and it is working well. The only thing I do not see is a way to activate the remote start.

Is this possible with the HA integration?

I glanced through the GitHub repos and didn’t see this answered, do these APIs list the battery level and current charging status for compatible models such as Rav4 Prime etc?

I noticed it doesn’t work for NA, but if those values were available I might put some effort into figuring out if NA access is possible.

It seems like at least one third party company has done it.

Short info for all who use the custom integration for Toyota Connected Services Europe:
Due to a changeover from the previous MyT to the new MyToyota app and a, presumably associated change of the API, the custom integration of @DurgNomis-drol is currently no longer working:

By the way, it seems that the repo with the Python lib for the related Toyota Home Assistant custom component for North America has been taken down with a DMCA notice: https://github.com/widewing/toyota-na

Let’s hope Toyota Europe doesn’t take similar steps. It’s sad to see this behavior of car makers currently (see shutdown of open HA Mazda integration)

@CM000n Yeah, it sad that they do it. But the NA repository hosted the decompiled app in the repository if i remember correctly. And that can cause problems, as publishing Toyota’s source code is actually illegal. That’s why I haven’t published the decompiled android app code to the repository.

1 Like

Hi there! I see some good discussions in the link shared on the issue and the issue is closed there. I however see there is no new release (still on v1.2.11 which is the latest according to HACS).

Is there a way I can help out testing or is there already a release I can use?
Thanks for all you and @DurgNomis-drol do!