itchannel/fordpass-ha

fordpass_fuel > 100%

Closed this issue · 8 comments

Filled up today and noticed the fordpass_fuel showed 103%. May want to cap that at 100%.

Thank you for this integration!!

Filled up today and noticed the fordpass_fuel showed 103%. May want to cap that at 100%.

Thank you for this integration!!

FYI, that's an issue with Ford. I worked with a developer creating an Android version of a more detailed version of FordPass and found the same issue. If you want to, use this but change the last number to the size of your tank in gals:

sensor.fordpass_fuel / 103 * 36

I worked with a developer creating an Android version of a more detailed version of FordPass

Do you have that information?
My frustration with the FordPass app drove me to this project - I have thought about trying to do something similar....but I am not good at programming and I know nothing for App development.

cr08 commented

I worked with a developer creating an Android version of a more detailed version of FordPass

Do you have that information? My frustration with the FordPass app drove me to this project - I have thought about trying to do something similar....but I am not good at programming and I know nothing for App development.

Just came across this and sorry for adding another off topic comment.

Ditto on this and for mostly the same reasons. If there's any more info on this app project, I'd love to see it. Ford killing off a lot of features in FordPass for my vehicle (C-Max Energi) basically directed me here and got me on the path for trying to build my own dashboard with all the extra info available from the API. But I'm more used to web based stuff and is where that focus went. Android app development is well outside my wheelhouse.

Should this be in the current beta @SquidBytes?

It is not
The fordpass_fuel sensor is just rounding what is returned from the vehicle

if self.sensor == "fuel":
    fuel_level = self.data.get("fuelLevel", {}).get("value")
    if fuel_level is not None:
        return round(fuel_level)

From what I know - the data from the vehicle reports similar to this

"fuelLevel": {
    "updateTime": "xxxx-xx-xxTxx:xx:xxZ",
    "oemCorrelationId": "xxxx",
    "value": 69.21759

It could be capped at 100%, but as a data nerd I default to displaying what is reported by the vehicle

Does something like this work? Sorry I don't know the correct syntax but the logic is if greater than 100 just report 100 and if not then report the value given

if self.sensor == "fuel":
    fuel_level = self.data.get("fuelLevel", {}).get("value")
    if fuel_level is not None:
        if fuel_level is > 100
            return 100
        else
            return round(fuel_level)

@mclever I think the best solution is to do a helper or template sensor which was suggested by @BobMac57 (thank you for that!).

When modifying the sensory.py file on your HA it will require a restart to take effect. Also, just so you're aware - if you do make changes to sensor.py on your HA instance it will be reset anytime a new version is downloaded.

As @BobMac57 said, you can do the exact conversion for you vehicle using your tank size.
Considering Ford being a global brand and the many different tank sizes I personally don't think its best to fix this "bug".
Worst case - you know for sure your fuel tank is "FULL"