manual override reset plus minor fixes #3

Merged
pierre merged 31 commits from dev into main 2026-01-15 14:23:00 +01:00
Showing only changes of commit 5895c7c9dc - Show all commits

View File

@@ -303,13 +303,17 @@ variables:
(override_reset_duration.minutes | default(0) | int) * 60 +
(override_reset_duration.seconds | default(0) | int) if override_reset_duration is mapping else 0 }}
override_last_change: >
{{ as_datetime(states[setpoint_change_source_entity].last_updated) if setpoint_change_source_entity and
{{ states[setpoint_change_source_entity].last_updated if setpoint_change_source_entity and
states(setpoint_change_source_entity) not in ['unknown', 'unavailable', none] else none }}
override_duration_exceeded: >
{% set last_change = override_last_change %}
{% if last_change != none and last_change is not string and override_reset_duration_seconds > 0 and setpoint_change_source_entity and states(setpoint_change_source_entity) == 'manual' %}
{% set elapsed = (now() - last_change).total_seconds() %}
{{ elapsed > override_reset_duration_seconds }}
{% if override_last_change != none and override_reset_duration_seconds > 0 and setpoint_change_source_entity and states(setpoint_change_source_entity) == 'manual' %}
{% set last_change = as_datetime(override_last_change) %}
{% if last_change != none %}
{% set elapsed = (now() - last_change).total_seconds() %}
{{ elapsed > override_reset_duration_seconds }}
{% else %}
false
{% endif %}
{% else %}
false
{% endif %}