Would it be possible to write an integration to edit configuration.yaml?

I’m using the Home Assistant Container installation type as described here. It has the advantage that everything Home Assistant is nicely contained in the container (I’m also running Rhasspy, mopidy and a bunch of other stuff on the Pi) but apparently it has the disadvantage that it does not have the configuration.yaml editor that Home Assistant OS and Home Assistant Core have.

Before I start looking into the “how”, I would like to know if there might be any reasons why a regular integration would not be able to write configuration.yaml. If no, then I might look into making one.

Preferably one that shows up in the “Integrations” setting, but one like those would also be ok.

Core doesn’t have a built in editor

OS doesn’t either, though you can install an add-on (aka software in a Docker container) to do that

configuration.yaml is used in all installation methods.

Yes… so?

Sorry misread your post Lol.

What editor do you prefer? Just install it.

Doesn’t really matter, a simple textarea would already be helpful.

What os are you on as your base? What editor do you use in your base os?

Well, that official Raspberry thing… Debian Buster or something like that?

You mean on the shell? I usually use mcedit, the builtin editor of Midnight Commander. But I really really don’t care what the editor looks like, as long as it is reachable via HTTP and behind the Home Assistant authentication.

Oh you want something in the web ui?

Just keep using the shell. However I love the supervised install. You get all the addons incl editors.

Yes, I really thought that was clear from my post. :expressionless: I’ll try to rephrase it.

I don’t really want to set up VPN or whatever to get SSH access just to add a simple MQTT sensor or something.

The supervised install is missing from the Raspberry Pi section so I’m assuming it is not supported on the Raspberry Pi OS.

You can set up Visual Studio Code in a docker container and use that from within HA by setting it up as an iframe.

How would I go about that?

Are you asking how to set up VS Code in Docker or how to incorporate it as an iframe in HA?

No. But on a Pi 3 or Pi 4 you can install Debian, and then a supervised install is fully supported.

Both. There doesn’t seem to be the one VS Code Docker image, so I would at least need to know which image is suitable for the task.

And then I would have to run it through Home Assistant’s web server to check the authentication and since I’m not familiar how Python web apps work I don’t even know where to start. (I remember something about uwsgi but it’s been 10 years since I last worked with that.)

Here is my VSCode docker command:

sudo docker run -d --name vscode --restart unless-stopped -p 8443:8443 -itd -v /home/finity/docker/vscode:/config -v /home/finity/docker/hass-config:/config/working_folder -e TZ=America/New_York -e PASSWORD=<password> -e SUDO_PASSWORD=<password> linuxserver/code-server

and the iframe:

panel_iframe:
  vscode:
    title: VS Code
    icon: mdi:visual-studio-code
    url: <vscode_url>

for the URL use the IP address of the host and port 8443 or whatever port you used in the docker run)

I rarely use it (if ever) since I edit my config locally on my Windows PC using SSH and Notepad++ but it worked when I initially set it up.

1 Like

Sorry, you mean something like this?

That doesn’t seem to be integrated in Home Assistant at all? It seems just like installing webmin or something like that.