From 278ac26fc2858ece2e67bcb49b4c26de781bee9f Mon Sep 17 00:00:00 2001 From: Home Assistant Version Control Date: Sat, 8 Aug 2026 02:04:05 +0000 Subject: [PATCH] configuration.yaml --- configuration.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configuration.yaml b/configuration.yaml index 2ff63c5..f36b3b6 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -215,6 +215,15 @@ template: {% set kw = states('sensor.water_heater_power_draw') | float(0) %} {{ (kw * 1000) | round(0) }} + # OCTOPRINT: Most recent print's filament usage (mm), from PrintHistory plugin + - name: "OctoPrint Last Print Filament" + unique_id: octoprint_last_print_filament + unit_of_measurement: "mm" + icon: mdi:spool + state: >- + {% set lengths = state_attr('sensor.octoprint_filament_used_total', 'filamentLength') %} + {{ lengths[-1] | float | round(2) if lengths else 0 }} + # Legacy and Integration Sensor Section sensor: - platform: torque