Assume your Home Assistant keeps crashing and your last resort is the system console.
You plug a keyboard and display to your Raspberry/Odroid/whatever, only to notice that your keyboard produces garbage.
When using a german keyboard instead the expected QWERTY, most of the letters will be in the expected places, but almost everything else won’t.
Now imagine having a french or (god forbid) a Dvorak keyboard.
Your panic just jumps to another level.
Sad reality for a lot of people out there.
The console supports US keyboard layout by default, with no way to change it.
When I was in this situation, I decided that buying a US keyboard for the purpose of using it for an average of 32 seconds per year didn’t make much sense.
So I ended up making a cheat sheet to translate the needed characters to my keyboard layout.
It kinda did the trick, but … yikes! Right?
I know. In a perfect world, nobody would ever need to use the console.
But if they do, they wouldn’t want the extra amount of trouble caused by the lack of keyboard support.
I’ve actually been in that exact situation recently. A faulty automation caused an instant CPU overload, which prevented me from accessing Home Assistant. I managed to edit the automations.yaml file through the CLI, but since I only have a German keyboard, figuring out how to save and exit the file was a nightmare. Every key I pressed produced random characters, and it took me several days to finally sort it out.
In case anyone runs into the same problem, here’s how I finally managed to save and exit the file:
Until the GitHub pull is officialle released there is an easy trick:
It helps to search/google for a picture of a QWERTY-layout and have next to you while using the console with a non-QWERTY keyboard:
Since HA 17.0 has been released, here’s a quick guide to change the console keymap:
Access the HA CLI: either connect a physical keyboard to your appliance or access the VM console if running in a VM
At the ha > prompt type login, this will start a true root shell
Type localectl set-keymap xx where xx is your keymap code, e.g. localectl set-keymap fr. This is the tricky part because you have to type it using a wrong keymap… as suggested by @Rixi use a picture of the QWERTY layout to help
The keymap is automatically persisted in /etc/vconsole.conf, you can check by typing localectl status
Note: if your keymap is not recognized by localectl set-keymap (for some reason it was the case with the be keymap), you may need to use localectl set-x11-keymap instead.