This project provides a set of Jinja2 templates and a Python script to automatically generate complex heating configurations for Home Assistant.
It interacts directly with the Home Assistant API to render templates based on your specific instance configuration (areas, devices, entities). The goal is to minimize manual configuration for heating plans, dashboards, and automations.
- Automations:
- Generates heating automations for every area containing thermostats (TRVs).
- Based on the blueprint
panhans/advanced_heating_control.yaml. - Includes a "Reset" trigger that restarts all heating automations daily at 01:00 AM.
- Intelligent Control (Binary Sensors):
- Creates
binary_sensorentities (Heizen <Area>). - Logic: Checks calendar entries (via labels) and determines if heating is required based on a dynamic lead time (Offset).
- Creates
- Configuration (Inputs):
- Temperatures: Creates sliders (
input_number) for Eco and Comfort temperatures per room.- Special temperature ranges for the area
kirche(5-20°C). - Standard ranges for living areas (Eco: 15-20°C, Comfort: 20-25°C).
- Special temperature ranges for the area
- Offset: Sliders to adjust the pre-heating lead time in minutes (15-180 min).
- Temperatures: Creates sliders (
- Dashboard:
- Generates a complete Lovelace view configuration.
- Displays warnings for devices with low battery (< 21%).
- Visualizes current heating status.
- Groups controls and graphs clearly by floors (e.g., Basement, Ground Floor, 1st Floor).
- Blueprint: The blueprint
panhans/advanced_heating_control.yamlmust be installed. - Frontend: The
custom:auto-entitiescard is required for the dashboard. - Calendars: The logic expects calendar entities assigned to rooms via labels (matching
heatcontrol_...).
- Python 3
requestslibrarypip install requests
To allow the generator.py script to communicate with your Home Assistant instance, you must create two files in the project directory (these are ignored by git):
hass_url.local: The URL of your Home Assistant instance.[http://192.168.1.](http://192.168.1.)X:8123hass_token.local: A Long-Lived Access Token.- Create this in Home Assistant under Profile -> Security -> Create Long-Lived Access Token.
- Paste only the token string into this file.
The script generator.py is designed to automatically find and process all template files.
The script automatically searches for all *.jinja files in the current directory, renders them via the Home Assistant API, cleans up empty lines, and saves them as .yaml files.
Run the script using Python:
python generator.py