diff --git a/Climate/bosch_bth-ra_control.yaml b/Climate/bosch_bth-ra_control.yaml index 8783484..32e7d7a 100644 --- a/Climate/bosch_bth-ra_control.yaml +++ b/Climate/bosch_bth-ra_control.yaml @@ -195,19 +195,20 @@ variables: max_temperature: !input max_temperature alarm_control_panel: !input alarm_control_panel override_reset_duration: !input override_reset_duration - # Konstanten - temperature_change_tolerance: 0.4 # °C - Minimale Differenz für Temperaturänderung + temperature_change_tolerance: 0.4 # °C sensor_sync_max_age: 1499 # Sekunden (25 Minuten - 1 Sekunde) is_heating_period: > {{ heating_period_switch in [none, ''] or is_state(heating_period_switch, 'on') }} remote_temperature_entity: > {{ device_entities(device_id(trv)) | select('search', 'remote_temperature') | list | first | default('') }} + remote_temperature_entity_valid: > + {{ remote_temperature_entity and states(remote_temperature_entity) not in ['unknown', 'unavailable', none] }} + setpoint_change_source_entity_valid: > + {{ setpoint_change_source_entity and states(setpoint_change_source_entity) not in ['unknown', 'unavailable', none] }} current_remote_temperature: > - {{ states(remote_temperature_entity) | float(0) if remote_temperature_entity and - states(remote_temperature_entity) not in ['unknown', 'unavailable', none] else 0 }} + {{ states(remote_temperature_entity) | float(0) if remote_temperature_entity_valid else 0 }} remote_temperature_last_change: > - {{ states[remote_temperature_entity].last_changed if remote_temperature_entity and - states(remote_temperature_entity) not in ['unknown', 'unavailable', none] else none }} + {{ states[remote_temperature_entity].last_changed if remote_temperature_entity_valid else none }} window_detection_entity: > {{ device_entities(device_id(trv)) | select('search', 'window_detection') | list | first | default('') }} setpoint_change_source_entity: > @@ -268,8 +269,7 @@ 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: > - {{ 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 }} + {{ states[setpoint_change_source_entity].last_updated if setpoint_change_source_entity_valid else none }} override_duration_exceeded: > {% 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) %}