I want to display the estimated time my 3D printer running Mainsail (Klipper) will finish. Natively using the custom mainsail by moonraker addon (HACS store) I get the ETA sensor which calculates print remaining time in minutes eg. 40:01 (MM:SS).
I’ve found this code which almost does what I want, but I believe the code expects the ETA to report as HH:MM:SS, not MM:SS. So when the calculation happens for the estimated finish time, it thinks there are 40 seconds remaining instead of 40 minutes.
Can anyone point me in the right direction as to what needs to be changed in this? I’m sure it’s very simple just can’t figure it out! Not the YAML expert I want to be just yet…
The timestamp_custom filter expects to receive a value in seconds. Therefore convert the value of sensor.m3d_eta to float and multiply by 60 to get seconds.
If you want to display the time as HH:MM:SS then we need to retain that portion of the value. It will be lost if we use the int filter because it will convert to an integer (i.e. 14). That’s why the template uses float instead of int.