Closed oisact closed 3 years ago
@oisact I did not see any way to refresh the data when I was intercepting the traffic from the app to the backend APIs I did not know you could force a refresh from within the app so I do not have any data on how it goes about doing that.
Looks like refresh may be able to be forced via a PUT 'https://usapi.cv.ford.com/api/vehicles/v2/{vin}/status'
RESPONSE: '{"$id":"1","commandId":"blah","status":200,"version":"1.0.0"}'
This should return a commandId which can be queried for successful refresh 'https://usapi.cv.ford.com/api/vehicles/v3/{vin}/statusrefresh/{commandId}' RESPONSE: "vehiclestatus":{}
If individual status parameters come back as NULL or last known then they are considered out of date. if they come back as current then they should be currently valid.
There is some kind of time delay between updates that seems to prevent continuous update requests from producing a refresh from the vehicle.
Tested on a Mach-E
We have a refresh implementation in evcc- let me know if I can help.
@andig mind cross referencing the lines of code? I'd love to implement this for ffpass.
Oh, I might have already found it - seems to be these lines of code:
The Fordpass app has a command that forces an immediate refresh of the vehicle data. Otherwise the API simply returns the data from the last time the vehicle was active or was issued a command, which can be hours old. For things like polling whether or not the doors are currently locked, it is necessary to get the latest info from the vehicle.
Can you determine the Ford API for refreshing, and either add it to the library or provide it here?