From 584c9700448085eea97f89bb7afbf972dc65343a Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Wed, 4 Mar 2026 13:27:48 +0300 Subject: [PATCH] Make `power_sensor` optional in `Climate Device Controller` Co-Authored-By: Claude Opus 4.6 --- .../Climate Device Controller/blueprint.yaml | 22 ++++++++----------- manifest.json | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Common/Climate Device Controller/blueprint.yaml b/Common/Climate Device Controller/blueprint.yaml index 8b3fb21..5e4e621 100644 --- a/Common/Climate Device Controller/blueprint.yaml +++ b/Common/Climate Device Controller/blueprint.yaml @@ -237,8 +237,11 @@ blueprint: collapsed: false input: power_sensor: - name: Power Sensor - description: "Sensor reporting device power consumption (W)" + name: Power Sensor (optional) + description: > + Sensor reporting device power consumption (W). + Leave empty to disable power monitoring. + default: selector: entity: domain: sensor @@ -321,13 +324,6 @@ trigger: - platform: state entity_id: !input env_sensors - # Power sensor dropped below threshold (potential malfunction) - - platform: numeric_state - entity_id: !input power_sensor - below: !input power_threshold - for: - seconds: !input power_decay_duration - # ============================================================================= # CONDITIONS # ============================================================================= @@ -406,13 +402,13 @@ action: # ----------------------------------------------------------------------- # Power Monitoring # ----------------------------------------------------------------------- - power_threshold: !input power_threshold power_sensor: !input power_sensor + power_threshold: !input power_threshold power_problematic_indicator_entity: !input power_problematic_indicator_entity power_decay_duration: !input power_decay_duration - power: "{{ states(power_sensor) | float(0) }}" + power: "{{ states(power_sensor) | float(0) if power_sensor is not none else 0 }}" # Device is problematic if it's consuming power but below threshold - is_power_not_ok: "{{ (power > 0 and power < power_threshold) if power_threshold != 0 else false }}" + is_power_not_ok: "{{ (power > 0 and power < power_threshold) if power_sensor is not none and power_threshold != 0 else false }}" # ----------------------------------------------------------------------- # Window/Door State @@ -503,7 +499,7 @@ action: - choose: - conditions: - condition: template - value_template: "{{ states(device_entity) not in ['off', 'unavailable', 'unknown'] and power_problematic_indicator_entity is not none }}" + value_template: "{{ power_sensor is not none and states(device_entity) not in ['off', 'unavailable', 'unknown'] and power_problematic_indicator_entity is not none }}" sequence: - variables: # Check if enough time has passed since last power reading diff --git a/manifest.json b/manifest.json index 1651884..858ae64 100644 --- a/manifest.json +++ b/manifest.json @@ -1,3 +1,3 @@ { - "version": "2.4.0" + "version": "2.5.0" }