molobrakos / volvooncall

Retrieve information from the Volvo On Call (VOC) web service
The Unlicense
158 stars 51 forks source link

Start Car #14

Closed tnemrap closed 6 years ago

tnemrap commented 6 years ago

I can start my Car with the app, is this possible with VOC?

molobrakos commented 6 years ago

Not at the moment, but it is probably doable. A pull request for this is welcome! :-)

molobrakos commented 6 years ago

For this we have to find the commands to send ('engine/start' maybe?). Are you able to find out?

tnemrap commented 6 years ago

Trying to look for it.

tnemrap commented 6 years ago

Used Charles and it is engine/start and engine/stop.

molobrakos commented 6 years ago

Have you tried invoking voc -vv call engine/start?

tnemrap commented 6 years ago

22:56:43 volvooncall: Request for https://vocapi.wirelesscar.net/customerapi/rest/v3.0/vehicles/YV1BW738DXXXXXXXX/engine/start 22:56:43 requests.packages.urllib3.connectionpool: https://vocapi.wirelesscar.net:443 "POST /customerapi/rest/v3.0/vehicles/YV1BW738DXXXXXXXX/engine/start HTTP/1.1" 500 98 22:56:43 volvooncall: Failure when communcating with the server: 500 Server Error: Internal Server Error for url: https://vocapi.wirelesscar.net/customerapi/rest/v3.0/vehicles/YV1BW738DXXXXXXXX/engine/start 22:56:43 volvooncall: Failure to execute: 500 Server Error: Internal Server Error for url: https://vocapi.wirelesscar.net/customerapi/rest/v3.0/vehicles/YV1BW738DXXXXXXXX/engine/start

When using app and charles it uses url https://vocapi.wirelesscar.net/customerapi/rest/vehicles/YV1BW738DXXXXXXXX/engine/start

tnemrap commented 6 years ago

Now i found that it needs data in POST statement. The data is {"runtime":X} where X is 1 to 15 and is the minutes the engine should run.

tnemrap commented 6 years ago

I can start the car with this. curl -H 'X-Client-Version: 4.1.5.21045' -H 'X-Device-Id: b3cbba373be4c28f' -H 'X-OS-Type: Android' -H 'X-OS-Version: 21' -H 'X-Originator-Type: app' -H 'Accept: application/vnd.wirelesscar.com.voc.Service.v4+json; charset=utf-8' -H 'X-Request-Id: 5eea940c-2b6b-40ea-9575-2dcfb78044ba' -H 'Locale: en_US' -H 'Authorization: Basic mysecret' -H 'Content-Type: application/vnd.wirelesscar.com.voc.EngineRemoteStart.v4+json; charset=utf-8' -H 'User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.0.1; GT-I9505 Build/LRX22C)' -H 'Host: vocapi.wirelesscar.net' --data-binary '{"runtime":5}' --compressed 'https://vocapi.wirelesscar.net/customerapi/rest/vehicles/YV1BW738DXXXXXXXX/engine/start'

molobrakos commented 6 years ago

Maybe now:?https://github.com/molobrakos/volvooncall/commit/719289f7890d3828315947a5b04588190e6485f1

tnemrap commented 6 years ago

Close but not yet:

Traceback (most recent call last): File "/usr/local/bin/voc", line 192, in main() File "/usr/local/bin/voc", line 177, in main vehicle.start_engine() File "/usr/local/lib/python3.5/dist-packages/volvooncall.py", line 282, in start_engine if self.engine_stop_supported: AttributeError: 'Vehicle' object has no attribute 'engine_stop_supported'

2018-03-23 20:02 GMT+01:00 Erik Eriksson notifications@github.com:

Maybe now:?719289f https://github.com/molobrakos/volvooncall/commit/719289f7890d3828315947a5b04588190e6485f1

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/molobrakos/volvooncall/issues/14#issuecomment-375768251, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjUnhIC8UnFfTGvagiYmRm7mCdzhmXmks5thUaqgaJpZM4SbTlP .

molobrakos commented 6 years ago

D'oh! https://github.com/molobrakos/volvooncall/commit/3a42fff5adb12ddeb2a9a4cda420167e9dcbcfe8

molobrakos commented 6 years ago

Does it work now? I haven't been able to test myself, since the car is parked in a garage a bit away from my house.

molobrakos commented 6 years ago

Closing for now, please re-open if still an issue.

jorgesousa1975 commented 3 years ago

Why am I getting the error that can't connect to the host? that vocapi.wirelesscar.net:443 ssl:default [Name does not resolve]