configuration.yaml, zigbee2mqtt/state.json

This commit is contained in:
Home Assistant Version Control
2026-08-08 02:03:59 +00:00
parent a25c9c4bfc
commit 4feff22329
2 changed files with 61 additions and 31 deletions
+30
View File
@@ -237,6 +237,36 @@ sensor:
method: left
round: 2
# OctoPrint PrintHistory - filament usage from https://ender5pro.duckdns.org
rest:
- resource: "https://ender5pro.duckdns.org/plugin/printhistory/history"
method: GET
headers:
X-Api-Key: !secret octoprint_api_key
scan_interval: 300
sensor:
- name: "OctoPrint Filament Used Total"
unique_id: octoprint_filament_used_total
unit_of_measurement: "mm"
icon: mdi:spool
value_template: >-
{{
value_json.history
| selectattr('filamentLength', 'ne', None)
| map(attribute='filamentLength')
| map('float')
| sum
| round(2)
}}
json_attributes_path: "$.history"
json_attributes:
- "fileName"
- "filamentLength"
- "filamentVolume"
- "printTime"
- "success"
- "timestamp"
emulated_hue:
host_ip: 192.168.1.140
advertise_ip: 192.168.1.140