Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fordpass_fuel > 100% #468

Closed
mclever opened this issue Jan 6, 2024 · 8 comments
Closed

fordpass_fuel > 100% #468

mclever opened this issue Jan 6, 2024 · 8 comments

Comments

@mclever
Copy link

mclever commented Jan 6, 2024

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

Thank you for this integration!!

@BobMac57
Copy link

BobMac57 commented Jan 8, 2024

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

@SquidBytes
Copy link
Collaborator

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
Copy link

cr08 commented Mar 5, 2024

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.

@mclever
Copy link
Author

mclever commented May 9, 2024

Should this be in the current beta @SquidBytes?

@SquidBytes
Copy link
Collaborator

SquidBytes commented May 9, 2024

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

@mclever
Copy link
Author

mclever commented May 10, 2024

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)

@BobMac57
Copy link

BobMac57 commented May 10, 2024 via email

@SquidBytes
Copy link
Collaborator

@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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants