diff --git a/packages/scheduling.yaml b/packages/scheduling.yaml index cae63d5..a450fd5 100644 --- a/packages/scheduling.yaml +++ b/packages/scheduling.yaml @@ -405,11 +405,16 @@ script: entity_id: input_datetime.master_bedroom_fan data: time: > - {% set low = state_attr('sensor.current_forecast','overnight_low') | float %} - {% if low > 60 %} + {% set low = states('sensor.tonights_low_temp') | int %} + {% set high = states('sensor.todays_high_temp') | int %} + {% if low > 60 or is_state('input_boolean.hot_day','on') %} 22:30 - {% else %} + {% elif low <= 60 and low >= 50 %} + 23:30 + {% elif low >= states('input_number.master_bedroom_fan_threshold') | int and high > 50 %} 00:00 + {% else %} + 06:00 {% endif %} - service: input_select.select_option target: