ha-smart-thermostat-control/README.md

91 lines
5.8 KiB
Markdown
Raw Normal View History

#That is a solid, clean, and well-structured blueprint! Based on this final working version, here is the instructional Readme, focusing on setup and the automation's logic flow.
2025-12-04 10:25:17 +01:00
***
# 🏡 Smart Thermostat Controller Blueprint
**Author:** Andreas Gammelgaard Damsbo
This Home Assistant blueprint provides advanced control over your smart thermostats, combining schedule-based heating with external factors like outside temperature (Winter Mode), window/door states, and calendar-based Away/Holiday modes. This version is designed for flexibility, using an **Input Number Helper** to control the day temperature dynamically.
---
2025-12-04 10:21:12 +01:00
## ✨ Features
2025-12-04 10:23:03 +01:00
* **Schedule Control:** Sets Day or Night temperature based on a **Schedule Helper** entity.
* **Dynamic Day Temp:** Uses an **Input Number Helper** for Day Temperature, allowing easy adjustments via the UI.
* **Winter Mode:** Heating is disabled entirely if the **Outdoor Temperature** remains above a defined threshold.
* **Window/Door Safety:** Turns off heating instantly if any selected window or door sensor is open for a defined duration.
* **Away/Holiday Mode:** Uses a **Calendar Entity** to set a lower Away temperature when you are traveling.
* **Pre-Return Heating:** Starts heating up before your scheduled return time (using a negative offset).
---
## ⚙️ Prerequisites & Setup
Before using this blueprint, you must ensure the following helpers are set up in Home Assistant:
### 1. Required Helpers
| Helper Type | Purpose | Setup Notes |
| :--- | :--- | :--- |
| **Schedule Helper** | Defines the time slots for Day (On) and Night (Off) heating. | Go to Settings > Devices & Services > **Helpers** > Add Helper > **Schedule**. |
| **Input Number Helper** | Stores the value for the **Day Time Temperature Target**. | Go to Settings > Devices & Services > **Helpers** > Add Helper > **Number**. Set min/max values to match your thermostat range (e.g., 10 to 30). |
| **Outdoor Temperature Sensor** | Entity to read the current outside temperature (required for Winter Mode). | This is usually provided by your weather integration. |
| **Window/Door Sensor Group** | Entity or group of entities that are `on` when open. | Multiple sensors can be selected directly in the blueprint, or you can create a Group helper first. |
| **Away Calendar Entity** | Used for Holiday or extended Away periods (e.g., Google Calendar, iCal). | This entity must report `on` when an event is active. |
---
## 📝 Blueprint Configuration (Inputs)
2025-12-04 10:21:12 +01:00
When creating a new automation from this blueprint, you will be prompted for the following:
2025-12-04 10:22:11 +01:00
### Core Entities
| Input | Description |
| :--- | :--- |
| **Thermostat** | Select all `climate` entities you want this automation to control (can be multiple). |
| **Schedule Helper** | The `schedule` helper defining day/night times. |
| **Day Time Temperature Input Number** | The **`input_number`** helper that controls the target temperature during scheduled Day hours. |
| **Night Time Temperature Target** | Static temperature target for scheduled Night hours. |
| **Away Temperature Target** | Static temperature target for when the Away Calendar is active. |
2025-12-04 10:21:12 +01:00
### Winter Mode Logic
| Input | Description |
| :--- | :--- |
| **Outdoor Temperature Sensor** | The sensor providing the current outdoor temperature. |
| **Winter Mode Threshold** | If the outdoor temperature is **below** this value, heating is enabled. (Default: **16°C**). |
| **Winter Mode Delay** | Time the outdoor temp must stay *above* the threshold before heating is turned **OFF**. (Default: **30 minutes**). |
2025-12-04 10:21:12 +01:00
### Window/Door Logic
| Input | Description |
| :--- | :--- |
| **Window / Door Sensor Group** | Select one or more `binary_sensor` entities. Heating stops if any are open. |
| **Window / Door Sensor Delay** | Time a window must be **open** before the automation turns heating **OFF**. (Default: **5 seconds**). |
2025-12-04 10:21:12 +01:00
### Away Mode Logic
| Input | Description |
| :--- | :--- |
| **Holiday or Away Calendar** | The `calendar` entity indicating away/holiday status (`on` when active). |
| **Return Offset** | Time before the calendar event **ends** to start heating. Use a **negative value** (e.g., **-120** minutes starts heating 2 hours before you return). |
2025-12-04 10:21:12 +01:00
---
2025-12-04 10:21:12 +01:00
## 🧠 Automation Logic Flow
2025-12-04 10:21:12 +01:00
The automation uses a priority-based `choose` block to determine the required heating action. It executes the action for the **first condition that is met**.
2025-12-04 10:21:12 +01:00
| Priority | Condition Check | Resulting Action |
| :--- | :--- | :--- |
| **1** | **Window/Door Open?** | **OFF** - Turn heating off immediately. |
| **2** | **Too Warm Outside?** | **OFF** - Turn heating off if the outdoor temp is above the Winter Mode threshold. |
| **3** | **Away/Holiday Active?** | **Away Temp** - Set target to the static Away Temperature. *(Requires Winter Mode active and windows closed).* |
| **4** | **Day Time Active?** | **Day Temp** - Set target to the value from the **Input Number Helper**. *(Requires Winter Mode active and windows closed).* |
| **5** | **Night Time Active?** | **Night Temp** - Set target to the static Night Temperature. *(Requires Winter Mode active and windows closed).* |
| **Default** | *(No high-priority conditions met)* | **OFF** - Turn heating off (e.g., if the schedule is inactive but Winter Mode is not met). |
2025-12-04 12:02:11 +01:00
# Acknowledgement and background
I tried different Home Assistant add-ons and integrations, but wasn't really satisfied in controlling room temperature in our house. The heating is based on central heating and radiators with different Zigbee-based termostats.
This blueprint for HA was initially inspired by [ha-smarter-thermostat by muratcesmecioglu](https://github.com/muratcesmecioglu/ha-smarter-thermostat), but deviated through extending to also include an away calendar and a manual overwrite mode to allow manual inputs on the thermostats. Logic coding was assisted by claude.ai.