This question is almost certainly a docker question and not a Home Assistant question, but maybe not.
First of all, I am a docker newbie. I followed the instructions to get supervised HA running on a Debian laptop. I also have portainer running. I have seen that I can open a shell window in the homeassistant container from within portainer, and that gets me access to my config files, etc. I also have samba and ssh running, so I can get to things that way (usually from my windows pc). In fact, that’s how I do most of my editing. Everything works.
But let’s say I am on my laptop and I want to edit a file. I could go into portainer, but I don’t see any editors like pico, nano or vim. And I don’t see a way to apt-get install things either. But when I go to my desktop, I have pico, nano and vim installed. But there’s no easy way that I can see to access the container files from my debian desktop.
So, how do I install other things in the docker container? Or is that a bad idea and there’s a better way to do things?
Your data files should be located in the guest OS outside of the container. Otherwise you would lose your data every time you upgrade HA by replacing the container with a newer version.
Uh oh, that sounds bad! I did it a couple of weeks ago and I don’t know exactly which site I followed (there are so many of them). Fortunately I have been backing everything up every day.
I’ll look at the home assistant site and make sure I am doing it right.
So I went to /usr/share/hassio/homeassistant and all of my config files are already there. Even stuff I edited today. So I don’t have to “go into” the container to see my files! And I created a new file in /usr/share/hassio/homeassistant and sure enough, it showed up in the container as well, so it seems to replicate both ways. So, in the future, I’ll just edit the files in /usr/share…
I use samba and ssh. But sometimes I take my HA laptop to the place where I am working (garage perhaps). Then I want to edit on the laptop itself. But yeah, normally I do all of my editing on my windows PC. I’ll take a look at that hass-configurator too. That looks nice.
I just use it to edit & save the files. I check & restart HA from the Configuration menu. You need to set the HASS_SPI to a blank string if you do this. Here is my (redacted) settings.conf
Be sure to map the config folder of your homeassistant instance to the configurator container and set the basepath in your configuration. The configuration needs to be mapped to /config and needs to be named settings.conf.
What do they mean by “map the config folder”? I have a feeling it has something to do with the volumes setting in the docker-container.yaml file. I read most of this page: Use volumes | Docker Documentation but I am having a hard time understanding all of it.
The redacted snippet you posted mentions the basepath setting, but I don’t see where that setting needs to go. It doesn’t match up with the suggested docker-compose.yaml file, so I am guessing it will go somewhere else. Where does that snippet go?
Finally, the networks setting in the docker-compose.yaml. My network is 192.168.0.*. Is “hass-network” meant to be entered there verbose, or should I put something like “192.168.0.0/24”? I don’t see any environment variables named “hass-network” in the container or on the host.
For my installation, the host sees the HA config files in /usr/share/hassio/homeassistant. My configuration.yaml is in that directory. From within the container, my configuration.yaml is in /config as expected.
Again super sorry for all the newb questions, but I really appreciate your help!
I use a shell script to run my docker container. I chose to make a folder for it in my homeassistant data folder.
That is the folder that contains the hass-configurator config file settings.conf.
In the settings.conf file in the config folder.
So, to be similar to what I did, make a configurator folder in /usr/share/hassio/homeassistant and make a settings.conf file in that folder. Here is a modified example of my startup script. It first checks for a newer image & then runs the container.