Home Assistant Legacy Template Migration

Automated script to fix all 67 template deprecation warnings by migrating from legacy platform: template syntax to modern template: syntax.

⚠️ What This Fixes

Home Assistant 2026.6 will remove support for legacy template syntax. This script automatically migrates all your templates to the modern format.

🚀 Quick Start

cd /config
wget https://gitea.hideawaygaming.com.au/jessikitty/ha-template-migration/raw/branch/main/migrate_templates.py
python3 migrate_templates.py

Then:

ha core check    # Verify configuration
ha core restart  # Apply changes

📊 What It Does

Scans all YAML files for legacy templates
Creates timestamped backups
Converts to modern template: syntax
Preserves all template features
Updates configuration.yaml
Generates restore script

🛡️ Safety Features

  • Automatic Backups: All files backed up before changes
  • Easy Restore: One command to rollback if needed
  • No Data Loss: Preserves all template configurations
  • Validation: Check config before restart

📝 Expected Output

======================================================================
Home Assistant Legacy Template Migration
======================================================================

 Found 67 legacy template entities:
  - 15 sensor(s)
  - 52 binary_sensor(s)

 Creating backups...
  ✓ Backed up: sensor.yaml
  ✓ Backed up: binary_sensor.yaml

✓ MIGRATION COMPLETE
Migrated: 67 template entities

🔄 Restore if Needed

bash /config/backups/template_migration_YYYYMMDD_HHMMSS/restore.sh
ha core restart

📚 Full Documentation

See detailed examples, troubleshooting, and conversion patterns in the full documentation.

🎯 Result

After running, all 67 repair warnings will be cleared!

Description
Automated migration script for Home Assistant legacy template syntax to modern template: syntax. Fixes all 67 template deprecation warnings.
Readme 42 KiB
Languages
Shell 53.2%
Python 46.8%