Files
ha-template-migration/README.md

72 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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
```bash
cd /config
wget https://gitea.hideawaygaming.com.au/jessikitty/ha-template-migration/raw/branch/main/migrate_templates.py
python3 migrate_templates.py
```
Then:
```bash
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
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](https://gitea.hideawaygaming.com.au/jessikitty/ha-template-migration).
## 🎯 Result
After running, all 67 repair warnings will be cleared! ✅