Serac v1.7.1 - Entity ID Sanitization Fix
🐛 Serac v1.7.1 - Entity ID Sanitization Fix
What's Fixed
This patch release fixes invalid entity ID warnings that appeared when using entity prefixes containing special characters (accents, diacritics) like chamonix_dévoluy.
The Problem
Home Assistant requires entity IDs to contain only lowercase letters, numbers, and underscores. Entity prefixes with special characters (é, à, ç, etc.) created invalid entity IDs that triggered warnings:
Detected that custom integration 'serac' sets an invalid entity ID:
'sensor.serac_chamonix_dévoluy_avalanche_summary'
This will stop working in Home Assistant 2027.2.0
The Solution
- ✅ Automatic sanitization - Entity prefixes are now sanitized before creating entity IDs
- ✅ Unicode normalization - Accents are properly removed (é→e, à→a, ç→c, etc.)
- ✅ All sensor types - Fix applied to weather, avalanche, and vigilance sensors
- ✅ Display names preserved - Friendly names still show original characters
- ✅ HA 2027.2.0 ready - Fully compliant with future Home Assistant versions
Example Transformations
Before (invalid):
sensor.serac_chamonix_dévoluy_avalanche_summary ❌
sensor.serac_chamonix_dévoluy_vigilance_level ❌
After (valid):
sensor.serac_chamonix_devoluy_avalanche_summary ✅
sensor.serac_chamonix_devoluy_vigilance_level ✅
Note: Display names like "Chamonix Dévoluy" remain unchanged for readability.
Technical Details
Changes
- Added
_sanitize_entity_id_part()utility function usingunicodedata.normalize() - Applied sanitization in
SeracSensor.__init__()(line 669) - Applied sanitization in
BraSensor.__init__()(line 742) - Applied sanitization in
VigilanceSensor.__init__()(line 838) - Updated manifest version to 1.7.1
- Updated PROJECT_STATUS.md with release notes
Files Modified
custom_components/serac/sensor.py- Added sanitization function and applied to all sensor classescustom_components/serac/manifest.json- Version bump to 1.7.1PROJECT_STATUS.md- Added v1.7.1 release notes
Upgrade Instructions
For HACS Users
- Go to HACS → Integrations
- Find "Serac" and click "Update"
- Restart Home Assistant
- The warnings will disappear automatically
For Existing Installations
If you're using an entity prefix with special characters, your entity IDs will change after this update:
- Old entity IDs will become unavailable
- New sanitized entity IDs will appear
- You'll need to update any automations, scripts, or dashboards referencing the old entity IDs
Tip: Check Developer Tools → States to see your new entity IDs after the update.
Full Changelog
v1.7.1:
- 🐛 Fixed entity ID validation warnings for prefixes with special characters
- 🔧 Unicode normalization for proper accent removal
- ✅ HA 2027.2.0 compatibility ensured
- 🛡️ Fix applied to all sensor types (weather, avalanche, vigilance)
Links
- Repository: https://github.com/atacamalabs/ha-serac
- Issues: https://github.com/atacamalabs/ha-serac/issues
- Documentation: See README.md for full integration documentation
🎨 Generated with Claude Code