Add comprehensive README with usage instructions and examples

This commit is contained in:
2025-12-23 11:29:30 +11:00
parent 4e3201c604
commit d0421edcba

View File

@@ -1,3 +1,71 @@
# ha-template-migration # Home Assistant Legacy Template Migration
Automated migration script for Home Assistant legacy template syntax to modern template: syntax. Fixes all 67 template deprecation warnings. 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! ✅