Agreed; I even mentioned this same thing earlier in the thread!
WOW! Fantastic work!!
Please, commit this feature in the official repository for the next update!
It’s very important to reduce the gap beetwen the other similar platform.
Is it possible this could be introduced as a component yet maintain being separate in the sense it still runs when HASS isn’t? Maybe it could be initially configured through configuration.yaml with credentials, port number, paths, etc… When HASS starts, it could then save the configured settings into a separate config file that your configurator accesses and start your configurator. The settings would then be updated every restart if changed in the configuration.yaml. If for some reason HASS doesn’t start after a change, your configurator would already be running. I think the need for this to be accessible when HASS isn’t is very important and a great feature. I would also like to see it as a permanent fixture in HASS too. I upgrade HASS every two weeks when a release is out and I think it would be great if this would update right along with it.
I’m elated to have this on my system. Great work and thank you for sharing it with us.
Thanks @danielperna84 for putting this together, it looks and works great!!
Wanted to share with you a slightly different way of running the configurator.
Instead of running it from a screen’d session, I’ve set it up to run under Supervisord. It’s a little more complicated to setup, but once it’s configured, it’ll run every time, on boot, with the exact command line options you want. Also, if configurator.py dies for any reason, it’ll respawn!
To do this,
- First install configurator, and set it up the way you want it.
- Then simply install supervisord for your os, on deb it’s just: sudo apt install supervisor
- The default config works fine, but I would recommend enabling the http server, and a password, instructions for that can be found here.
- Lastly create a config file for configurator, mine is located here: /etc/supervisor/conf.d/hass-configurator.conf
- Mine looks like this:
[program:hass-configurator] directory = /etc/homeassistant/.homeassistant/ command = sudo -u hass /etc/homeassistant/.homeassistant/configurator.py /etc/homeassistant/.homeassistant/settings.conf user = root
- Then enable it with: sudo service supervisor enable
- Finally start it (if it’s not started) with: sudo service supervisor start
Supervisor’s web interface can be found at: http:// YOUR SERVER IP :9001
Here configurator can be stopped, started, etc…
I’ll answer any questions I can, or help anyone else get it running this way. But be sure and checkout the supervisor homepage.
Enjoy!
Thanks for the description. I have added a template-configuration compatible to AIO-installs to the repository and mentioned the use of supervisor in the readme. This is way better than using tmux or screen, and the web interface makes me favor this over systemd as well.
Yea man, you’re welcome! Thanks for including it in your repository.
I really like supervisor for any program or script that needs to be run from the command line. With the added web-ui it’s far superior than screen, or any other process. Plus it separates out any and all logs from the program being run, into their own stderror / stdout log files, respectively (found in: /var/log/supervisor/). Done plugging supervisor! hehe
Now that you mention it: the logs stay empty for my configurator. Is there anything that needs to be added to the supervisor-configuration to make this work? I see the tmp-files, but nothing gets appended to them.
I see what you’re saying, mine are empty as well. I was just looking through the documentation and it doesn’t look like anything special needs to be added, unless you want the configurator logs to go to the syslog facility.
From the documentation:
The configuration keys that influence child process logging in the [supervisord] config file section are these: childlogdir, and nocleanup.
I’ll look into this a bit further and see what I can find out.
Another question is, is configurator outputting anything?
Great news fellas: Version 0.1.3 has been published.
New features:
- Upload and download files (upload limit is at 100MB)
- Basic Git integration (stage modified files and commit changes)
Minor changes to the UI have been made to integrate the new features, but it should make more sense how it is now.
For Git to work, you need to have the GitPython module installed and enable it in configurator.py.
Hope you enjoy the new features.
Edit: @jmart518
Nevermind. Fell into my own trap and forgot to enable git in the source. However, the git commit menu isn’t showning up all of the sudden. -.-
Edit 2: The menu is just showing in mobile view.
Edit 3: Thanks, it’s fixed now.
@xstrex
Well, yes, the access log. And in cases of errors some other messages. Not sure though if they got out through stdout or stderr. But that shuldn’t matter. So I don’t get why it’s not working.
In latest update 0.38 this is fixed - when you change config and run restart in menu hass is first checking if all config files are ok - if no errors is going to restart, if find out that files are messup then is stopping operation and you know that you need to repair something.
So no more worry about that
btw, great work with that config-editor
I’ll work on this today, to try and figure out why.
This is a great add-on. I was successful in installing and configurating it. Was able to test it as well by starting the configurator manually, but I am having some issues trying it to start automatically. I installed Supervisor, but getting an error when I do sudo systemctl restart supervisor
I get this error message:
Job for supervisor.service failed. See ‘systemctl status supervisor.service’ and ‘journalctl -xn’ for details. the systemctl show: Process: 15363 ExecStart=/etc/init.d/supervisor start (code=exited, status=2)
Also tried the systemd approach with no luck.
I am running from the All in One installer.
Would anyone have a clue of what to do so that I can get this to run after every reboot?
Can you paste the output of: sudo service supervisor status
That might give some indication as to why supervisor is giving you trouble.
If i do a sudo supervisord --version, it returns “3.0” which tells me that something is installed, although I saw soemwhere that the current version is 3.2.x. I also see output of a sample configuration if I run sudo echo_supervisord_conf.
The output of sudo service supervisor status:
supervisor.service - LSB: Start/stop supervisor
Loaded: loaded (/etc/init.d/supervisor)
Active: failed (Result: exit-code) since Sat 2017-02-18 23:58:23 EST; 10h ago
Process: 15363 ExecStart=/etc/init.d/supervisor start (code=exited, status=2)
Feb 18 23:58:23 HASSbox supervisor[15363]: Starting supervisor: Error: Another program is already listenin…sord.
Feb 18 23:58:23 HASSbox supervisor[15363]: For help, use /usr/bin/supervisord -h
Feb 18 23:58:23 HASSbox systemd[1]: supervisor.service: control process exited, code=exited status=2
Feb 18 23:58:23 HASSbox systemd[1]: Failed to start LSB: Start/stop supervisor.
Feb 18 23:58:23 HASSbox systemd[1]: Unit supervisor.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
I’ve been working on this for 2 evenings straight and exhausted all the hints and tips that I could find on the internet. I has previously installed supervisor on a different system and if I can recall correctly, got it working in a matter of minutes, not sure what’s different here unless it has to do with the AIO install.
Thanks
Even though I don’t know what the problem is, I can tell it’s not related to the AIO installer. I have that as well, and for me it is working. So there must be some othere difference we’re currently not aware of.
Looks likes supervisord is already running when systemd is about to start it.
@berniebl there’s your problem, it’s already running.
@m0wlheld was right.
Here’s what I’d suggest…
Run these in order:
Sudo service supervisor stop
Ps -ef | grep supervisor
(Just to make sure it’s dead, if it’s still running: sudo kill -9 {pid of supervisor})
sudo service supervisor enable
sudo service supervisor start
Finally try going to: http://[your ip]:9001
You should see a supervisor UI, with configurator running…
Lastly please direct supervisor specific questions to me, I’m sure @danielperna84 has enough on his plate. I’ll get back to you as soon as I can. If more people have issues with this, I may just start a new thread, so I don’t hijack this one.
0.1.4 has been released!
Changes:
- UI improvements
- git integration now able to create new branches and switch between them
I think we are heading to a tool in it’s final stages of development. The only features I see left to add are related to git: initialize repositories and show diff of files. Merging branches seems out of scope due to the complexity that process involves.
Besides that, are there any features you think this tool would benefit from? Apart from deeper HASS integration, for which we first need some more API-functionality on the HASS side.
Big thanks @jmart518 for his big help with getting my ugly new features pretty!
You guys have made a great dev team. Cheers to you both; it’s been really fun watching this from a concept to something that I find myself using regularly now.
Hi, I want to start using it, what do I need to do is: (I’m noobie in this, please clear if is something that is missing)
- git clone https://github.com/danielperna84/hass-poc-configurator.git - in virtual enviroment as homeassistant user (I’m using All-In-One Installer)
- copy configurator.py to /home/homeassistant/.homeassistant/
- pip install gitpython (If want to use GIT) and I’m not shure use pip or pip3 install
- edit configurator.py (change variable GIT to true)
- sudo ./configurator.py - start installation
- ctrl-c to close and stop testing it.
Next I want to setup systemd. I’m running latest raspbian and AIO installation for Home-Assistant - what do I need to write in console to make it work?