Intro

We’re continuing where we left off after Part 5: Node-RED.

So far we’ve been editing our configuration.yaml through the terminal. While this definitely works, it does mean we need to open the terminal and SSH to our Docker system each time we want to make a configuration change. Since in the previous posts we’ve been adding our add-ons to the dashboard view of Home Assistant, we’ll do the same for our config editing thanks to HASS Configurator.

Install HASS Configurator

Docker-compose

We expand our docker-compose.yaml with the config for the HASS Configurator container.

services:
  [...]
  
  hass-configurator:
    container_name: hassconf
    image: causticlab/hass-configurator-docker
    restart: unless-stopped
    ports:
      - "3218:3218/tcp"
    volumes:
      - /opt/hassconf/config:/config
      - /opt/homeassistant/config:/hass-config
    depends_on:
      - homeassistant

HASS-Configurator config

We can also make some changes to the configuration of the HASS Configurator.

Either manually create the config directory or start the container so Docker creates it for us. Then create a config file.

sudo mkdir -p /opt/hassconf/config
sudo nano /opt/hassconf/config/settings.conf

# Add the following lines and close+save using Ctrl+X
{
 "BASEPATH": "/hass-config",
 "ENFORCE_BASEPATH": true,
 "DIRSFIRST": true
}

The config above makes sure the Configurator opens in the directory holding our HA config. It also limits the editor to opening files within this folder. So you cannot access files outside this folder (e.g. system configuration).
The last setting results in the file browser to display directories before files instead of mixing both in an alphabetically sorted list.

Start and access the Configurator

If we then run docker-compose up -d Docker will pull the image and will launch it. Did you make changes to the config after starting the container? Restart or rebuild it.

Once running, the editor can be reached at http://<ip.of.our.box>:3218.

Home Assistant Sidebar

As we did with Portainer in previous blog posts, we add an entry for the Configuration Editor to the sidebar of our Home Assistant dashboard using the panel-iframe.

Add the following lines to configuration.yaml (via the terminal or using the editor we just launched):

panel_iframe:
  portainer:     # part 3
    [...]
  nodered:       # part 5
    [...]
  configurator:
    title: Configurator
    icon: mdi:wrench
    url: http://192.168.10.106:3218
    require_admin: true

Go to the Developer Tools in Home Assistant and restart HA.

Once Home Assistant is back online, the entry for the Configurator will appear in the sidebar and we can now make changes to e.g. configuration.yaml and secrets.yaml from within the HA Dashboard.

HASS-Configurator opened in the HA Dashboard
Editing HA config from within Home Assistant

Pro tip: mount docker-config

Want to be able to modify your docker-compose.yaml configuration without having to SSH onto your Docker system? Mount the Docker Compose config file inside You HASS Configurator container!

Inside the config editor tool, the Docker Compose file will appear as if it’s inside your Home Assistant configuration structure, but it’s not :)

services:
  hass-configurator:
    [...]
    volumes:
      - /opt/docker-compose.yaml:/hass-config/docker-compose.yaml
docker-compose.yaml inside the HASS-Config file explorer
Editing docker-compose.yaml from within Home Assistant