Brandawg93 / homebridge-fordpass

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

Various enhancements #155

Open Nastras opened 2 years ago

Nastras commented 2 years ago

Enhancement of issue

Hi @Brandawg93

thanks for the great plugin and your work. I have it since a week in operation and find it really great!

I myself own a Ford Kuga Plug-In Hybrid 2021 (PHEV) and wanted to ask you if you could add a few extensions?

I could provide you with the required data via HTTPS recording through the Fordpass app.

I have thought of the following functions as "custom characteristics" as long as they can be read out:

Functions:

Information:

Would be very happy to get an answer from you!

Best regards Nastra

Solution

-

Alternatives

-

Additional Context

-

Brandawg93 commented 2 years ago

Sure! If you could provide me with the information in the requests, I could hook them up to more switches and controls. Although, if you're savvy enough to retrieve the API calls, you may be interested in forking the project and making the changes yourself and submitting a PR. It would just show you as an official contributor to the project. 😃

Nastras commented 2 years ago

Thanks for the quick reply.

Unfortunately my programming skills are not sufficient to help at this point 😅

But I should be able to provide the data for this. I have already made a few captures of the HTTPS connections of the fordpass app.

So that I can give you the right data you have to explain me briefly which you need exactly?

Brandawg93 commented 2 years ago

I would just need the main status request and any command requests that you find that controls a feature.

Nastras commented 2 years ago

Is this maybe helpful?

{ "vehiclestatus": { "vin": "Xxxxxxxxxxxxxx", "lockStatus": { "value": "LOCKED", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "alarm": { "value": "NOTSET", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "PrmtAlarmEvent": { "value": "Null", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "odometer": { "value": 6366.0, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "fuel": { "fuelLevel": 22.500072, "distanceToEmpty": 121.6, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "gps": { "latitude": "xx.xxxxxxxx", "longitude": "x.xxxxxx", "gpsState": "UNSHIFTED", "status": "LAST_KNOWN", "timestamp": "11-05-2021 18:56:40" }, "remoteStart": { "remoteStartDuration": 0, "remoteStartTime": 0, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "remoteStartStatus": { "value": 0, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "battery": { "batteryHealth": { "value": "STATUS_GOOD", "timestamp": "11-05-2021 19:25:28" }, "batteryStatusActual": { "value": 15, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" } }, "oil": { "oilLife": "STATUS_GOOD", "oilLifeActual": 78, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "tirePressure": { "value": "STATUS_GOOD", "timestamp": "11-05-2021 19:25:28" }, "authorization": "AUTHORIZED", "TPMS": { "tirePressureByLocation": { "value": 1, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "tirePressureSystemStatus": { "value": "Systm_Activ_Composite_Stat", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "dualRearWheel": { "value": 0, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "leftFrontTireStatus": { "value": "Normal", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "leftFrontTirePressure": { "value": "252", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "rightFrontTireStatus": { "value": "Normal", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "rightFrontTirePressure": { "value": "250", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "outerLeftRearTireStatus": { "value": "Normal", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "outerLeftRearTirePressure": { "value": "252", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "outerRightRearTireStatus": { "value": "Normal", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "outerRightRearTirePressure": { "value": "249", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "innerLeftRearTireStatus": { "value": "Not_Supported", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "innerLeftRearTirePressure": null, "innerRightRearTireStatus": { "value": "Not_Supported", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "innerRightRearTirePressure": null, "recommendedFrontTirePressure": { "value": 35, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "recommendedRearTirePressure": { "value": 30, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" } }, "firmwareUpgInProgress": { "value": false, "timestamp": "11-05-2021 15:45:06" }, "deepSleepInProgress": { "value": false, "timestamp": "07-27-2021 05:19:19" }, "ccsSettings": { "timestamp": "11-05-2021 16:01:59", "location": 1, "vehicleConnectivity": 1, "vehicleData": 1, "drivingCharacteristics": -1, "contacts": -1 }, "lastRefresh": "11-05-2021 19:25:28", "lastModifiedDate": "11-05-2021 19:25:30", "serverTime": "11-05-2021 20:02:45", "batteryFillLevel": { "value": 9.0, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "elVehDTE": { "value": 5.0, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "hybridModeStatus": { "value": "AutoChargeDepleteMode", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "chargingStatus": { "value": "ChargingAC", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "plugStatus": { "value": 1, "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "chargeStartTime": { "value": "01-01-2010 00:00:00", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "chargeEndTime": { "value": "11-05-2021 23:20:00", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "preCondStatusDsply": { "value": "NotScheduled", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "chargerPowertype": { "value": "EVSENotDetected", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "batteryPerfStatus": { "value": "Oknomessagedisplayed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "outandAbout": { "value": "PwPckOffTqNotAvailable", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "batteryChargeStatus": null, "dcFastChargeData": null, "windowPosition": { "driverWindowPosition": { "value": "Fully_Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "passWindowPosition": { "value": "Fully_Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "rearDriverWindowPos": { "value": "Fully_Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "rearPassWindowPos": { "value": "Fully_Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" } }, "doorStatus": { "rightRearDoor": { "value": "Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "leftRearDoor": { "value": "Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "driverDoor": { "value": "Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "passengerDoor": { "value": "Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "hoodDoor": { "value": "Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "tailgateDoor": { "value": "Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "innerTailgateDoor": { "value": "Closed", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" } }, "ignitionStatus": { "value": "Off", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" }, "batteryTracLowChargeThreshold": null, "battTracLoSocDDsply": null, "dieselSystemStatus": { "exhaustFluidLevel": null, "filterSoot": null, "ureaRange": null, "metricType": { "value": "Active", "status": "LAST_KNOWN", "timestamp": "11-05-2021 16:42:05" }, "filterRegenerationStatus": { "value": "DPF_Normal_Operation", "status": "CURRENT", "timestamp": "11-05-2021 19:25:29" } } }, "version": "4.0.0", "status": 200 }

Brandawg93 commented 2 years ago

That helps! Do you know if you can control (i.e. turn on and off) anything else besides the engine and door locks with your hybrid?

Nastras commented 2 years ago

Cool 👍

Two functions I can still control in my app.

Unfortunately, I can not currently make a HTTPS query because the car is in the garage and has no cellular network.

I will drive tomorrow with the car and send you the data then.

Nastras commented 2 years ago

Sorry for the late reply. Unfortunately, I did not make it earlier.

Unfortunately, after several attempts, I have to tell you that I can't record HTTPS traffic for the two execution commands. For example, when I turn the wifi on and off, it doesn't show me anything in the log that can be used. Why I can not explain 🙁

Brandawg93 commented 2 years ago

No worries. I'll leave this open for a while just in case someone else sees this and can help out. If you do end up finding the commands just let me know and I'll see what I can do.

Nastras commented 2 years ago

That's a good idea 👍

Will you still extend the plugin with the above known information like battery level etc?

Nastras commented 2 years ago

Would be very happy to test it with you 😉?

Brandawg93 commented 2 years ago

It should already have battery info. It's under the lock's "battery".

Nastras commented 2 years ago

Really? I am only shown a battery level on the car in HK. This does not show the battery level but the fuel level of the tank.

432576E3-96A5-4F82-AFEC-F0DD796FF10C 1E12AAF1-4691-41DC-B5EC-DA858C8913AE

Brandawg93 commented 2 years ago

Ah! That makes sense. Your vehicle has both a battery and fuel level. I have the battery currently set to show the fuel level unless it is null in which case it falls back to battery since most vehicles are fuel and some are EV. I didn't account for hybrid. 😃 I'm not sure if there is a way to show both battery and fuel, but I'll tinker with it when I get a chance.

Nastras commented 2 years ago

💪👌👍

My suggestion would be to use the battery indicator for EV and Hybrid batteries and display fuel as custom characteristics in percent?

Wouldn't it be possible to display many values from above as a custom characteristics? These could but each user via the config show and hide?

Brandawg93 commented 2 years ago

What app is the second picture? My fordpass app doesn't look like that.

Nastras commented 2 years ago

It's a Homekit app. This is called HomeDash is similar to the Eve app. More information is displayed more than in the Apple Home app.

This is what it looks like for me in the Eve app. BA232CA3-1E38-4576-90F4-548165B565FF