fix datetime usage

This commit is contained in:
2026-01-06 19:22:36 +01:00
parent 1d0b0ff241
commit d58ea02aeb

View File

@@ -218,7 +218,7 @@ variables:
{% endif %}
remote_temperature_last_change: >
{% if remote_temperature_entity and states(remote_temperature_entity) not in ['unknown', 'unavailable', none] %}
{{ states[remote_temperature_entity].last_changed }}
{{ as_datetime(states[remote_temperature_entity].last_changed) }}
{% else %}
{{ none }}
{% endif %}
@@ -322,12 +322,12 @@ variables:
{% endif %}
override_last_change: >
{% if setpoint_change_source_entity and states(setpoint_change_source_entity) not in ['unknown', 'unavailable', none] %}
{{ states[setpoint_change_source_entity].last_updated }}
{{ as_datetime(states[setpoint_change_source_entity].last_updated) }}
{% else %}
{{ none }}
{% endif %}
override_duration_exceeded: >
{% if override_last_change and override_reset_duration_seconds > 0 and setpoint_change_source_entity and states(setpoint_change_source_entity) == 'manual' %}
{% if override_last_change != none and override_reset_duration_seconds > 0 and setpoint_change_source_entity and states(setpoint_change_source_entity) == 'manual' %}
{% set elapsed = (now() - override_last_change).total_seconds() %}
{{ elapsed > override_reset_duration_seconds }}
{% else %}