-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoteStart.py
More file actions
53 lines (50 loc) · 1.64 KB
/
Copy pathRemoteStart.py
File metadata and controls
53 lines (50 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#Send Command to Start the Vehicle
#Appears to only require VIN and Session ID
import requests
import json
import time
vin = "REDACTED"
sessionID = "REDACTED"
headers = {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Host": "phev.myfordmobile.com",
"Connection": "Keep-Alive",
"User-Agent": "okhttp/4.9.0",
"Content-Type": "application/json; charset=UTF-8",
}
data = {
"PARAMS":{
"apiLevel":"3",
"LOOKUPCODE":"START_CMD",
"VIN": vin,
"SESSIONID": sessionID
}
}
body = json.dumps(data)
lincResp = requests.put("https://phev.myfordmobile.com/services/webAddCommandPS", headers=headers, data=body)
results = lincResp.json()
print("Full Response -- ", results)
print("Remote Start Command ID is:", results['COMMANDID'])
commandID = results['COMMANDID']
data = {
"PARAMS":{
"COMMANDID": commandID,
"SESSIONID": sessionID
}
}
body = json.dumps(data)
complete = False
while complete == False:
time.sleep(5)
lincResp = requests.put("https://phev.myfordmobile.com/services/webGetRemoteCommandStatusPS", headers=headers, data=body)
results = lincResp.json()
print("Full Response -- ", results)
print("Command Status:", results['Entries']['Entry']['status'])
if results['Entries']['Entry']['status'] != "QUEUED":
if results['Entries']['Entry']['status'] == "COMPLETED":
print("Start Command Executed Successfully")
complete = True
else:
print("Start Command Failed -", results['Entries']['Entry']['status'])
complete = True