I tried to set up an automation that activates a hue scene.
The group_name would contain a special character: “Büro” (= study).
I tried various ways, but I only managed to get the automation to work after replacing the special character in the Hue app.
I tried using “scene_name: Buro” (i.e. replacing “ü” for “u” as HA usually does this - the entity corresponding to this “room” is called “light.buro”).
I also tried using an actual “ü” with UTF-8 file encoding, but at least the configtest tool then complains:
ERROR (Thread-1) [homeassistant.util.yaml] unacceptable character #x009f: special characters are not allowed in [...]
Is this a bug or is there another way to get this to work?
I usually do, but the name is set within the Hue app and is displayed as the room’s name.
I don’t really want to give English names to “things” that are visible as part of the user interface.
It’s 2017 and not 1997 after all…
I got it now. It’s apparently some kind of encoding issue:
The “ü” when typed on the keyboard appears as “<9f>” and when read from the hue bridge (/api/…/groups) it shows as “√º”.
I copy&pasted the latter into my automation and now it works.
You don’t have to specifically encode these characters (if you’re thinking along the lines of encoding for special characters in HTML or URLs).
Depending on the involved programs/layers (like editor, shell, terminal) and their settings, the way the character is appearing on your display may differ.
First you need to make sure the configuration (yaml-)file is UTF-8 encoded, i.e.:
# file myautomation.yaml
myautomation.yaml: UTF-8 Unicode text
(you can use iconv to convert a file between different encodings)
And then the character you type must be encoded correctly.
I was editing the yaml file in vim, running inside a ssh session in my Mac’s terminal program and I think the terminal program’s setting was off…
When everything works, the “ü” is encoded as follows:
That would be an option, but I usually use vi(m) and create/edit the file directly on the host.
Now that I’m thinking about it, I also have installed “rmate” which remotely opens a file in TextMate on my Mac.
Well, once you figure out that a wrong encoding is the culprit, there are a lot of possible solutions…