Skip to content

Serac v1.7.1 - Entity ID Sanitization Fix

Choose a tag to compare

@atacamalabs atacamalabs released this 12 Feb 13:16
· 8 commits to main since this release

🐛 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 using unicodedata.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 classes
  • custom_components/serac/manifest.json - Version bump to 1.7.1
  • PROJECT_STATUS.md - Added v1.7.1 release notes

Upgrade Instructions

For HACS Users

  1. Go to HACS → Integrations
  2. Find "Serac" and click "Update"
  3. Restart Home Assistant
  4. 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


🎨 Generated with Claude Code