secure access to entities

This commit is contained in:
2026-01-07 20:42:46 +01:00
parent 69c65c844f
commit 2e6fcefca4

View File

@@ -205,6 +205,8 @@ variables:
{{ remote_temperature_entity and states(remote_temperature_entity) not in ['unknown', 'unavailable', none] }} {{ remote_temperature_entity and states(remote_temperature_entity) not in ['unknown', 'unavailable', none] }}
setpoint_change_source_entity_valid: > setpoint_change_source_entity_valid: >
{{ setpoint_change_source_entity and states(setpoint_change_source_entity) not in ['unknown', 'unavailable', none] }} {{ setpoint_change_source_entity and states(setpoint_change_source_entity) not in ['unknown', 'unavailable', none] }}
window_detection_entity_valid: >
{{ window_detection_entity and window_detection_entity | length > 0 }}
current_remote_temperature: > current_remote_temperature: >
{{ states(remote_temperature_entity) | float(0) if remote_temperature_entity_valid else 0 }} {{ states(remote_temperature_entity) | float(0) if remote_temperature_entity_valid else 0 }}
remote_temperature_last_change: > remote_temperature_last_change: >
@@ -270,10 +272,12 @@ variables:
(override_reset_duration.seconds | default(0) | int) if override_reset_duration is mapping else 0 }} (override_reset_duration.seconds | default(0) | int) if override_reset_duration is mapping else 0 }}
override_last_change: > override_last_change: >
{{ states[setpoint_change_source_entity].last_updated if setpoint_change_source_entity_valid else none }} {{ states[setpoint_change_source_entity].last_updated if setpoint_change_source_entity_valid else none }}
is_setpoint_manual: >
{{ setpoint_change_source_entity_valid and states(setpoint_change_source_entity) == 'manual' }}
override_duration_exceeded: > override_duration_exceeded: >
{% if override_last_change == none or override_reset_duration_seconds == 0 %} {% if override_last_change == none or override_reset_duration_seconds == 0 %}
false false
{% elif not setpoint_change_source_entity_valid or states(setpoint_change_source_entity) != 'manual' %} {% elif not is_setpoint_manual %}
false false
{% else %} {% else %}
{% set last_change = as_datetime(override_last_change) %} {% set last_change = as_datetime(override_last_change) %}