configuration.yaml, zigbee2mqtt/state.json

This commit is contained in:
Home Assistant Version Control
2026-08-24 17:24:47 +00:00
parent ae1cec7387
commit 4114c603ee
2 changed files with 25 additions and 11 deletions
+15 -1
View File
@@ -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: