Made a move away from supervised installation into separate docker once. Supervised had a great file editor add on which fitted nicely into HA. As i can see there are a number of options to choose from - but is there a way to integrate the file editor without opening numerous number if ports on the firewall? Something that would work alongside HA Docker?
Might help:
„nano“ on the host. You need host access anyways to control containers.
I use Winscp for file access to My HA Container install and then use Notepad++ as my file editor.
Yep. Do the same, and use VsCode as I like it’s ability to manage my HASS config as a project.
I use the code-server (VSCode) Docker container from linuxserver.io for editing my config files.
Panel_iframe makes it accessible right from my HA sidebar, or it can be used from a separate browser tab or window. Very convenient, as I can edit my config files easily on my Linux laptop or my iPad as well as on my Windows PC.
I could name a douzend even more complex options, but I consider nano the simpliest (actually I am using Vim).
The configuration.yaml is becoming less required with every integration moved into UI. And you are advised to keep out of .storage.
can you elaborate on this? Maybe a docker compose and how the panel_iframe is integrated?
Here’s the page for the container, with example docker-compose file:
GitHub - linuxserver/docker-code-server
This is my docker compose file (I specify a container version, you can use latest if you want. You don’t have to use a password):
version: "2.1"
services:
code-server:
image: lscr.io/linuxserver/code-server:4.9.1
container_name: vscode
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- PASSWORD=yourpasswordhere #optional
- DEFAULT_WORKSPACE=/config/workspace #optional
volumes:
- /home/anwen/docker/vscode/config:/config
- /home/anwen/docker/homeassistant/config:/config/workspace
ports:
- 8843:8443
restart: unless-stopped
In your HA configuration.yaml, use panel_iframe to put in the URL for your code-server web gui on the port you specified in your docker compose file (just copy it from your brower and paste it in):
panel_iframe:
vscode:
title: "VSCode"
url: "http://192.168.0.43:8843/?workspace=/config/workspace/HA%20Container%20Config.code-workspace"
icon: mdi:microsoft-visual-studio-code
Docs for iframe: iframe Panel - Home Assistant (home-assistant.io)
Hope that helps!
Any settings to vscode.config file? Thanks for sharing!
Does the iframe with a local address work from outside? HA does some kind of proxiing?
I have samba configured on the Ubuntu host running home assistant container, so can access the config files through any other windows machine’s file explorer on the network. I have a wireguard VPN so can access the files remotely on VPN as well.
Just for an explanation. The Supervisor had a web based GUI file editor add-on. So you could change the file from anywhere in the world just using the standard homeassistant:8123 web interface. No VPN or alternatives, no hassle with the ports. Even the HA android app worked seamlessly
Seems @pedolsky and @Anwen solutions are the closest you can get to
Now i remember the problem
Unable to load iframes that load websites over http:// if Home Assistant is served over https://.
The supervisor add on somehow got over it but with dockers seems close to impossilbe
I would avoid port forwarding home assistant on 8123 and make sure to put home assistant behind a reverse proxy or vpn
You can serve local http pages over iframe on https with a reverse proxy - I use swag/nginx to see the zwavejsui and zigbee2mqtt web pages in Iframes in home assistant.
The vscode config file will be managed by the container itself. I don’t serve over https. I use Tailscale for remote access - it’s really easy to set up, don’t have to open any ports, and it uses Wireguard so it’s secure.
I also use GitHub to manage the HASS config. I find it’s very helpful to see the diffs to make sure I did not accidentally break something.
Github or Git? With GitHub, your secrets are potentially available online …
GitHub, private repo.
I exclude secrets.yaml from GitHub and a couple .storage files that have tokens in them.