Open initdebugs opened 2 years ago
Good new, and congratulations to your new car. I hope you love it :) First question: Is the mycupra app already working for you? If it is working the complicated part starts. I would prepare a test version for you to try out.
Yes it is working! I can send you screenshots or whatever you need if you want. Would it be easier to discuss this via Discord or would you like to keep everything in Github?
Just let me know what information you need :)
I would prefer if we could keep the discussion here at GitHub to allow potentially others to also try it out. Also it helps a bit my working style as I can answer asynchronously :) If we have confidential parts let's use an email.
Are you a bit experienced in SW development and using python? I have a first version in a separate branch that we could use for initial testing.
I have some experience in python, but I have no idea what steps I should take when trying this out. Could you explain what I should do?
sure,
you need to clone the project: git clone https://github.com/tillsteinbach/WeConnect-python.git
and cd WeConnect-python
install all requirements: pip3 install -r requirements.txt
then you switch to the seat branch: git checkout feature/seat
then go to the examples folder: cd examples
and try out python allVehicles.py -b seat -u yourmyseatusername -p yourpassword
I guess it won't work out of the box, but we can try continuing from there with the error messages we get.
Traceback (most recent call last): File "allVehicles.py", line 32, in <module> main() File "allVehicles.py", line 13, in main parser.add_argument('-b', '--brand', help='Brand if other (e.g. seat)', required=False, type=weconnect.WeConnect.Brand, AttributeError: type object 'WeConnect' has no attribute 'Brand'
Can you do a python --version
for me? We need at least python 3.7
I'm on 3.8.8
hmmmm, can you try to install it like that: pip3 install -e .
and then execute the command again? might have something todo with paths
ah sorry you need to execute that in the WeConnect-python
folder, not examples
That's what it said in command prompt. What now?
so on the positive side: you did not get an error :) on the negative side: also no data.
I would need to see now what is coming back from the server.
Can you add weConnect.persistCacheAsJson('test.json')
right after print('# done')
this should write a file with the answer from the server
The file is empty :(
hmmm, ok, new try:
Lets use the CLI it has more logging options:
git clone https://github.com/tillsteinbach/WeConnect-cli.git
cd WeConnect-cli
git checkout feature/seat
pip3 install -e .
and then:
weconnect-cli -vvv -b seat -u yourmyseatusername -p yourpassword get /
this should give you more output
I assume the last line should be python weconnect-cli -vvv -b seat -u yourmyseatusername -p yourpassword get /
I get the error about WeConnect not having attribute 'Brand'. I tried doing the pip3 install -e . but that doesn't help
no, after the pip3 install -e .
the python in front should not be necessary.
what does weconnect-cli --version
say?
Without python works, but gives the same error about the attribute 'Brand'.
weconnect-li --version gives the same error as well
maybe it has overwritten the library, can you do a pip3 install -e .
in the WeConnect-python
folder again and then try weconnect-cli?
When trying pip3 install -e . in WeConnect-python:
yes, but I think it still overwrite the package. Can you now do a weconnect-cli
--version ?
It still gives the attribute error
grrr. Maybe try a pip3 install -e . --force
weconnect-cli --version
now gives:
weconnect-cli develop (using WeConnect-python develop
ok, that is better. now we can go back to: weconnect-cli -vvv -b seat -u yourmyseatusername -p yourpassword get /
The Cache file is empty, the token file has, well, tokens.
with -vvv it should also output something about the communication that is going on
I'll post it, is there no sensitive data about my account in there?
There might be the VIN maybe: You can also send me an email: steinbach.till@gmx.de
I send you an email
Did you receive it? Let me know if you need anything else :)
Yes, I answered your mail. I think we are a bit stuck here. It is very hard to debug that remotely
{"vehicles":[{"vin":"myvin","enrollmentStatus":"completed","userRole":"primary","vehicleNickname":"CUPRA Born","specifications":{"salesType":"K11B3C","colors":{"exterior":"C2","interior":"UC","roof":"C2"},"wheels":{"rims":"F35","tires":"J49"},"steeringRight":false,"sunroof":false,"heatedSeats":true,"marketEntry":2}}]}
this came out of the thing you mailed me.
hmmm, this looks a lot different than the volkswagen version. I think for now there is not so much I can do without having access to a car and looking if there is another way to access the data in a similar way like the Volkswagen API
What would you exactly need from me?
trust :) You would need to change your password, send me your user and password. I would analyse the traffic between the App and the Code and after a day or two you could change your password back. Unfortunately secondary users are not yet possible. That would be the variant where you would need less trust ;)
I send you an email
You can change your password back
I analysed a bit what is going on. I believe that cupra is not using the same version of the API (it looks like a very early version, so maybe they are a bit behind). The requests and responses look a bit different. I think we need to look again in some months if something was changed
Okay, is there nothing you can do with the current version? Thanks for checking it out
Unfortunately this would be close to completely writing the library again. I can put that on the TODO list, but for now it would have low priority due to the lack of CUPRA vehicles on the streets. But that might change in the future.
I understand. When the My Cupra app or my car updates, I'll let you look again! Thanks for the help anyway
There has been a new release of the MyCupra app. Would now be a good time to re-investigate this?
I have had a look again. It is going "in the right direction" I can see that the correct endpoints are there, but most give a 500 error back.
I am interested with where this is going and am willing to lend a hand if there's anything I can do. I have python experience and a Cupra Born for testing.
I'm really not surprised about the 500 errors. Up until about 2 weeks ago, the app would pretty much have a permanent "something went wrong" popping up, probably due to those broken endpoints. Recently at least the app seems to have been fully working, or at least working enough such that the errors have stopped, so it would be interesting to test again.
I gave it a quick try myself but it seems to fail after
GET /signin-service/v1/3c756d46-f1ba-4d78-9f9a-cff0d5292d51@apps_vw-dilab_com/login/authenticate
with No credentials form found
So you tried the cupra session? https://github.com/tillsteinbach/WeConnect-python/blob/main/weconnect/auth/my_cupra_session.py I have no cupra account so maybe they changed the login sequence and I would have to update it.
Hi all, another couple of months have passed and it looks like the Cupra mobile app has been pretty stable through this time. Could this be a good time to investigate whether it can be integrated properly? It would be great to have this work started as it's key to getting some form of integration into HA and the lovely bit of hardware I have sat waiting to display charge / range status has been sadly neglected since the car arrived earlier in the summer!
I know that myself and at least one other person here are happy to share app credentials for our own vehicles in order to facilitate this development, if this would help things.
Yes I agree. I would like to check again. If needed I can share my My Cupra account credentials. Let me know
Hi there! I recently picked up my Cupra Born and I'd love to make this work with my car as well. Could you tell me what I can do to help?