Brandawg93 / homebridge-fordpass

Control your Ford vehicle in HomeKit using Homebridge.
GNU General Public License v3.0
62 stars 15 forks source link

Refactor Authorization using Ford's Official Developer API #244

Closed smith288 closed 4 months ago

smith288 commented 7 months ago

This pull request aims to refactor the HomeBridge FordPass plugin to utilize the latest official Ford Developer API. The plugin currently relies on an unsupported FordPass API, which is being replaced by the new official API provided by Ford as it had been abused by the open-source community to the point of account disabling.

Key Changes:

Updated plugin dependencies to support the new Ford Developer API. Refactored API endpoints, authentication methods, and data retrieval logic to align with the new official API specifications. Migrated existing functionality to utilize the new API endpoints for improved reliability and compatibility. Updated documentation and README to reflect the changes and provide instructions for plugin users on how to migrate to the new version.

Caveats:

Although this PR brings the plugin up to legitimacy using Ford's publicly available API through their developer program, abuse of the API can still possibly lead to disabling of an account or create a drain on your vehicle's 12v battery as before. The very nature of a HomeBridge plugin lends itself to continually poll for updates from the car which is why it's important to weigh the interval against the necessity of up-to-the-second data of the status of the vehicle.

Compatibility: Ensures compatibility with the latest Ford Developer API, allowing users to continue accessing Ford vehicle data seamlessly. Reliability: Utilizes the officially supported API endpoints, reducing the risk of service disruptions and deprecated functionality. Longevity: Future-proofs the plugin by aligning with Ford's official development standards, ensuring ongoing support and maintenance.

Testing: Thoroughly tested the plugin against the new API endpoints to verify functionality and compatibility. Conducted integration tests to validate data retrieval and command execution against Ford vehicles. Tested edge cases and error handling to ensure robustness and reliability in various scenarios.

Contributions:

Contributions and feedback from the community are welcome and appreciated to ensure the plugin meets the needs of users and remains up-to-date with Ford's API developments. Overall, this pull request represents a significant improvement to the HomeBridge FordPass plugin, bringing it in line with the latest standards and ensuring continued support for users accessing Ford vehicle data through HomeBridge.

Brandawg93 commented 6 months ago

Finally getting around to this. I've published a new test for others to try! v1.10.0-test.0. Let me know if it works for you too.

cmorozcogmailcom commented 6 months ago

how can I add the v1.10.0-test.0 version to hoobs?

Brandawg93 commented 6 months ago

You should be able to install via npm i homebridge-fordpass@test.

cmorozcogmailcom commented 6 months ago

Can't seem to update the current installed homebridge-fordpass plugin. I tried installing it but I don't seem to be able to see it on the hoobs platform.

cmorozcogmailcom commented 6 months ago

i'm seeing this in the hoobs log - Fordpass BridgeConfiguration change 3/25/2024, 6:54:18 PMFordpass BridgeConfiguration change 3/25/2024, 6:54:18 PMfordpassbridge stopping 3/25/2024, 6:54:18 PMfordpassbridge stopping 3/25/2024, 6:54:24 PMFordpass Bridge starting 3/25/2024, 6:54:24 PMFordpass Bridge starting 3/25/2024, 6:54:35 PMFordpass BridgeLoaded plugin 'homebridge-fordpass' 3/25/2024, 6:54:35 PMFordpass BridgeLoaded plugin 'homebridge-fordpass' 3/25/2024, 6:54:35 PMFordpass BridgeLoading 1 platforms... 3/25/2024, 6:54:35 PMFordpass BridgeLoading 1 platforms... 3/25/2024, 6:54:36 PMFordpass BridgeBridge is running on port 51856. 3/25/2024, 6:54:36 PMFordpass BridgeBridge is running on port 51856. 3/25/2024, 6:54:37 PMFordpass BridgeFordPassERRORAuth failed with status: undefined 3/25/2024, 6:54:37 PMFordpass BridgeFordPassERRORAuth failed with status: undefined 3/25/2024, 6:54:37 PMFordpass BridgeFordPassERRORAuth failed with status: undefined 3/25/2024, 6:54:37 PMFordpass BridgeFordPassERRORAuth failed with status: undefined 3/25/2024, 6:54:37 PMFordpass BridgeFordPassERRORAuth failed with status: undefined 3/25/2024, 6:54:37 PMFordpass BridgeFordPassERRORAuth failed with status: undefined also my config is { "platform": "FordPass", "options": { "refreshRate": 300 }, "username": "cxxxx@gmail.com", "password": “xxxxx”, "batteryName": "Battery", "autoRefresh": true, "refreshRate": 30, "chargingSwitch": true, "plugSwitch": true, "application_id": "APPLICATION_ID", "client_id": “xxxxxxxxx”, "client_secret": “xxxxxx”, "code": "FORD_AUTH_CODE", "vehicles": [ { "name": "Ford Escape", "vin": "1FMCxxxxxxx40" } ] } i xxxx out the secret stuff

Brandawg93 commented 6 months ago

I’ve seen that issue before. It’s because hoobs caches plugin versions. You may have to wait a day or so for it to update. Or use Homebridge 😜

cmorozcogmailcom commented 6 months ago

well i made more progress, I got hoob to start the fordpass bridge. . I signed up for an account on ford's developer site and setup my account and authorized my fordpass vehicle from the instructions provided and linked my account via the ford connect url. i got the code and got my clientId, client_secret codes and the token for the "code" entry on the config.json file. I tested the api using the postman app and verify my "code" token works. my config.json looks like this { "platform": "FordPass", "options": { "refreshRate": 300 }, "username": "my username", "password": "my password", "batteryName": "Battery", "autoRefresh": true, "refreshRate": 30, "chargingSwitch": false, "plugSwitch": false, "application_id": "APPLICATION_ID", "client_id": "my client id", "client_secret": "my secret code", "code": "code returned from https://fordconnect.cv.ford.com/common/login/?make=F&application_id=AFDC085B-377A-4351-B23E-5E1D35FB3700&client_id=30990062-9618-40e1-a27b-7c6bcb23658a&response_type=code&state=123&redirect_uri=https%3A%2F%2Flocalhost%3A3000&scope=access", "vehicles": [ { "name": "Ford Escape", "vin": "my vin" } ] }

now I get authorized but i see a a different error - 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERROR Error occurred during request: Request failed with status code 500 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse status: 500 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse data: {"error":{"code":4003,"title":"Unknown error","details":"A error has occured with request.","statusCode":"INTERNAL_SERVER_ERROR"},"status":"FAILED","vehicles":null} 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse headers: {"server":"nginx/1.18.0 (Ubuntu)","date":"Tue, 26 Mar 2024 16:06:28 GMT","content-type":"application/json","content-length":"164","vary":"Origin,Access-Control-Request-Method,Access-Control-Request-Headers","clientid":"30990062-9618-40e1-a27b-7c6bcb23658a","userguid":"136a662b-1594-6361-35b9-2f6735b92f67","x-content-type-options":"nosniff","x-xss-protection":"0","cache-control":"no-cache, no-store, max-age=0, must-revalidate","pragma":"no-cache","expires":"0","x-frame-options":"DENY","x-cloud-trace-context":"425cb9526327461e12300dc9736f32a6;o=1","referrer-policy":"no-referrer","x-request-id":"f15a6132-3877-497a-b35d-cf6a0380bf39","via":"1.1 google","x-from":"apigee","x-glb-version":"1.2","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000","connection":"close"}

and I get a fordpass-security-credentials.json created on the /var/lib/hoobs/fordpass directory. looks like an access_token created

not sure where to go from here.

mcneyens commented 6 months ago

well i made more progress, I got hoob to start the fordpass bridge. . I signed up for an account on ford's developer site and setup my account and authorized my fordpass vehicle from the instructions provided and linked my account via the ford connect url. i got the code and got my clientId, client_secret codes and the token for the "code" entry on the config.json file. I tested the api using the postman app and verify my "code" token works. my config.json looks like this { "platform": "FordPass", "options": { "refreshRate": 300 }, "username": "my username", "password": "my password", "batteryName": "Battery", "autoRefresh": true, "refreshRate": 30, "chargingSwitch": false, "plugSwitch": false, "application_id": "APPLICATION_ID", "client_id": "my client id", "client_secret": "my secret code", "code": "code returned from https://fordconnect.cv.ford.com/common/login/?make=F&application_id=AFDC085B-377A-4351-B23E-5E1D35FB3700&client_id=30990062-9618-40e1-a27b-7c6bcb23658a&response_type=code&state=123&redirect_uri=https%3A%2F%2Flocalhost%3A3000&scope=access", "vehicles": [ { "name": "Ford Escape", "vin": "my vin" } ] }

now I get authorized but i see a a different error - 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERROR Error occurred during request: Request failed with status code 500 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse status: 500 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse data: {"error":{"code":4003,"title":"Unknown error","details":"A error has occured with request.","statusCode":"INTERNAL_SERVER_ERROR"},"status":"FAILED","vehicles":null} 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse headers: {"server":"nginx/1.18.0 (Ubuntu)","date":"Tue, 26 Mar 2024 16:06:28 GMT","content-type":"application/json","content-length":"164","vary":"Origin,Access-Control-Request-Method,Access-Control-Request-Headers","clientid":"30990062-9618-40e1-a27b-7c6bcb23658a","userguid":"136a662b-1594-6361-35b9-2f6735b92f67","x-content-type-options":"nosniff","x-xss-protection":"0","cache-control":"no-cache, no-store, max-age=0, must-revalidate","pragma":"no-cache","expires":"0","x-frame-options":"DENY","x-cloud-trace-context":"425cb9526327461e12300dc9736f32a6;o=1","referrer-policy":"no-referrer","x-request-id":"f15a6132-3877-497a-b35d-cf6a0380bf39","via":"1.1 google","x-from":"apigee","x-glb-version":"1.2","alt-svc":"h3=":443"; ma=2592000,h3-29=":443"; ma=2592000","connection":"close"}

and I get a fordpass-security-credentials.json created on the /var/lib/hoobs/fordpass directory. looks like an access_token created

not sure where to go from here.

Where did you get the application ID that you fed into that URL to get the Code? I have the rest figured out but it’s been a while since I created my account and cant find that APP ID

smith288 commented 6 months ago

Application id is found in the word document in the developer portal of ford.

But it looks like it’s always the same in the authorize access url

https://fordconnect.cv.ford.com/common/login/?make=F&application_id=AFDC085B-377A-4351-B23E-5E1D35FB3700&client_id=30990062-9618-40e1-a27b-7c6bcb23658a&response_type=code&state=123&redirect_uri=https%3A%2F%2Flocalhost%3A3000&scope=access

cmorozcogmailcom commented 6 months ago

i found my application id and now I have run into trying to get passed a warning. MFordpass BridgeLoaded plugin 'homebridge-fordpass' 3/27/2024, 12:35:50 AMFordpass BridgeLoading 1 platforms... 3/27/2024, 12:35:51 AMFordpass BridgeBridge is running on port 51856. 3/27/2024, 12:35:56 AMFordpass BridgeWARNINGunhandled rejection: TypeError: Cannot set properties of undefined (setting 'vehicleId')

smith288 commented 6 months ago

i found my application id and now I have run into trying to get passed a warning. MFordpass BridgeLoaded plugin 'homebridge-fordpass' 3/27/2024, 12:35:50 AMFordpass BridgeLoading 1 platforms... 3/27/2024, 12:35:51 AMFordpass BridgeBridge is running on port 51856. 3/27/2024, 12:35:56 AMFordpass BridgeWARNINGunhandled rejection: TypeError: Cannot set properties of undefined (setting 'vehicleId')

Does your https://api.mps.ford.com/api/fordconnect/v2/vehicles endpoint list your cars? And if so, is vehicleId one of the properties of the vehicle record?

cmorozcogmailcom commented 6 months ago

well i made more progress, I got hoob to start the fordpass bridge. . I signed up for an account on ford's developer site and setup my account and authorized my fordpass vehicle from the instructions provided and linked my account via the ford connect url. i got the code and got my clientId, client_secret codes and the token for the "code" entry on the config.json file. I tested the api using the postman app and verify my "code" token works. my config.json looks like this { "platform": "FordPass", "options": { "refreshRate": 300 }, "username": "my username", "password": "my password", "batteryName": "Battery", "autoRefresh": true, "refreshRate": 30, "chargingSwitch": false, "plugSwitch": false, "application_id": "APPLICATION_ID", "client_id": "my client id", "client_secret": "my secret code", "code": "code returned from https://fordconnect.cv.ford.com/common/login/?make=F&application_id=AFDC085B-377A-4351-B23E-5E1D35FB3700&client_id=30990062-9618-40e1-a27b-7c6bcb23658a&response_type=code&state=123&redirect_uri=https%3A%2F%2Flocalhost%3A3000&scope=access", "vehicles": [ { "name": "Ford Escape", "vin": "my vin" } ] } now I get authorized but i see a a different error - 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERROR Error occurred during request: Request failed with status code 500 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse status: 500 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse data: {"error":{"code":4003,"title":"Unknown error","details":"A error has occured with request.","statusCode":"INTERNAL_SERVER_ERROR"},"status":"FAILED","vehicles":null} 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse headers: {"server":"nginx/1.18.0 (Ubuntu)","date":"Tue, 26 Mar 2024 16:06:28 GMT","content-type":"application/json","content-length":"164","vary":"Origin,Access-Control-Request-Method,Access-Control-Request-Headers","clientid":"30990062-9618-40e1-a27b-7c6bcb23658a","userguid":"136a662b-1594-6361-35b9-2f6735b92f67","x-content-type-options":"nosniff","x-xss-protection":"0","cache-control":"no-cache, no-store, max-age=0, must-revalidate","pragma":"no-cache","expires":"0","x-frame-options":"DENY","x-cloud-trace-context":"425cb9526327461e12300dc9736f32a6;o=1","referrer-policy":"no-referrer","x-request-id":"f15a6132-3877-497a-b35d-cf6a0380bf39","via":"1.1 google","x-from":"apigee","x-glb-version":"1.2","alt-svc":"h3=":443"; ma=2592000,h3-29=":443"; ma=2592000","connection":"close"} and I get a fordpass-security-credentials.json created on the /var/lib/hoobs/fordpass directory. looks like an access_token created not sure where to go from here.

Where did you get the application ID that you fed into that URL to get the Code? I have the rest figured out but it’s been a while since I created my account and cant find that APP ID

postman helps. - https://www.postman.com/home you can use it to see the code and app id.

AFDC085B-377A-4351-B23E-5E1D35FB3700 is , it's also in the ford connect getting started doc. in the url https://fordconnect.cv.ford.com/common/login/?make=F&application_id=AFDC085B-377A-4351-B23E-5E1D35FB3700&client_id=30990062-9618-40e1-a27b-7c6bcb23658a&response_type=code&state=123&redirect_uri=https%3A%2F%2Flocalhost%3A3000&scope=access

cmorozcogmailcom commented 6 months ago

i found my application id and now I have run into trying to get passed a warning. MFordpass BridgeLoaded plugin 'homebridge-fordpass' 3/27/2024, 12:35:50 AMFordpass BridgeLoading 1 platforms... 3/27/2024, 12:35:51 AMFordpass BridgeBridge is running on port 51856. 3/27/2024, 12:35:56 AMFordpass BridgeWARNINGunhandled rejection: TypeError: Cannot set properties of undefined (setting 'vehicleId')

Does your https://api.mps.ford.com/api/fordconnect/v2/vehicles endpoint list your cars? And if so, is vehicleId one of the properties of the vehicle record? i do get this result - i put a this.log.error line in the code to emit the vehicle data with JSON.stringify 3/27/2024, 11:15:28 AMFordpass BridgeFordPassERROR{"vehicleId":"ff8080818e575382018e659d7065005b","make":"F","modelName":"Escape","modelYear":"2020","color":"VELOCITY BLUE","nickName":"My Escape","modemEnabled":true,"vehicleAuthorizationIndicator":1,"serviceCompatible":true} 3/27/2024, 11:15:28 AMFordpass BridgeWARNINGunhandled rejection: TypeError: Cannot set properties of undefined (setting 'vehicleId') 3/2

{ "status": "SUCCESS", "vehicles": [ { "vehicleId": "ff8080818e575382018e659d7065005b", "make": "F", "modelName": "Escape", "modelYear": "2020", "color": "VELOCITY BLUE", "nickName": "My Escape", "modemEnabled": true, "vehicleAuthorizationIndicator": 1, "serviceCompatible": true } ] }

Brandawg93 commented 6 months ago

+1 for postman! And I haven’t actually had time to test this PR myself yet. But mitmproxy with the iOS or android app is usually the way I reverse engineer these things.

smith288 commented 6 months ago

well i made more progress, I got hoob to start the fordpass bridge. . I signed up for an account on ford's developer site and setup my account and authorized my fordpass vehicle from the instructions provided and linked my account via the ford connect url. i got the code and got my clientId, client_secret codes and the token for the "code" entry on the config.json file. I tested the api using the postman app and verify my "code" token works. my config.json looks like this { "platform": "FordPass", "options": { "refreshRate": 300 }, "username": "my username", "password": "my password", "batteryName": "Battery", "autoRefresh": true, "refreshRate": 30, "chargingSwitch": false, "plugSwitch": false, "application_id": "APPLICATION_ID", "client_id": "my client id", "client_secret": "my secret code", "code": "code returned from https://fordconnect.cv.ford.com/common/login/?make=F&application_id=AFDC085B-377A-4351-B23E-5E1D35FB3700&client_id=30990062-9618-40e1-a27b-7c6bcb23658a&response_type=code&state=123&redirect_uri=https%3A%2F%2Flocalhost%3A3000&scope=access", "vehicles": [ { "name": "Ford Escape", "vin": "my vin" } ] }

now I get authorized but i see a a different error - 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERROR Error occurred during request: Request failed with status code 500 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse status: 500 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse data: {"error":{"code":4003,"title":"Unknown error","details":"A error has occured with request.","statusCode":"INTERNAL_SERVER_ERROR"},"status":"FAILED","vehicles":null} 3/26/2024, 12:06:28 PMFordpass BridgeFordPassERRORResponse headers: {"server":"nginx/1.18.0 (Ubuntu)","date":"Tue, 26 Mar 2024 16:06:28 GMT","content-type":"application/json","content-length":"164","vary":"Origin,Access-Control-Request-Method,Access-Control-Request-Headers","clientid":"30990062-9618-40e1-a27b-7c6bcb23658a","userguid":"136a662b-1594-6361-35b9-2f6735b92f67","x-content-type-options":"nosniff","x-xss-protection":"0","cache-control":"no-cache, no-store, max-age=0, must-revalidate","pragma":"no-cache","expires":"0","x-frame-options":"DENY","x-cloud-trace-context":"425cb9526327461e12300dc9736f32a6;o=1","referrer-policy":"no-referrer","x-request-id":"f15a6132-3877-497a-b35d-cf6a0380bf39","via":"1.1 google","x-from":"apigee","x-glb-version":"1.2","alt-svc":"h3=":443"; ma=2592000,h3-29=":443"; ma=2592000","connection":"close"}

and I get a fordpass-security-credentials.json created on the /var/lib/hoobs/fordpass directory. looks like an access_token created

not sure where to go from here.

{ "batteryName": "Battery", "autoRefresh": true, "refreshRate": 30, "chargingSwitch": true, "plugSwitch": true, "application_id": "AFDC085B-377A-4351-B23E-5E1D35FB3700", "client_id": "*****", "client_secret": "RHO*", "code": "CODE FROM AUTHORIZE URL", "platform": "FordPass" }

Remove the rest.

smith288 commented 6 months ago

I've added a change that will check for an instance of an object prior to it updating its vehicle id. This should solve the problem.

cmorozcogmailcom commented 6 months ago

i'm making more progress, seems hoobs is not really able to accept this build so easily. I have to install the old fordpass plugin then replace the code from another build directory. i found an issue with fordpass.js i can see under Retrieved vehicleDetails {"fuelLevel":{"value":46.956673,"distanceToEmpty":253.1,"timestamp":"03-27-2024 20:38:52"},"mileage":19384.3,"odometer":31196} i get unhandled rejection: TypeError: Cannot read properties of undefined (reading 'distanceToEmpty') i changed the type vehicle as follows to see if I can get passed this error

interface VehicleDetails { batteryChargeLevel: BatteryChargeLevel; mileage: number; odometer: number; distanceToEmpty: number; }

cmorozcogmailcom commented 6 months ago

so I got it working. I had to start over with a fresh pull and deployed it on my hoobs starter box. I did get it working. I wound up having to do the npm run build on my mac and scp'd the files over to my hoob box and setup a soft link to the dist dir where I copied the freshly built code. I couldn't do an npm run build on the hoobs box something weird with the homebridge code under node_modules. anyway the only thing i could site is that i see numberour error messages like this 3/28/2024, 4:51:55 PMFordpass BridgeERROR[Fordpass Bridge 7F27@Lock Target State] The write handler for the characteristic 'Lock Target State' on the accessory 'My Escape' didn't respond at all!. Please check that you properly call the callback! but the code does work. can at least see my cars status.

smith288 commented 6 months ago

Yea, youll see it sometimes, I suppose. But super happy you are up and running.

cmorozcogmailcom commented 6 months ago

I know the lock and unlock works , trying to get remote start to work , the ford api uses startEngine and stopEngine so I'll take a look on Saturday.

smith288 commented 6 months ago

There’s actually two sets of endpoints for start and stop engine.

/vehicles/v1/{vehicleId}/startEngine

/v1/vehicles/{vehicleId}/startEngine

Pretty sure they both do the same thing. ¯\(ツ)

cmorozcogmailcom commented 6 months ago

Yeah, I see it on postman , I downloaded the ford api.

Regards,

Carlos

On Thu, Mar 28, 2024 at 6:38 PM Erick @.***> wrote:

There’s actually two sets of endpoints for start and stop engine.

/vehicles/v1/{vehicleId}/startEngine

/v1/vehicles/{vehicleId}/startEngine

Pretty sure they both do the same thing. ¯(ツ)

— Reply to this email directly, view it on GitHub https://github.com/Brandawg93/homebridge-fordpass/pull/244#issuecomment-2026252149, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3RCIHYQOCUTJJHIZ4LTYLY2SLXPAVCNFSM6AAAAABEJI5IQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRWGI2TEMJUHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

smith288 commented 6 months ago

Im getting a 500 error when I try to use the authorize login. Anyone else?

UPDATE: Looks like I just need to delete the fordpass-security-credentials.json. I thought it gets removed when it reauthenticates but it apparently doesnt and need to look at that bug.

smith288 commented 4 months ago

bump

cmorozcogmailcom commented 4 months ago

I’m on holiday right now and will return at the end of the month.

Regards,

Carlos

On Thu, May 16, 2024 at 1:58 AM Brandon McFarlin @.***> wrote:

Reopened #244 https://github.com/Brandawg93/homebridge-fordpass/pull/244 .

— Reply to this email directly, view it on GitHub https://github.com/Brandawg93/homebridge-fordpass/pull/244#event-12825312372, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3RCIGU3JA3KWK2M5FWSSTZCQAFFAVCNFSM6AAAAABEJI5IQ2VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJSHAZDKMZRGIZTOMQ . You are receiving this because you are subscribed to this thread.Message ID: <Brandawg93/homebridge-fordpass/pull/244/issue_event/12825312372@ github.com>

Brandawg93 commented 4 months ago

@smith288 I'm considering merging your PR into master and releasing a new version since the old way doesn't work anyways. Any apprehension against that?

smith288 commented 4 months ago

@Brandawg93 Im fine with that.

Brandawg93 commented 4 months ago

Merged! And v2.0.0 is released! Let me know if you see any issues.

mcneyens commented 4 months ago

Still having the same issues as before. Copy and paste directly from a working postman session. If all this is attempting to get a vehicle ID would it be possible to just post that too if you can get it from postman?Sent from my iPhoneOn Jun 6, 2024, at 2:21 PM, Brandon McFarlin @.***> wrote: Merged! And v2.0.0 is released! Let me know if you see any issues.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

smith288 commented 4 months ago

What's the issues you are having? The only message from you was asking a question about the Application ID

mcneyens commented 4 months ago

Sorry posted screen shot from phone that might not have come through. I get postman API working like a charm and then copy everything in homebridge and get these errors. Here is the text. mebridge-fordpass) is running on port 42981.[6/7/2024, 9:03:52 AM] [homebridge-fordpass] Error occurred during request: Request failed with status code 500[6/7/2024, 9:03:52 AM] [homebridge-fordpass] Response status: 500[6/7/2024, 9:03:52 AM] [homebridge-fordpass] Response data: ""[6/7/2024, 9:03:52 AM] [homebridge-fordpass] Response headers: {"server":"nginx/1.18.0 (Ubuntu)","date":"Fri, 07 Jun 2024 14:03:52 GMT","content-type":"text/html","content-length":"0","vary":"Origin,Access-Control-Request-Method,Access-Control-Request-Headers","clientid":"30990062-9618-40e1-a27b-7c6bcb23658a","userguid":"cdb07f04-b2ae-4402-8bf3-70e6ea078651","x-content-type-options":"nosniff","x-xss-protection":"0","cache-control":"no-cache, no-store, max-age=0, must-revalidate","pragma":"no-cache","expires":"0","x-frame-options":"DENY","x-cloud-trace-context":"734d1e0dc6e0c5584237b6782c905edb","referrer-policy":"no-referrer","x-request-id":"2c1865e3-2b84-4205-9e70-cb2576a037c5","via":"1.1 google","x-from":"apigee","x-glb-version":"1.2","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"}TypeError: Cannot read properties of undefined (reading 'vehicleId')    at FordPassPlatform. (/var/lib/homebridge/node_modules/homebridge-fordpass/src/index.ts:294:47)    at Generator.next ()    at fulfilled (/var/lib/homebridge/node_modules/homebridge-fordpass/dist/index.js:5:58)    at processTicksAndRejections (node:internal/process/task_queues:95:5)[6/7/2024, 9:03:52 AM] [homebridge-fordpass] Child bridge process ended[6/7/2024, 9:03:52 AM] [homebridge-fordpass] Process Ended. Code: 1, Signal: nullSent from my iPhoneOn Jun 7, 2024, at 9:01 AM, Erick @.***> wrote: What's the issues you are having? The only message from you was asking a question about the Application ID

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

cmorozcogmailcom commented 4 months ago

I'm having an issue too, seems the plugin fails during status retrieval. I see the following in my log. [6/7/2024, 10:17:17 AM] AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Charging State' at ChargingState.Characteristic.internalHAPRepresentation (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3094:11) at ChargingState. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3067:25) at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:195:27) at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:176:57) at /usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:169:75 at new Promise () at Object.awaiter (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:165:16) at ChargingState.Characteristic.toHAP (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:1372:24) at _loop_1 (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:931:24) at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Service.js:455:21 at new Promise () at Battery.Service.toHAP (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:879:12) at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1144:72 at Array.map () at Accessory. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1144:49) at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:195:27) at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:176:57) at /usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:169:75 at new Promise () at Object.awaiter (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:165:16) at Accessory.toHAP (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Accessory.js:849:24) at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1152:39 at Array.map () at Bridge. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1152:12) at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:195:27) at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:176:57) at fulfilled (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:166:62) at processTicksAndRejections (node:internal/process/task_queues:95:5) [6/7/2024, 10:17:17 AM] Got SIGTERM, shutting down Homebridge... [6/7/2024, 10:17:19 AM] [homebridge-fordpass] This plugin slows down Homebridge. The read handler for the characteristic 'Charging State' was slow to respond! See https://homebridge.io/w/JtMGR for more info. homebridge.service: Main process exited, code=exited, status=143/n/a

mcneyens commented 4 months ago

Fwiw I have it setup as a child bridge and did a complete fresh install when I saw 2.0 rolled out. Sent from my iPhoneOn Jun 7, 2024, at 9:19 AM, cmorozcogmailcom @.***> wrote: I'm having an issue too, seems the plugin fails during status retrieval. I see the following in my log. [6/7/2024, 10:17:17 AM] AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Charging State' at ChargingState.Characteristic.internalHAPRepresentation (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3094:11) at ChargingState. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3067:25) at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:195:27) at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:176:57) at /usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:169:75 at new Promise () at Object.awaiter (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:165:16) at ChargingState.Characteristic.toHAP (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:1372:24) at _loop_1 (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:931:24) at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Service.js:455:21 at new Promise () at Battery.Service.toHAP (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:879:12) at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1144:72 at Array.map () at Accessory. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1144:49) at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:195:27) at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:176:57) at /usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:169:75 at new Promise () at Object.awaiter (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:165:16) at Accessory.toHAP (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Accessory.js:849:24) at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1152:39 at Array.map () at Bridge. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1152:12) at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:195:27) at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:176:57) at fulfilled (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:166:62) at processTicksAndRejections (node:internal/process/task_queues:95:5) [6/7/2024, 10:17:17 AM] Got SIGTERM, shutting down Homebridge... [6/7/2024, 10:17:19 AM] [homebridge-fordpass] This plugin slows down Homebridge. The read handler for the characteristic 'Charging State' was slow to respond! See https://homebridge.io/w/JtMGR for more info. homebridge.service: Main process exited, code=exited, status=143/n/a

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

smith288 commented 4 months ago

If you can, try to navigate to your homebridge folder where homebridge is installed and look for the fordpass-security-credentials.json file. If it's there, disable your plugin, delete that file, redo the access verify step: https://fordconnect.cv.ford.com/common/login/?make=F&application_id=AFDC085B-377A-4351-B23E-5E1D35FB3700&client_id=30990062-9618-40e1-a27b-7c6bcb23658a&response_type=code&state=123&redirect_uri=https%3A%2F%2Flocalhost%3A3000&scope=access

Copy the new code into your plugin config, save, then enable the plugin

cmorozcogmailcom commented 4 months ago

I tried the recommended procedure with 2 different home bridges. homebridge 1.8.2 and hoobs. 4.3.1 - both are running node 18.17.0 I get the follow error trying to retrieve status.

hoobs log : 6/7/2024, 10:44:59 AM] AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Charging State' at ChargingState.Characteristic.internalHAPRepresentation (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3094:11) at ChargingState. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3067:25) at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:195:27) at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:176:57) at /usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:169:75 at new Promise () at Object.awaiter (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:165:16) at ChargingState.Characteristic.toHAP (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:1372:24) at _loop_1 (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:931:24) at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Service.js:455:21 at new Promise () at Battery.Service.toHAP (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:879:12) at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1144:72 at Array.map () at Accessory. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1144:49) at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:195:27) at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:176:57) at /usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:169:75 at new Promise () at Object.awaiter (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:165:16) at Accessory.toHAP (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Accessory.js:849:24) at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1152:39 at Array.map () at Bridge. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1152:12) at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:195:27) at Object.next (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:176:57) at fulfilled (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:166:62) at processTicksAndRejections (node:internal/process/task_queues:95:5) [6/7/2024, 10:44:59 AM] Got SIGTERM, shutting down Homebridge... [6/7/2024, 10:45:00

homebridge log: 6/7/2024, 10:46:33 AM] [FordPass] Vehicle info failed with error: ERR_BAD_REQUEST [6/7/2024, 10:46:33 AM] TypeError: Cannot read properties of undefined (reading 'lockStatus') at FordPassPlatform. (/usr/lib/node_modules/homebridge-fordpass/src/index.ts:133:59) at Generator.next () at fulfilled (/usr/lib/node_modules/homebridge-fordpass/dist/index.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:95:5) [6/7/2024, 10:46:33 AM] Got SIGTERM, shutting down Homebridge... homebridge.service

cmorozcogmailcom commented 4 months ago

i found my application id and now I have run into trying to get passed a warning. MFordpass BridgeLoaded plugin 'homebridge-fordpass' 3/27/2024, 12:35:50 AMFordpass BridgeLoading 1 platforms... 3/27/2024, 12:35:51 AMFordpass BridgeBridge is running on port 51856. 3/27/2024, 12:35:56 AMFordpass BridgeWARNINGunhandled rejection: TypeError: Cannot set properties of undefined (setting 'vehicleId')

Does your https://api.mps.ford.com/api/fordconnect/v2/vehicles endpoint list your cars? And if so, is vehicleId one of the properties of the vehicle record?

{ "status": "SUCCESS", "vehicles": [ { "vehicleId": "ff8080818e575382018e659d7065005b", "make": "F", "modelName": "Escape", "modelYear": "2020", "color": "VELOCITY BLUE", "nickName": "", "modemEnabled": true, "vehicleAuthorizationIndicator": 1, "serviceCompatible": true, "engineType": "ICE" } ] }

smith288 commented 4 months ago

I started looking into the plugin this morning and it looks like ford just zaps you if you hit their API too much. I feel like Ford just doesnt want us using their endpoints even if were being legitimate. Obviously, im making a token call, asking for a status update, polling for the update, then when it expires, refreshing the refresh token. That point, I get hit with as 429 - Too many requests. Maybe @Brandawg93 can review the refresh aspect and see if there's a bug in the retrying?

Screenshot 2024-06-07 at 10 57 54 AM

smith288 commented 4 months ago

I tried the recommended procedure with 2 different home bridges. homebridge 1.8.2 and hoobs. 4.3.1 - both are running node 18.17.0 I get the follow error trying to retrieve status.

hoobs log : 6/7/2024, 10:44:59 AM] AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Charging State' at ChargingState.Characteristic.internalHAPRepresentation

Yours is an ICE vehicle so there shouldn't even be trying Charging state. Did you uncheck Charging Switch in your plugin config?

cmorozcogmailcom commented 4 months ago

can we alter the code to not refresh so often?

cmorozcogmailcom commented 4 months ago

I tried the recommended procedure with 2 different home bridges. homebridge 1.8.2 and hoobs. 4.3.1 - both are running node 18.17.0 I get the follow error trying to retrieve status. hoobs log : 6/7/2024, 10:44:59 AM] AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Charging State' at ChargingState.Characteristic.internalHAPRepresentation

Yours is an ICE vehicle so there shouldn't even be trying Charging state. Did you uncheck Charging Switch in your plugin config?

I tried the recommended procedure with 2 different home bridges. homebridge 1.8.2 and hoobs. 4.3.1 - both are running node 18.17.0 I get the follow error trying to retrieve status. hoobs log : 6/7/2024, 10:44:59 AM] AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Charging State' at ChargingState.Characteristic.internalHAPRepresentation

Yours is an ICE vehicle so there shouldn't even be trying Charging state. Did you uncheck Charging Switch in your plugin config?

{

"batteryName": "Battery",
"autoRefresh": true,
"chargingSwitch": false,
"plugSwitch": false,
smith288 commented 4 months ago

can we alter the code to not refresh so often?

It's not the update, its the "we need to grab a new refresh token so we can access the api" routine. It's required aspect of the plugin to maintain permission to access the API or the code we originally set in the plugin becomes invalid.

cmorozcogmailcom commented 4 months ago

I tried the recommended procedure with 2 different home bridges. homebridge 1.8.2 and hoobs. 4.3.1 - both are running node 18.17.0 I get the follow error trying to retrieve status. hoobs log : 6/7/2024, 10:44:59 AM] AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Charging State' at ChargingState.Characteristic.internalHAPRepresentation

Yours is an ICE vehicle so there shouldn't even be trying Charging state. Did you uncheck Charging Switch in your plugin config?

I tried the recommended procedure with 2 different home bridges. homebridge 1.8.2 and hoobs. 4.3.1 - both are running node 18.17.0 I get the follow error trying to retrieve status. hoobs log : 6/7/2024, 10:44:59 AM] AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Charging State' at ChargingState.Characteristic.internalHAPRepresentation

Yours is an ICE vehicle so there shouldn't even be trying Charging state. Did you uncheck Charging Switch in your plugin config?

{

"batteryName": "Battery",
"autoRefresh": true,
"chargingSwitch": false,
"plugSwitch": false,

I removed the battery name and charging and plugin flags.

cmorozcogmailcom commented 4 months ago

I tried the recommended procedure with 2 different home bridges. homebridge 1.8.2 and hoobs. 4.3.1 - both are running node 18.17.0 I get the follow error trying to retrieve status. hoobs log : 6/7/2024, 10:44:59 AM] AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Charging State' at ChargingState.Characteristic.internalHAPRepresentation

Yours is an ICE vehicle so there shouldn't even be trying Charging state. Did you uncheck Charging Switch in your plugin config?

I tried the recommended procedure with 2 different home bridges. homebridge 1.8.2 and hoobs. 4.3.1 - both are running node 18.17.0 I get the follow error trying to retrieve status. hoobs log : 6/7/2024, 10:44:59 AM] AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Charging State' at ChargingState.Characteristic.internalHAPRepresentation

Yours is an ICE vehicle so there shouldn't even be trying Charging state. Did you uncheck Charging Switch in your plugin config?

{

"batteryName": "Battery",
"autoRefresh": true,
"chargingSwitch": false,
"plugSwitch": false,

I removed the battery name and charging and plugin flags.

its still looking for charging state.

cmorozcogmailcom commented 4 months ago

I also turned off auto fresh to avoid the 429 errors

smith288 commented 4 months ago

I am doing some testing here with finding out why im getting "Vehicle info failed with error: ERR_BAD_REQUEST" for the call to retrieve the vehicle information. If it's simply Ford's API giving me that on a legitimate call.. yikes.

cmorozcogmailcom commented 4 months ago

my charging status shows as undefined. I put in a log message to show the charging status 6/7/2024, 11:39:07 AMFordpass BridgeLoaded plugin 'homebridge-fordpass' 6/7/2024, 11:39:07 AMFordpass BridgeLoading 1 platforms... 6/7/2024, 11:39:08 AMFordpass BridgeBridge is running on port 51836. 6/7/2024, 11:39:11 AMFordpass BridgeFordPassConfiguring accessory 2020 F Escape 6/7/2024, 11:39:24 AMFordpass BridgeFordPassCharging status: undefined

smith288 commented 4 months ago

I did find in several accessory calls I am not checking to make sure it's not already pending a call for said accessory so it could potentially make a subsequent call for that same one. This could lead to a 429 (too many requests) in a short period of time leading to a loss of data. I am working to handle these scenarios.

There is one particular call that just sends a BAD REQUEST for no particular reason I can find so I am simply handling it and it follows up with a successful request.

mcneyens commented 4 months ago

FINALLY!!! LOL.

Lots to report in case others are having issues.

I found the security credentials json in my /var/lib/homebridge folder (running ubuntu VM on my windows server). I deleted that file.

It didn’t work at first so I thought I’d delete the app and the file and try again. That’s when I had luck connecting (via the log messages) to ford.

BUT…… then I couldn’t get the damn thing to join my home. So I started digging.

In the settings I went to remove single accessory and found more than one copy of ford-pass, I removed them all and rebooted, then I thought to look through my bridges and found multiple copies of the ford-pass child bridge and deleted all those.

Just for safe measure I deleted the app again along with the config file and then manually deleted the security file again.

Everything came back online and out of habit I immediately turned on the child bridge and was presented with what I’d run into before saying this accessory can’t be added.

So I removed the child bridge and JUST LIKE THAT, my truck shows up in the default room!!!!!

Thank you all for the tireless effort of chasing down the Car company trying to be a software company and I wish they’d outsource the software (or maybe that’s the problem, LOL)

Good luck to the rest on getting this working, because when it does, it’s SOOOOO nice.

Thanks again

Kris

On Jun 7, 2024, at 1:29 PM, Erick @.***> wrote:

I did find in several accessory calls I am not checking to make sure it's not already pending a call for said accessory so it could potentially make a subsequent call for that same one. This could lead to a 429 (too many requests) in a short period of time leading to a loss of data. I am working to handle these scenarios.

There is one particular call that just sends a BAD REQUEST for no particular reason I can find so I am simply handling it and it follows up with a successful request.

— Reply to this email directly, view it on GitHub https://github.com/Brandawg93/homebridge-fordpass/pull/244#issuecomment-2155323440, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO2WZVH43E2UUR6GC6MIWYLZGH32JAVCNFSM6AAAAABEJI5IQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJVGMZDGNBUGA. You are receiving this because you commented.

mcneyens commented 4 months ago

Crap, I spoke too soon.

Although everything appeared to have worked, when I actually tested the functionality it crashed homebrige (b/c the child bridge didn’t work)

[6/7/2024, 6:08:28 PM] [FordPass] Vehicle info failed with error: ERR_BAD_REQUEST [6/7/2024, 6:08:28 PM] TypeError: Cannot read properties of undefined (reading 'lockStatus') at FordPassPlatform. (/var/lib/homebridge/node_modules/homebridge-fordpass/src/index.ts:112:81) at Generator.next () at fulfilled (/var/lib/homebridge/node_modules/homebridge-fordpass/dist/index.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:95:5) [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down Homebridge... [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down child bridge process... [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down child bridge process... [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down child bridge process... [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down child bridge process... [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down child bridge process... [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down child bridge process... [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down child bridge process... [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down child bridge process... [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down child bridge process... [6/7/2024, 6:08:28 PM] Got SIGTERM, shutting down child bridge process... [6/7/2024, 6:08:31 PM] [FordPass] Vehicle info failed with error: ERR_BAD_REQUEST [6/7/2024, 6:08:31 PM] TypeError: Cannot read properties of undefined (reading 'lockStatus') at FordPassPlatform. (/var/lib/homebridge/node_modules/homebridge-fordpass/src/index.ts:112:81) at Generator.next () at fulfilled (/var/lib/homebridge/node_modules/homebridge-fordpass/dist/index.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:95:5) Kristofer Neyens

On Jun 7, 2024, at 1:29 PM, Erick @.***> wrote:

I did find in several accessory calls I am not checking to make sure it's not already pending a call for said accessory so it could potentially make a subsequent call for that same one. This could lead to a 429 (too many requests) in a short period of time leading to a loss of data. I am working to handle these scenarios.

There is one particular call that just sends a BAD REQUEST for no particular reason I can find so I am simply handling it and it follows up with a successful request.

— Reply to this email directly, view it on GitHub https://github.com/Brandawg93/homebridge-fordpass/pull/244#issuecomment-2155323440, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO2WZVH43E2UUR6GC6MIWYLZGH32JAVCNFSM6AAAAABEJI5IQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJVGMZDGNBUGA. You are receiving this because you commented.

smith288 commented 4 months ago

Is there any errors prior to that?