From 4114c603eeb2720321db6e0ea30c541c55c004fa Mon Sep 17 00:00:00 2001 From: Home Assistant Version Control Date: Mon, 24 Aug 2026 17:24:47 +0000 Subject: [PATCH] configuration.yaml, zigbee2mqtt/state.json --- configuration.yaml | 16 +++++++++++++++- zigbee2mqtt/state.json | 20 ++++++++++---------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/configuration.yaml b/configuration.yaml index 6f9b2bf2..f68e6c7b 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -298,6 +298,20 @@ rest: - "printStatusResult" - "duration" - "printStartDateTimeFormatted" + # TOTAL FILAMENT MASS: sums PrintJobHistory's own per-job weight (density-aware), in grams + - name: "OctoPrint Filament Used Weight Total" + unique_id: octoprint_filament_used_weight_total + unit_of_measurement: "g" + device_class: weight + state_class: total + icon: mdi:spool + value_template: >- + {% set ns = namespace(weight=0) %} + {% for job in value_json.allPrintJobs | default([]) %} + {% set models = job.get('filamentModels') or {} %} + {% set ns.weight = ns.weight + (models.get('total', {}).get('usedWeight') or 0) | float(0) %} + {% endfor %} + {{ ns.weight | round(2) }} - name: "OctoPrint Recent Prints" unique_id: octoprint_recent_prints icon: mdi:history @@ -403,4 +417,4 @@ emulated_hue: nest_snapshot: # G-code proxy for the 3D toolpath viewer card (www/gcode_viewer_card.js) -octoprint_gcode_proxy: +octoprint_gcode_proxy: \ No newline at end of file diff --git a/zigbee2mqtt/state.json b/zigbee2mqtt/state.json index 8fca6324..2be2a134 100644 --- a/zigbee2mqtt/state.json +++ b/zigbee2mqtt/state.json @@ -22,15 +22,15 @@ }, "0xffffb40e0607af27": { "state": "ON", - "voltage": 119.8, + "voltage": 121.2, "ac_frequency": 60, "led_brightness": 100, "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, - "power": 2, + "power": 2.1, "current": 0.1, "energy": 32.6, - "power_factor": 0.17, + "power_factor": 0.18, "update": { "state": "idle", "installed_version": 268513381, @@ -74,11 +74,11 @@ "led_brightness": 100, "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, - "voltage": 121.2, + "voltage": 120.1, "state": "ON", "ac_frequency": 60, "energy": 132.2, - "power": 103.6, + "power": 102.1, "current": 0.97, "power_factor": 0.94, "update": { @@ -96,12 +96,12 @@ "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, "voltage": 120.8, - "energy": 63.06, + "energy": 63.07, "state": "ON", - "power": 92.1, - "current": 0.94, + "power": 84.7, + "current": 0.9, "ac_frequency": 60, - "power_factor": 0.77, + "power_factor": 0.74, "update": { "state": "idle", "installed_version": 268513381, @@ -172,7 +172,7 @@ "0xffffb40e060893d8": { "state": "ON", "led_brightness": 100, - "voltage": 121.3, + "voltage": 121.8, "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, "energy": 3.64,