Closed AndreasBoehme closed 8 months ago
Can you do me a favor and enable debug logging in the plugin's settings, restart OctoPrint and go through a print again, then share the plugin_tplinksmartplug_debug.log file that will show up in OctoPrint's logging section of settings?
Agree it seems like a bug - I wrote some SQL queries to bring the Obico print history database plus the TPLink database into Excel pivot tables to calculate/display all sorts of stuff about my prints. The energy costs that I calculate are a fraction of what the additional details shows...
I made the fix that you suggested -- i.e., remove the multiplication by hours
and now the energy cost in Octoprint agrees with my database/spreadsheet/pivot table calculations.
@jneilliii I will include this in the PR I am testing for the other bugs/enhancements I have been working on...
This issue has been automatically marked as stale because it has not had activity in 14 days. It will be closed if no further activity occurs in 7 days
Thank you for the change, @puterboy. Just need a new release or RC to test it.
Didn't see this bug-number in the release notes, but probably because the fix is part of #352. I will test it.
Thanks, updated release notes.
Tested 1.0.4rc3, value is correct now! Thank you for the fast implementation.
thanks @puterboy for the fix on that one.
Describe the bug The statistics of an already finished print shows wrong print-costs when using a TP-Link Smartplug and this OctoPrint-Plugin.
e.g. Last power cost: 6.305
TP-Link Smartplug Tab shows: total kWh: ranges from 1.06 to 2.393 => used: 1.333 kWh cost: ranges from 0.3392 to 0.76576 => 0,42656 Euro
(I checked that with the kasa-app from tp-link - the ptint was ~ 2 weeks ago, but the overall power consumtion is ~ 4 kWh, thus costs can't be higher than ~ 1.3 Euros)
To Reproduce
Additional context
Seems the overall-power-costs is multiplied with the print-time. I found this line in the source code: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/blob/a3771477d760215871bb98c8fb531fcbfb67f832/octoprint_tplinksmartplug/__init__.py#L707C22-L707C38
Screenshots In the screenshot you see that the total power-consumption was 2.3 kWh when the print was finished. The costs per kWh was configured to be 0.32. Thus the last power cost of 6.3 must be wrong (should be ~ 0.4)