Last active
June 17, 2025 11:47
-
-
Save AbleMonster/4fbcd80d02636c615632c142bb35260c to your computer and use it in GitHub Desktop.
Heating Schedule with Window Check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: Heating Schedule with Window or Door Check | |
| description: Controls the heating based on time schedule and whether doors or windows are closed. Sends a notification if any are open. | |
| domain: automation | |
| input: | |
| climate_device: | |
| name: Climate Device | |
| selector: | |
| target: | |
| entity: | |
| domain: climate | |
| open_sensor: | |
| name: Window or Door Sensor | |
| description: Select a window or door sensor to prevent heating while open | |
| selector: | |
| entity: | |
| domain: binary_sensor | |
| device_class: | |
| - window | |
| - door | |
| notify_device: | |
| name: Notification Device | |
| selector: | |
| device: | |
| integration: mobile_app | |
| temperature_mappings: | |
| name: Time and Temperature Schedule | |
| description: Define the schedule for temperature changes. | |
| default: | |
| - time: "05:00:00" | |
| temperature: 21 | |
| - time: "07:00:00" | |
| temperature: 18 | |
| - time: "13:00:00" | |
| temperature: 21 | |
| - time: "22:00:00" | |
| temperature: 18 | |
| selector: | |
| object: | |
| trigger: | |
| - platform: time | |
| at: "{{ temperature_mappings | map(attribute='time') | list }}" | |
| - platform: state | |
| entity_id: !input open_sensor | |
| from: "on" | |
| to: "off" | |
| variables: | |
| now_time: "{{ now().strftime('%H:%M:%S') }}" | |
| current_temp: >- | |
| {% set match = temperature_mappings | selectattr('time', 'eq', now_time) | list %} | |
| {% if match | length > 0 %} | |
| {{ match[0].temperature }} | |
| {% else %} | |
| none | |
| {% endif %} | |
| condition: [] | |
| action: | |
| - choose: | |
| - conditions: | |
| - condition: template | |
| value_template: "{{ current_temp != 'none' }}" | |
| - condition: state | |
| entity_id: !input open_sensor | |
| state: "off" | |
| sequence: | |
| - service: climate.set_temperature | |
| target: !input climate_device | |
| data: | |
| temperature: "{{ current_temp }}" | |
| hvac_mode: heat | |
| - conditions: | |
| - condition: state | |
| entity_id: !input open_sensor | |
| state: "on" | |
| sequence: | |
| - service: notify.mobile_app_notify | |
| data: | |
| title: Heating schedule interrupted! | |
| message: A door or window is open. Heating remains off until it is closed. | |
| mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment