configuration.yaml, zigbee2mqtt/state.json
This commit is contained in:
+15
-1
@@ -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:
|
||||
Reference in New Issue
Block a user