configuration.yaml, zigbee2mqtt/state.json

This commit is contained in:
Home Assistant Version Control
2026-08-08 03:01:52 +00:00
parent c8afc1adb3
commit 1fbd53d7c7
2 changed files with 33 additions and 18 deletions
+15
View File
@@ -224,6 +224,21 @@ template:
{% set lengths = state_attr('sensor.octoprint_filament_used_total', 'filamentLength') %}
{{ lengths[-1] | float | round(2) if lengths else 0 }}
# OCTOPRINT Z: Holds the last non-zero Z value (raw currentZ reports 0 when idle)
- triggers:
- trigger: state
entity_id: sensor.octoprint_current_z
sensor:
- name: "OctoPrint Z Position"
unique_id: octoprint_z_position_held
unit_of_measurement: "mm"
device_class: distance
state_class: measurement
icon: mdi:axis-z-arrow
state: >-
{% set z = states('sensor.octoprint_current_z') | float(0) %}
{{ z if z > 0 else this.state }}
# Legacy and Integration Sensor Section
sensor:
- platform: torque