Conversion of German Umlauts to "ae", "oe", "ue" in Home Assistant Entity Names

Dear Home Assistant Development Team,

I hope this message finds you well. I am writing to request a new feature that would greatly enhance the usability of Home Assistant for German-speaking users. Specifically, I would like to propose the implementation of a conversion mechanism that automatically transforms German Umlauts (ä, ö, ü) in friendly names to their respective alternative spellings (ä to ae, ö to oe, ü to ue) in entity names.

Currently, when setting up entities in Home Assistant, the entity name is derived from the friendly name. However, the current conversion process does not account for German Umlauts, resulting in entity names that do not accurately reflect the original friendly name. For example, a friendly name like “Temperatur Küche” would be converted to “sensor.temperatur_kuche” instead of the desired “sensor.temperatur_kueche”.

By implementing this feature, Home Assistant would offer a more intuitive and user-friendly experience for German-speaking users. The suggested conversion would ensure that the entity names closely match the original friendly names, making it easier to identify and manage entities within the system.

This conversion process would eliminate the need for manual intervention, reducing the potential for errors and saving users valuable time and effort during the setup process.

I believe this feature enhancement would be greatly appreciated by the Home Assistant community in German-speaking countries, and it would contribute to the platform’s overall usability and accessibility.

Thank you for considering my feature request. I look forward to hearing your thoughts on this matter and the possibility of implementing this feature in a future release of Home Assistant.

Best regards,
Matthias Schabhüttl

Edit #1: Additionally, as suggested by @Troon, it would be beneficial to include the conversion of “ß” to “ss” in the proposed feature. This would ensure that entity names with the German character “ß” are converted appropriately, further aligning the entity names with their corresponding friendly names. Thank you for considering this additional suggestion.

And presumably ß to ss.

1 Like

I have added your suggestion to the original post, @Troon. Thank you for bringing it to my attention. Your input regarding the conversion of “ß” to “ss” has been incorporated into the feature request.

Best regards,
Matthias Schabhüttl

1 Like

This might solve it for the German userbase, but you have a Scandinavian userbase with special characters too (islandic is on a level of its own here) a Spanish userbase with their special characters and so on.
Umlaut characters might be translated in one way in German, but not the same in other languages and maybe not even the same in different parts of the area where the language is used as a primary language.

Why don’t we have “UTF-8” at all, so all these language specific letters are covered? So the sensor could be called ‘sensor.küche_temperatur’ and would work?

I can’t see how to implement this otherwise, with all the different letters in different languages. Other software does it in this way, too, so why invent something new?

Looking forwards to sensor.:face_with_monocle:

2 Likes

I think the issue here is interoperability with all the third party pieces of codes, like add-ons and integrations .
No idea if like NodeRed can handle UTF8.

Thank you for bringing up the discussion regarding UTF-8 implementation and the potential concerns related to addon compatibility. Considering the current conversion of f.e. “ü” to “u”, it would indeed be a viable solution to modify the conversion mechanism to “ü” to “ue” instead.

By implementing this specific modification, Home Assistant can maintain compatibility with addons that may not fully support UTF-8 encoding while still accommodating the desired conversion for German Umlauts. This approach would ensure consistency in entity names while minimizing potential conflicts or compatibility issues.

I appreciate the consideration of different perspectives and the focus on finding a balanced solution that benefits all users of Home Assistant.

Edit #1:
While UTF-8 support remains an ideal solution for comprehensive character support, implementing these modifications would be a practical and immediate step towards improving the functionality for German users. It would address the most pressing concerns related to German Umlauts and the “ß” character without requiring significant changes to the underlying system.

Best regards,
Matthias Schabhüttl

I have identified a potential area for improvement in Home Assistant regarding entity name generation. Upon examining the code in the file homeassistant/util/__init__.py, it appears that the current implementation using the slugify module may not accurately handle the conversion of German Umlauts (ä, ö, ü).

I kindly request your consideration of this improvement, which can be reviewed in detail by referencing the specific file at GitHub.

Best regards,
Matthias Schabhüttl

Edit #1: reference and name

I wanted to inform you that I have opened a pull request to address the issue related to entity name generation and Unicode handling in Home Assistant. This pull request aims to ensure accurate conversion of characters with diacritical marks, specifically German Umlauts (ä, ö, ü).

The modification to the slugify() function includes the necessary replacements from the GERMAN_TRANSLATIONS module.

You can find the pull request at: Link to Pull Request

Thank you for your participation and support.

Edit #1: explanation of modification
Edit #2: original PRE_TRANSLATIONS module does not include @Troon proposed ß->ss change. So I created an own set GERMAN_TRANSLATIONS.
Edit #3: spelling

Best regards,
Matthias Schabhüttl

I know that ö is used in both the swedish and the islandic language. You need to handle those too.

@WallyR I’m sorry. Since I only speak English and German and I’m not familiar with the Swedish or Icelandic language character conversion, I also have no idea how one could implement the distinction.

Best regards,
Matthias Schabhüttl

In Home Assistant, entity names are used to represent different devices and entities within your smart home system. Sometimes, these entity names may contain special characters like German Umlauts (ä, ö, ü), which can cause issues in certain integrations or platforms that don’t handle special characters well. To avoid such problems, it’s a common practice to convert German Umlauts to their ASCII equivalents, like “ae” for “ä”, “oe” for “ö”, and “ue” for “ü”.

Here’s a general approach to converting German Umlauts in Home Assistant entity names:

  1. Open your Home Assistant configuration file (usually named configuration.yaml).
  2. Look for the section where you define your entities, such as switch, light, sensor, etc.
  3. For each entity name that contains a German Umlaut, replace the Umlaut character with its ASCII equivalent:
  • “ä” becomes “ae”
  • “ö” becomes “oe”
  • “ü” becomes “ue”
  1. Save the configuration file and restart Home Assistant for the changes to take effect.

For example, if you have a smart light named “Schlafzimmer Lampe” with an entity_id of “light.schlafzimmer_lampe”, and you want to convert the German Umlaut “ä” to “ae,” you would change the entity_id to “light.schlafzimmer_lae_mpe” in the configuration file.

Keep in mind that Home Assistant has evolved over time, and there might be other methods or integrations available to handle special characters more gracefully. If you encounter any issues after making these changes, please consult the official Home Assistant documentation or community forums for up-to-date solutions.

Normaly when I want to add “umlaute” I rename the device. Normaly there is no name in only Placeholder then I’ll tipe in Kueche Temperatur and HA asks to rename entity, then klick yes.
After That you only have to rename again and Remove the name. By on save Homeassistant doesn’t ask to rename.