Formatting Of "estimatedPrintTimeFormatted"
Closed this issue · 4 comments
vrtlvoid commented
"estimatedPrintTimeFormatted" is being formatted as "0:25:12.647860", where as "printTimeFormatted" is being formated as "0:35:58" and "printTimeLeftFormatted" formated as "0:00:00". I believe the fractional second portion should be truncated/rounded. Excellent plugin!
cmroche commented
I cannot say I've seen this... could you give me the full MQTT message for this sensor. You should be able to get this through MQTT Info in HA for the device, or through an MQTT client.
vrtlvoid commented
Here’s the actual MQTT post for octoPrint1/hass/printing acquired via the “MQTT Explorer” client on my PC (http://mqtt-explorer.com/):
{"_timestamp": 1603658754, "offsets": {}, "job": {"estimatedPrintTimeFormatted": "0:20:36.520475", "averagePrintTime": 1914.6477377210394, "lastPrintTime": 1914.6477377210394, "user": "_admin", "file": {"origin": "local", "name": "Cable_Holder_0.2mm_PETG_MK3S_26m.gcode", "date": 1603653343, "path": "Cable_Holder_0.2mm_PETG_MK3S_26m.gcode", "display": "Cable_Holder_0.2mm_PETG_MK3S_26m.gcode", "size": 729858}, "estimatedPrintTime": 1236.5204745240453, "filament": {"tool0": {"volume": 2.6517184695023808, "length": 1102.456430000011}}}, "state": {"text": "Operational", "flags": {"cancelling": false, "paused": false, "operational": true, "pausing": false, "printing": false, "resuming": false, "sdReady": true, "error": false, "ready": true, "finishing": false, "closedOrError": false}}, "currentZ": 42.6, "progress": {"completion": 100.0, "filepos": 729858, "printTimeFormatted": "0:27:53", "printTimeLeftFormatted": "0:00:00", "printTimeLeft": 0, "printTime": 1673, "printTimeLeftOrigin": null}}
Via HASS:
Received 9:35:32
* QoS: 0, Retained
* Payload:
· _timestamp: 1603658754
· offsets: {}
· job:
· estimatedPrintTimeFormatted: '0:20:36.520475'
· averagePrintTime: 1914.6477377210394
· lastPrintTime: 1914.6477377210394
· user: _admin
· file:
· origin: local
· name: Cable_Holder_0.2mm_PETG_MK3S_26m.gcode
· date: 1603653343
· path: Cable_Holder_0.2mm_PETG_MK3S_26m.gcode
· display: Cable_Holder_0.2mm_PETG_MK3S_26m.gcode
· size: 729858
· estimatedPrintTime: 1236.5204745240453
· filament:
· tool0:
· volume: 2.6517184695023808
· length: 1102.456430000011
· state:
· text: Operational
· flags:
· cancelling: false
· paused: false
· operational: true
· pausing: false
· printing: false
· resuming: false
· sdReady: true
· error: false
· ready: true
· finishing: false
· closedOrError: false
· currentZ: 42.6
· progress:
· completion: 100
· filepos: 729858
· printTimeFormatted: '0:27:53'
· printTimeLeftFormatted: '0:00:00'
· printTimeLeft: 0
· printTime: 1673
printTimeLeftOrigin: null
James
From: Clifford Roche [mailto:notifications@github.com]
Sent: October 26, 2020 9:30 AM
To: cmroche/OctoPrint-HomeAssistant <OctoPrint-HomeAssistant@noreply.github.com>
Cc: vrtlvoid <james.jutras@gmail.com>; Author <author@noreply.github.com>
Subject: Re: [cmroche/OctoPrint-HomeAssistant] Formatting Of "estimatedPrintTimeFormatted" (#45)
I cannot say I've seen this... could you give me the full MQTT message for this sensor. You should be able to get this through MQTT Info in HA for the device, or through an MQTT client.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#45 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/APYRMSZZCPRMH3QWGWU5A23SMV2WZANCNFSM4SZVUA4Q> . <https://github.com/notifications/beacon/APYRMS3FSIATL7HUTSCRMTLSMV2WZA5CNFSM4SZVUA42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFK22DII.gif>
cmroche commented
Thanks. I'll take a look at it over the next couple of days.
cmroche commented
Sorry it took so long to get around to this, but the microseconds should be removed now on version 3.2.1