Edit configuration.yaml with Hass.io CLI

Hi, I’m totally new to HA and is using a Raspberry PI 3 b+. This topic was posted before, but I don’t think it was solved. After making mistakes to my configuration.yaml,I wasn’t able to access the UI, thanks to DavidFW1960 and Jardiamj I was able to get to Hass.io CLI.

  _    _                 _       
 | |  | |               (_)      
 | |__| | __ _ ___ ___   _  ___  
 |  __  |/ _` / __/ __| | |/ _ \ 
 | |  | | (_| \__ \__ \_| | (_) |
 |_|  |_|\__,_|___/___(_)_|\___/ 

Welcome on Hass.io CLI for HassOS.

For more details use 'help' and 'exit' to close.
If you need access to host system use 'login'.

hassio > 

but I’m a bit confused and was wondering if I can access the configuration.yaml here, so I can change the commands (in configuration.yaml), restart HA and will be able to access the UI again. I do not have samba nor the ssh add-on installed :frowning:

Sorry for making a big fuss about this but I really just want to be able to access the UI again. Thanks a lot! And any help would be appreciated.

11 Likes

Yes you can do this as you are in the root of the docker container in Hassio. So to do that you need to learn the commands.

Much easier however is to use the samba plugin and then edit with an editor on your pc/laptop rand use the configuration add on.

1 Like

Thank you for the reply, I did not install samba before I messed up the configuration.yaml and unable to access the UI, so I’m not sure how I can still install/use samba.

Where can I possibly learn the commands/ how can I install samba ( have no experience with this) Thanks a lot!

1 Like

Are you ssh’d into hassio, or are you accessing it via a keyboard/monitor plugged into your raspberry pi?

Googling this shows there are helpful links out there. For example:
https://www.simplified.guide/ssh/copy-file

1 Like

I’m ssh’d into Hassio, thanks!

Then the file (and all your config files) are in the

/config

directory.

Hi, thanks for the reply! I tried that and it wasn’t working. I’ve decided to start over since I was already planning to upgrade to a bigger SD card. The first thing I’m going to do this time is installing samba and the ssh add-on. Thanks!

1 Like

I thought you said you had the ssh addon installed this time (see you last response to me).

I used the debugging feature. Thanks!

I just wanted to put this here for those that run into the same problem. I mistakenly had a tab in my configuration.yaml and restarted without checking first. I also didn’t have access to SSH (I tried installing from CLI, but couldn’t get the configuration edited correctly).

So, here’s what I did:

  1. login to get out of hassio cli and into bash
  2. docker ps to get a list of containers
  3. note the first 3 characters or so of the container for homeassistant - for me it was 51a
  4. docker exec -it 51a /bin/bash
  5. ls to make sure configuration.yaml is there
  6. vi configuration.yaml to edit the file
  7. edit your mistake
  8. esc + :wq to save and exit
  9. exit then login to get back to hassio CLI
  10. homeassistant check to make sure the conf is right this time
  11. homeassistant restart
62 Likes

Thank you so much John! That worked perfect.

I’m new to HA and didn’t realise a simple error in my config file could mess it all up to the point i had no web interface.

Hi,

I’m struggling to access the host system. This is what I see:

login as: root
Authenticating with public key "xxxxxxxxxxxx"

  _    _                 _
 | |  | |               (_)
 | |__| | __ _ ___ ___   _  ___
 |  __  |/ _` / __/ __| | |/ _ \
 | |  | | (_| \__ \__ \_| | (_) |
 |_|  |_|\__,_|___/___(_)_|\___/



Our Cli:
$ hassio help

core-ssh:~#

I’ve tried typing login but any password and user I try is rejected. Can anyone help please?

Thanks,

Matt

You are already logged in.

Thanks! This was very helpfull while fixing my confguration without ssh access.

These directions definitely saved me from having to start again from scratch!

Nice write up and thanks for posting it!

This worked perfectly for me to get my Home Assistant instance working again! Thank you for the steps!

Thanks so much for sharing this!!!

My home assistant just died after a windows update (I run HASSIO via virtualbox). Somehow the configuration.yaml file was completely corrupted and so wouldn’t boot. This allowed me to delete the yaml file and replace it with a backup i keep.

LIFE SAVER!!!

Thank you for this. You are a life saver. I had a very worrisome couple of hours before I found this post and now I have my front-end back again! Definitely bookmarking this one.

No problem everyone! Glad I could help!