New HA user here. I was wondering how most people edit their YAML files. I have HA installed on a headless Linux server and using VI via a terminal is annoying and slow. Any recommended tools for remote editing the file from a Mac?
I installed SAMBA following @bruhautomation 's instructions. I edit using Notepad++
This is how I do it…
I have all my config files in a git repository.
I edit the files on a remote machine (which also happens to have a test environment of HA installed on it)
When I am happy with the result, I run a script which pushes the files to the git server, then connects with ssh to the production HA system, pulls the newly committed files, and then restarts the H.A instance.
Here is a copy of my scripts:
cd ~/.homeassistant/
#remove ssl comments
sed -i.bak -e '/^#.*ssl/ s/^#//' configuration.yaml
#commit changes
git add .
git commit
git push
#pull current code to server and restart
if ssh myuser@myip ./ha/pullp.sh; then
echo "successfull"
else
echo "failed"
fi
and here is the pull script
cd ~/.homeassistant/
git remote update
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse '@{u}')
if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date restart not required"
elif git pull ; then
./har.sh
else
echo "Unable to pull current config from source control"
exit -1
fi;
This may be overkill for what you are trying to do, but I find it to be a great strategy for modifying my configuration.
I use a git repo as well with travis.ci to check the config on errors after every push. But I do not have a separate script to push the files over. Instead I have a script that starts up my home assistant and this pulls the newest config from github every time it before actually starting HA.
So I change files, push them to git, wait for travis to be okay (or not depending on how lucky I feel) and restart HA.
For the changes I use ATOM with a few plugins.
~Cheers
I use this one on my android phone:
which is very convenient because it directly shows my files via ssl.
On my linux computer I just added a network folder and it’s like being at home.
Use @danielperna84’s brilliant Configurator add-on, available for both hass.io and standard installs. You can then edit files directly in the HA front end or via it’s own built-in web interface.
- 1 for @danielperna84’s HASS Configurator add-on!
I run my Home Assistant instance (installed with the AiO installer) on a Raspberry Pi 3 so I make use of the SSH connection (via SFTP) to edit my configuration files.
For quite some time, I used Atom with the Remote-FTP package. This worked great but wasn’t always 100% stable.
Just recently, I switched to Visual Studio Code with the ftp-simple extension. I wanted to give this a go because people seem to have good things to say about VSCode. I definitely like how much you can customize this editor.
I use syncthing.
I have my setup running in docker, so I have a docker container for HASS, and one for syncthing. They both bind mount a volume for my configuration directory. Syncthing on my desktop and laptop makes sure everything stays synced up. Then I edit using visual studio code on my desktop or laptop depending on what I need.
I don’t have to mess with any remote connection, SFTP, samba, etc.
install nano
apt install nano
THEN
nano /file location/wannaeditthis.file
VI is nice but can be a little slow
Nano might be a little easier to use as controls are visible and simple (arrow up/down/left/right to move)
I can open files with DroidEdit but unable to save files. Do you add Private Key Path in DroidEdit settings ? If yes where can i find Private key Path.
Indeed. I used Nano over SSH for quite some time but when I switched to Atom I realized how crippled that setup is. Unfortunately Atom is a bit unstable at times, I’ve had a few freeze-ups and occasions where files haven’t saved properly on my server. Still, it’s waaaay better than Nano
I have port forwarding on my Asus router for use my Homeassistant remotely.
I have installed hassbian on Pi3 & use Samba to edit my configuration files. I have 2 different password, one for Pi and other one for Homeassistant.
I think port forwarding on Asus router and duckdns.org both are for access Homeassistant remotely.
The Cloud9 addon is awesome for editing your files
I did this. Works really well. Thanks for the tip!
I’m about to give VSCode a go, how did it work out for you?
I have used VSCode with RemoteFS previously (Droplets etc.) and it works a treat!
I don’t use it that intensely but I’m happier with it than I was with Atom. I especially like how it copes much better with opening big files (namely my home-assistant.log
file, as I do occasionally end up with alot of errors).
Admittedly, I have ditched using plugins/addons to be able to edit my Home Assistant files over SSH. It never worked reliably with Atom, and my experience with VSC wasn’t all that different. Now I just use a shared folder over SMB, so I can edit my Home Assistant files in a way that VSC supports natively. My experience with Atom could’ve been more positive if I had done the same back then.