-
Notifications
You must be signed in to change notification settings - Fork 31
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
Error «Please setup Connected Services» after Migration to new MyToyota App/API #164
Comments
What country are you in? I don't see any my toyota app, only myT on apple app store--Lucian Lazar – Senior Solution ArchitectecoIT Solutions Srl@***@***.*** +40770558273www https://ecoit.solutionsOn Oct 29, 2023, at 13:31, Tom ***@***.***> wrote:
Describe the bug
The Toyota integration has stopped working, seems to have happened at the same time as the car was moved (by Toyota) from the «MyT Toyota» app to the «MyToyota» app.
I get this error message in the logs:
2023-10-29 12:27:21.691 ERROR (MainThread) [mytoyota] Please setup Connected Services if you want live data from the car. (JTM**************)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Norway. I noticed that all the Toyota sensors in HA were unavailable. I opened the MyT app to see what I could see and was met by a notification that car was moved to the MyToyota app and that I should download that. After doing that and logging in, I can see the car and its data in the new MyToyota app, but the HA integration is unsuccessful - with the error message in the OP. |
I can’t anymore set up the car in the old MyT app. If I try, it responds with a message saying I have to use the new MyToyota app. I’m wondering if Toyota have set up a new API and are moving cars to the new app (perhaps staged somehow - for example by country). |
I have the same behavior here in Germany after my vehicle was migrated to the new MyToyota app last week: Since the custom component was only possible due to a reverse engeneering of the old Toyota app by @DurgNomis-drol, I don't know if he will find the time to do that for the new app/API again. 😢 Maybe we should all write to Toyota via different channels and ask them to finally provide us with an official API! |
I just wrote an email to Toyota. Let's see if something comes back:
|
Hello everybody! This is sad to see, but I am not surprised that they made a new app. I still use the old app, so it is still working for me (but this could change in the future and will probably change med decision below if this happens). At this point in time I have no plans to work on adopting this for the new API. The reason is that my car (Toyota Aygo) doesn't have support for many features. This is also the reason that my development of this integration stalled. As it was becoming to much work to maintain many of the features that exists when I couldn't test them myself (or enjoy them). Reverse engineering is hard work and can take a long time just to get an idea of what is possible. With the currently used API, it took me a long time to understand all the quirks. But I was also lucky that had a starting point. @CM000n provided valuable feedback in the start and help a lot. If I am gonna convert this to the new API, I am not gonna add more features then what I can support with my own car. This is to make sure it will be manageable for me in the future. If anyone would like to take on this task, you are of cause more then welcome to take any thing for this repository. |
Hi @DurgNomis-drol, sorry to hear that, but totally understandable! By the way, the migration of the vehicles to the new App/API takes place without any active interactions @DurgNomis-drol. |
@CM000n Well then I will try not to open the App 😉 or I will have a winter project on my hand again 😆 🚀 |
I checked my app, and my corolla has not been moved yet, but from what i can read here, this might happen within the next days. When this happens, maybe i can provide informations, or also can help to code a library for the new api. |
@nielsvdc This is exactly what I see as well, with a bZ4x |
Today I took a closer look at the decompiled MyToyota .apk file. It seems that none of the previous But when I look at the console log of the customer area of toyota.de, it still seems to make api calls against the An interesting address that I found in the app is this one: |
I haven't look in the .apk file like you have, @CM000n, but I played around with the old API a bit and noticed that the "legacy" endpoint
Don't know how long that will last, though. |
Good finding @uphillbattle ! If I have time, I'll play around with the old API endpoint tomorrow too. By the way: I was just about to visit our friends at Toyota Home Assistant Integration for North America to see which endpoints are used there. |
Well now I got the email, but I haven't opened the app, and it still seems to work, so I believe it only moves you to the new app if you open the old one 🎉 |
I can confirm up to now. |
Hi @DurgNomis-drol and @m-dietrich, I took another look today and I think we are dealing with two problems here: 1. The “Please setup Connected Services …” error This is an internal error of the 2. Changed API Endpoint for vehicle's trips? At first I thought we were dealing with a changed API endpoint here. import asyncio
from pprint import pprint
from mytoyota.client import MyT
username = "USERNAME"
password = "PASSWORD"
brand = "toyota" # or lexus
# Get supported regions, can be passed to the optional 'region' argument of MyT
# At this moment, only the 'europe' region is supported
pprint(MyT.get_supported_regions())
client = MyT(username=username, password=password, brand=brand)
async def get_information():
pprint("Logging in...")
await client.login()
pprint("Retrieving cars...")
# Returns cars registered to your account + information about each car.
cars = await client.get_vehicles()
pprint(cars)
for car in cars:
vehicle = await client.get_vehicle_status(car)
# Calling the vehicle status object directly continues to work:
pprint("Vehicle Info..")
pprint(vehicle._vehicle_info)
pprint("Connected Services..")
pprint(vehicle._connected_services)
pprint("Odometer..")
pprint(vehicle.odometer)
pprint("Status..")
pprint(vehicle._status)
pprint("Status Legacy..")
pprint(vehicle._status_legacy)
# Colling the vehicle dashboard object works after fixing the "Connected Services Enabled" Check:
pprint(vehicle.dashboard.odometer)
# Vehicle driving statistics also still seem to be working after fixing "Connected Services Enabled" Check:
data = await asyncio.gather(
*[
client.get_driving_statistics(vehicle.vin, interval="day"),
client.get_driving_statistics(vehicle.vin, interval="isoweek"),
client.get_driving_statistics(vehicle.vin),
client.get_driving_statistics(vehicle.vin, interval="year"),
]
)
pprint(data)
# Daily stats
daily_stats = await client.get_driving_statistics(vehicle.vin, interval="day")
pprint(daily_stats)
# ISO 8601 week stats
iso_weekly_stats = await client.get_driving_statistics(vehicle.vin, interval="isoweek")
pprint(iso_weekly_stats)
# Monthly stats is returned by default
monthly_stats = await client.get_driving_statistics(vehicle.vin)
pprint(monthly_stats)
# Get year to date stats.
yearly_stats = await client.get_driving_statistics(vehicle.vin, interval="year")
pprint(yearly_stats)
loop = asyncio.get_event_loop()
loop.run_until_complete(get_information())
loop.close() So it seems that we don't have to look for a new API endpoint for the trip statistics (for now). |
This gist will get you connected to the new toyota services. You need to enter your username, password and GUID at the top of the file. The problem is the GUID this is your customer ID but I have yet to work out how the toyota app knows what this is! You can find it by logging into My Toyota website and in the developer tools find a request for |
Hi @GitOldGrumpy, good finding! The system behind By the way: Authentication is also still possible via |
Yep it is ForgeRock AS and once you have your access token it changes URL from |
What is the GUID (customerId) format? I haven't been able to locate the |
I start at Hopefully you can find it and then confirm that it is working for you. |
I think it is using the UUID from the single sign on as GUID @GitOldGrumpy. |
I've just had a look the UUID is the GUID but the access token does not work, which is to be expected. Still confused on where the new app pulls this from... |
@CM000n Sounds good if this fixes it! But I don't have an answer regarding |
Updated the gist with some of the endpoints I've found but for some reason I'm not authenticated for them all. |
Hi, I was migrated also with my Yaris Cross (2023) (works with new status API endpoint) and RAV4 Plugin (2022) (works only with legacy status endpoint) and HA integration stopped working as described here in comments. However when testing API using mytoyota python lib, I was able to get all needed information. Same with calling directly APIs. Unfortunately I didn't stored all API responses to compare but looks like smart info is missing (status info about locks, lights etc.) so maybe for that is now only special API endpoint. API endpoint for "connected services": https://cpb2cs.toyota-europe.com/vehicle/user/{{uid}}/vehicle/{{VIN_RAV4}}?legacy=true&services=fud,connected so maybe this is the reason why HA integration states that connected services are offline? EDIT: I see @CM000n already fixed it with DurgNomis-drol/mytoyota#240 👍 anyhow all other APIs worked well: location: https://myt-agg.toyota-europe.com/cma/api/users/{{uid}}/vehicle/location as stated cannot compare API results but one big difference I see is that "status endpoint" for new cars now doesn't show lock/light statuses... results is exactly same as for older vehicle... I had one issue before with my RAV4 that it didn't show any legacy information which was available in mytoyota lib
|
Hi @DurgNomis-drol and @HuffYk, I just created a tag for testing the update to mytoyota >= 0.9 within the ha_toyota custom integration: https://github.com/DurgNomis-drol/ha_toyota/releases/tag/v2.0.0-testing I also don't have much time at the moment, but I'll see how much of it I can spare for ha_toyota in the meantime 😉 Unfortunately updating to the new mytoyota version it's a bit of trial and error because we don't have good unit tests for the custom integration and writing them is unfortunately a bit of a PITA. So any help is more than welcome! |
Hi @CM000n, did few tests. Looks like some changes from master branch have to be merged first. e.g. I had to fix deprecated async_setup_platforms with
Maybe some other changes from master should be merged also? I temporary fixed mytoyota lib to overcome "connected services" issue and now HA integration connected successfully, but it received only location for each car nothing else. And in log there are these errors (enabled also debugging):
not sure if it is because something has to be merged from master what was already fixed or it is connected with new mytoyota lib or it is connected with new API json format :/ will continue tomorrow with more tests... |
The master branch ist already merged 😉 |
Hi @CM000n If I compare e.g.
introduced in v1.2.11 release (https://github.com/DurgNomis-drol/ha_toyota/pull/126/files ) |
did some testing with official v1.2.11, I patched mytoyota lib to overcome "connected services" issue and now I was able to receive other sensors: RAV4 Plugin (2022) - older legacy API (not available status of locks or lights in API)
missing sensors what I remember:
Yaris Cross (2023) - new API (status of locks and lights is available in API)
missing sensors what I remember:
So for anyone who wants to have quick fix with current HA integration, here are steps to patch mytoyota lib in HASSIO running in Docker (debian):
with this:
|
Yes, I think some of the incoming and existing changes were lost during the merge when the merge conflicts were resolved. |
Hi @GitOldGrumpy however token from ssoms doesn't work for |
That's great! With this "dirty" fix and v1.2.11, I get the data I need: I use the integration for controlling the charging (it's a bZ4x, so an EV), and I can find the "remaining charge" as a attribute to the |
Hi @CM000n would it be possible to add back v2.0.0-testing tag ? I would like to test during weekend, but not in my production env (where I installed it yesterday), but rather I created dev env in RPI so would like to install it there from UI rather than manually updating all needed files in shell. thanks! |
Hi @HuffYk, No, the tags don't make much sense, as I found out when so many changes are made. The best way to test this is to pull the latest version of the Repo / V2 branch and manually replace the "toyota" folder in the custom components directory of your Home Assistant installation. |
ok understand, no problem |
@CM000n let me know if anything is ready for testing. I tried now latest V2 and getting this errors in log:
and few In UI I'm able to see locations and few sensors all with unavailable or unknown status. |
Hi @HuffYk, thank you very much. I am already aware of that. Please see the comment in the associated pull request. |
Were have we moved discussions too? I can pull from the new endpoints all most all of the information relevant to my cars(which is everything I could get on the old endpoints plus all the trip details) but to move forward need some help getting hold of further endpoints and either integrating the new endpoint into the current mytoyota or creating something new? |
Please open an PR in https://github.com/DurgNomis-drol/mytoyota so we can start implementing the new API endpoints |
Describe the bug
The Toyota integration has stopped working, seems to have happened at the same time as the car was moved (by Toyota) from the «MyT Toyota» app to the «MyToyota» app.
I get this error message in the logs:
The text was updated successfully, but these errors were encountered: