diff --git a/Climate/bosch_bth-ra_control.yaml b/Climate/bosch_bth-ra_control.yaml index a0edd26..8f0f9a6 100644 --- a/Climate/bosch_bth-ra_control.yaml +++ b/Climate/bosch_bth-ra_control.yaml @@ -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 %}