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