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

Fuel percentage wrong #518

Open
commputethis opened this issue Jun 29, 2024 · 4 comments
Open

Fuel percentage wrong #518

commputethis opened this issue Jun 29, 2024 · 4 comments

Comments

@commputethis
Copy link

I wasn't sure how to title this. Is this integration calculating the fuel remaining percentage or is it just pulling it from Ford? I am assuming it is pulling it from Ford, but wanted to ask to see. Mine is showing 103%. I filled up and have driven about 10 miles. If it is pulling from Ford, then there probably isn't much that can be done. If it is being calculated by the integration, then there seems to be an issue and maybe assumptions made with the fuel tank size. Anyway, I figured it was worth asking the question.

image

@TheLizard
Copy link

The value is directly passed from the fordpass API, I don't believe there is any calculation done by the integration:

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

@commputethis
Copy link
Author

That's what I assumed, but didn't want to assume. Thanks

@mclever
Copy link

mclever commented Jul 22, 2024

A few people have noticed the same thing, I opened #468. I think >100% should just show 100%.

@SquidBytes
Copy link
Collaborator

Yeah, its "known" because we are just returning the data and not calculating anything.
You could make a helper or manipulate it how you want, there are a few suggestions in #468.
Personally I think the best option is to just return the data as it is, and let users do any calculations if they want which is why its remained that way, but it wouldn't be hard to cap it at 100%.

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