Web-based editor

I’ll do a test with docker. Will publish a image soon (hopefully)

/Emil

3 Likes

Thanks for confirming!

Really excited to see this published one day! Great job at intergrating this with HA!

Made the git-repo public if anyone would like to try it out:

5 Likes

Hi @voxic got this running no problems :slight_smile:
I see that currently only .yaml files in the configuration directory are listed for editing, is it possible to add .py files? Also it would be great to be able to jump into folders in the configuration directory, which is where custom components and python_scripts are.
Cheers!

Did an update this morning. Pushed to GitHub. There is now support for .py with code highlighting. Started work on folder browsing.

/Emil

2 Likes

Is there a way to get this to work with Hass.IO?

1 Like

I haven’t used HASS.IO my self and haven’t looked in to what special requirements is needed to be filled.

Right now this editor runs as a stand alone nodejs app.

/Emil

Just what I was waiting for, great!

Committed a new version this morning with the ability to traverse folders.

Next up is to explore the possibility to create a docker image for easier deployment.

//Emil

1 Like

I understand that HASSIO is using a dockerised approach, so this should lead to strighhtforward integration :+1:

Created a docker image, it runs, but I’m having issues with writing to the config files, there is no problem reading. Any docker experts here?

This is how I get it to run:
Install docker, see https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/

sudo docker pull voxic/ha-editor

cd /home/homeassistant/.homeassistant/
sudo docker run -d -p 3000:3000 --mount type=bind,source="$(pwd)"/,target=/usr/src/app/configFolder voxic/ha-editor

https://hub.docker.com/r/voxic/ha-editor/

I’ll give it a try installing the docker tonight and let know how I get on. Re your write issues I have a GUI within Synology that allows me to specify write or ready only. Sorry its no help but a quick search of the docker docs should help.

Thanks! But I just solved it! The docker image is now running fine. The error was actually not with the image, I had messed up the saving function when I implemented support for folders.

//Emil

2 Likes

hi I am pretty new to linux so might have ballsed it right up, but i followed the instructions and get the following error

module.js:328
throw err;
^

Error: Cannot find module ‘express’
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/security/ha-editor/app.js:4:15)
at Module._compile (module.js:410:26)
at Object.Module._extensions…js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)

Hi!

Sounds like you missed the step to install dependencys.
After you have cloned the repo with git.
Go in to the directory and run npm install

/Emil

I have done that… i just re did it, and still the same error ?

Any errors or warnings during npm install? What platform do you run?

//Emil

Ubuntu 16.04 No issues when installing

if you look under ha-editor/node_modules/ is there a folder named express?

if not, try npm install express --save

you can also try the docker image, got that one running earlier today.

Install docker

sudo docker pull voxic/ha-editor

cd homeassistant_config_dir
sudo docker run -d -p 3000:3000 --mount type=bind,source="$(pwd)"/,target=/usr/src/app/configFolder voxic/ha-editor

//Emil