Percent Complete API does not match web page

What is the problem?
The Percent Complete on the OctoPrint web page does not match what the API is returning.

What did you already try to solve it?

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)
Using Home Assistant OctoPrint Component I noticed that the Percent Complete returned did not match that of the gauge on the OctoPrint Web page. It was off by quite a margin.
I posted this on the Home Assistant forum and received a reply from one of the Component developers who verified they were just using the value returned from the API.
After further checking, it appears that the API is using File Size to Calculate Percent Complete, while the Web Page is using Print Time.
It's minor, but it would be nice if they matched. Thanks!

In stock OctoPrint the webpage and API are using the exact same value. However it looks like you have a plugin installed that modifies estimation and maybe that interferes here. I'd need more info on your setup in order to investigate that, and you also should check if you see the same behaviour in safe mode. Also keep in mind that home assistant doesn't use the push API but pulls the data regularly, so it can also lag behind.

Ah, OK. Its probably a plugin I'm using then: Print Time Genius
Hmmm...probably not much can be done then.

It would still be worth it to test in safe mode. If the issue persists then as well, there's a problem in core OctoPrint somewhere. If not the difference comes from the plugin.

I had noticed the same thing with the Print Time Genius plugin installed. API percent complete doesn't match web interface. I had posted about it in another thread, but never got a response. It also effects MQTT plugin....

If Print Time Genius only does a cosmetic change to the percentage, there's not much I can do.

I don't think it's doing that @foosel. Best I can tell it is utilizing the octoprint.printer.estimation.factory hooks. Does the API/MQTT account for those newer hooks?

Yes, but those overwrite the estimate, not the percentage value which as far as I understand we are discussing here.

If the plugin is manipulating that it seems to be doing it in frontend code only - unless I've put in a hook that I've forgotten about.