configuration.yaml
This commit is contained in:
+4
-4
@@ -221,9 +221,9 @@ template:
|
|||||||
unit_of_measurement: "mm"
|
unit_of_measurement: "mm"
|
||||||
icon: mdi:spool
|
icon: mdi:spool
|
||||||
state: >-
|
state: >-
|
||||||
{% set jobs = state_attr('sensor.octoprint_filament_used_total', 'filamentModels') | default([]) %}
|
{% set fm = state_attr('sensor.octoprint_filament_used_total', 'filamentModels') %}
|
||||||
{% set last = jobs[0] if jobs else {} %}
|
{% set total = fm.get('total', {}) if fm else {} %}
|
||||||
{{ last.get('total', {}).get('usedLength', 0) | float | round(2) if last else 0 }}
|
{{ total.get('usedLength', 0) | float | round(2) }}
|
||||||
|
|
||||||
# Legacy and Integration Sensor Section
|
# Legacy and Integration Sensor Section
|
||||||
sensor:
|
sensor:
|
||||||
@@ -273,7 +273,7 @@ rest:
|
|||||||
| sum
|
| sum
|
||||||
| round(2)
|
| round(2)
|
||||||
}}
|
}}
|
||||||
json_attributes_path: "$.allPrintJobs"
|
json_attributes_path: "$.allPrintJobs[0]"
|
||||||
json_attributes:
|
json_attributes:
|
||||||
- "fileName"
|
- "fileName"
|
||||||
- "filamentModels"
|
- "filamentModels"
|
||||||
|
|||||||
Reference in New Issue
Block a user