Modify Configuration.yaml via Home assistant Supervisor CLI
It can happen to you (I succeeded too ;-)), you have changed a setting (for example the port) in the configuration.yaml of Home assistant (Supervisor). Home assistant is no longer via the GUI accessible. You've done a lot of work lately and don't want to reinstall everything. Then you can always adjust the configuration.yaml via the CLI. The CLI stands for Command Line Interface where you can perform adjustments or commands via a non-graphical environment.
If you have installed Home Assistant on a Raspberry Pi, connect it to a monitor and a keyboard.
- Type after the ha > prompt enter the following command:
loginand press enter.
You are now out of the Hassio CLI and in the bash.
docker psand press enter.
You will now get a list of all Docker containers to see.
The container in which Home Assistant runs has its own ID. The first three characters of my container are 559.
docker exec -it 559 /bin/bashand close with enter.
You are now in the container and can now make adjustments.
- Type the command
lsto check if configuration.yaml is present.
vi configuration.yamlto edit the file.
With the vieditor you can now make changes to your file.
- Exit configuration.yaml and save it using the command
exitand press enter to return to the hassio CLI.
home assistant checkand press enter to check if the configuration is correct now.
home assistant restartand press enter to restart Home Assistant.
Still error messages?
After Home Assistant has started and you have corrected all errors, the web interface should be accessible again. If not, check the log in the CLI. Presumably an error message will be displayed there.