Skip to content

v0.8.21 - Template Entity Matching Fix

Pre-release
Pre-release

Choose a tag to compare

@jonducrou jonducrou released this 18 Jan 00:28
· 2 commits to main since this release
Immutable release. Only release title and notes can be modified.

🔧 Bug Fix

Template Entity Matching for Special Characters

Fixed an issue where template sensors with special characters in their names (colons, parentheses, etc.) were not showing their dependency relationships in the visualiser.

Example: A template sensor named "Solar: Spare Power for Car" that depends on sensor.total_dc_power, sensor.load_power, and sensor.openeo_charger_power_delivered would only show automation relationships, but not its template dependencies.

Root Cause

The entity ID generation was using template_name.lower().replace(' ', '_') which only replaced spaces. This meant:

  • Template name: "Solar: Spare Power for Car"
  • Generated ID: sensor.solar:_spare_power_for_car ❌
  • Actual HA ID: sensor.solar_spare_power_for_car ✅

Solution

Now uses Home Assistant's slugify() function, which is the same function HA uses internally to generate entity IDs. This correctly handles all special characters.


📋 Full Changelog

  • Fixed: Template entity ID matching now uses slugify() for proper special character handling
  • Updated: Documentation in DECISIONS.md

🔄 Update Instructions

  1. Update via HACS or replace the files manually
  2. Restart Home Assistant
  3. Clear browser cache (Ctrl+Shift+R or Cmd+Shift+R)
  4. Test template sensors with special characters in their names