Make power_sensor optional in Climate Device Controller

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 13:27:48 +03:00
parent 4c03bc849e
commit 584c970044
2 changed files with 10 additions and 14 deletions

View File

@@ -237,8 +237,11 @@ blueprint:
collapsed: false collapsed: false
input: input:
power_sensor: power_sensor:
name: Power Sensor name: Power Sensor (optional)
description: "Sensor reporting device power consumption (W)" description: >
Sensor reporting device power consumption (W).
Leave empty to disable power monitoring.
default:
selector: selector:
entity: entity:
domain: sensor domain: sensor
@@ -321,13 +324,6 @@ trigger:
- platform: state - platform: state
entity_id: !input env_sensors 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 # CONDITIONS
# ============================================================================= # =============================================================================
@@ -406,13 +402,13 @@ action:
# ----------------------------------------------------------------------- # -----------------------------------------------------------------------
# Power Monitoring # Power Monitoring
# ----------------------------------------------------------------------- # -----------------------------------------------------------------------
power_threshold: !input power_threshold
power_sensor: !input power_sensor power_sensor: !input power_sensor
power_threshold: !input power_threshold
power_problematic_indicator_entity: !input power_problematic_indicator_entity power_problematic_indicator_entity: !input power_problematic_indicator_entity
power_decay_duration: !input power_decay_duration 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 # 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 # Window/Door State
@@ -503,7 +499,7 @@ action:
- choose: - choose:
- conditions: - conditions:
- condition: template - 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: sequence:
- variables: - variables:
# Check if enough time has passed since last power reading # Check if enough time has passed since last power reading

View File

@@ -1,3 +1,3 @@
{ {
"version": "2.4.0" "version": "2.5.0"
} }