3

I just set up Home Assistant using HASSbian and am being told that I need to edit the configuration.yalm file, stored under ~/.homeassistant, to do a bunch of things.

Is it possible to do that from the Chrome browser, or do I have to hook up to my Raspberry Pi manually?

tlhIngan
  • 3,372
  • 5
  • 19
  • 33
Henrik
  • 203
  • 2
  • 3
  • 9

3 Answers3

1

Turns out Terminal (on OSX) is the app to use. There, I start by typing:

$ ssh pi@ip-address-of-pi

(Excluding the "$" sign.)

Then these three commands:

$ sudo su -s /bin/bash homeassistant
$ cd /home/homeassistant/.homeassistant
$ nano configuration.yaml

After doing my changes I press CTRL-X (written as "^X" in the Terminal window) and then in the Home Assistant page in Chrome, navigate to configuration and press restart, wait, and press restart again.

Henrik
  • 203
  • 2
  • 3
  • 9
  • I'll just add that you can alias or script all of this. I use Hassbian also, and I use this ugly hack in my bash profile: alias config='sudo nano /home/homeassistant/.homeassistant/configuration.yaml && sudo service home-assistant@homeassistant restart'. What it does is, when I type config into the terminal, opens the file in nano (a command-line text editor) and then, when I close the file, restarts the HA service. It's not very elegant or robust (for example, if I close the editor without changes, it'll continue to restart the service anyway) but hopefully it gives you some ideas. – flith May 19 '18 at 21:10
1

There is a project developing an IDE built in right in HA.
I am currently using it on Hass.io.
Check this out.
Don't know if you can enable it on your HA though.

krasatos
  • 203
  • 1
  • 11
  • Anyone can explain why i got downvoted? :) – krasatos Apr 25 '18 at 14:27
  • Because you didn't answer the original question. It doesn't matter how helpful or useful your information might be, your votes are based on your answer's appropriateness for this specific question, both for the asker and for any future visitors with the same question. – flith May 19 '18 at 21:06
  • But, it does actually answer the original question. This add-in provides the ability to edit config files remotely in a browser, which is exactly what was asked. – Mike Powell Nov 08 '18 at 12:49
  • FWIW: I upvoted you because I agree with Mike. However, the IDE mentioned is no longer supported. – batpox Dec 21 '22 at 23:03
0

The HomeAssistant web lovelace UI includes an add-on called File Editor that permits editing of the files under the config folder, such as configuration.yaml. It is a simple editor and works well.

There is also another add-on for VSCode (a very popular IDE) which I use on Windows,but have not tried on HA as yet. As of this writing it has a 7 security rating (scale of 1 to 8).

batpox
  • 101
  • 2