Simplistic configuration UI

  1. You don’t really need to clone the repo. You can just copy and paste the content of configurator.py at the repo to wherever you like. And: this doesn’t have to be in a virtualenv. I actually perfer to have it outside, and the systemd-template is not designed for using this within a virtualenv as well.
  2. At least with my AIO install the directory is /home/hass/.homeassistant. Not sure if that has changed in the past.
  3. pip3 would be correct in your case.
  4. With a capital T: True
  5. Yes, although that’s not the installation, that’s already executing it and everything should be working already as long as you leave that process running.
  6. If you want to use systemd like you have mentioned, yes, that’s how you terminate the process

The systemd-setup is described here in greater detail. The steps are mostly simliar, execept you’re using the template from the repo and maybe modify it to fit your setup.

1 Like

on this point I get in homeassisant www:

Policy not fulfilled

in console where I start configurator.py I see my tries:

pi@raspberrypi:/home/homeassistant/.homeassistant $ sudo ./configurator.py
Starting server
Listening on: http://0.0.0.0:3218
192.168.1.11 - - [20/Feb/2017 22:04:33] "GET / HTTP/1.1" 420 -
192.168.2.1 - - [20/Feb/2017 22:06:20] "GET / HTTP/1.1" 420 -

What do I wrong?

That error is saying, that you have set up some security options. Those are not enabled by default. You probably have set ALLOWED_NETWORKS to a value your client machine doesn’t fit into.
Looking at the two requests that I can see, you should setup allowed networks like this:
ALLOWED_NETWORKS = ["192.168.1.0/24", "192.168.2.0/24"]
Or to only target specific IPs add those to the list instead of the whole networks. In that case it would be:
ALLOWED_NETWORKS = ["192.168.1.11", "192.168.2.1"]

ok, it’s my bad understanding - I thought that 192.168.0.0/24 will work like mask and all subnets from 192.168.X.X will fit :smile:

used your tip and is working :slight_smile: I’m going to test it :slight_smile:

Need to figure out how to setup my github with it :slight_smile:

The git integration is not related to Github. You need a local repository (which you can link to Github though). This is targeted at advanced users, so you should probably test first it with some other, temporary, directory. Git functionality is displayed whenever you are within a repository with the filebrowser. Doesn’t have to be your HASS configuration.

Great work! This is a really nice addition to HA!
I have one problem tough: if I make changes to a file and open another file, the changes are lost :frowning: I think a warning should pop up before opening the second file. Also, tabs would be great! :smiley: And filename search too :stuck_out_tongue:

1 Like

Yes, prompting when there are unsaved changes would make sense. I’ll have a look at that. Tabs for multiple files generally would be possible, but could be tricky to implement quickly. I’ll keep it in mind though. :slight_smile:
Searching for files seems a bit out of scope. HASS-configurations won’t be that huge that a file won’t be found within a few clicks, and such a search function would take far more effort to build than what it’s worth. So if anybody want’s that, he/she can fork and implement it. :stuck_out_tongue:

I’m more of a keyboard than mouse user, that’s why I like the search thing :smiley: I usually use sublime text to edit HA files, and pressing CTRL+P, typing something like “autocam” (it accepts partial name searches), Enter, and having it jump right to “automation/cameras.yaml” is pretty nice :smiley:
But yeah, not the most important feature I admit. I’m not really into web languages, but I may give it a look and see if I can implement that.

Time for a new release buddies. 0.1.5
What’s new?

  • UI improvements (to many to count, but most important: the “save-state” of files is now clearly visible, along with a warning about unsaved changes when trying to switch files)
  • Added git init (create an empty repository for versioning)
  • Added check_config API for HASS (you have to look at the HASS UI though in case there are errors)

Hope you like it. :slight_smile:

5 Likes

Hi, I am quite new to Linux and the command lines, please bare with me.
I switched user to homeassistant by using $ sudo su -s /bin/bash homeassistant, cd to the folder and executed sudo ./configurator.py. It just keeps asking for password, am I not suppose to switch user? If I try run from pi@raspberrpi, cannot find file. I used the AIO installer and running this on PI3, raspbian jessie with pixel

The quick fix (since I’m in a hurry right now) should be: try running the configurator without sudo. That way you’re limited to just editing HSS fies, but in terms of security that’s better anyways.

Edit: Your homeassistant user probably won’t be in the sudoers-list. And usually it shouldn’t be for security reasons. That’s why the sudo-version won’t work.
It should work though using the pi-user. When executing ./configurator, did you navigate to the directory where the configurator is located? The ./ tries to execute the file in the current path. So if you don’t switch, the file can’t be found.

1 Like

Oh, that is what the ./ means, I always thought was referring to /home directory. Thank you and for the information.

No problem. And as an information for the future: the home-directory looks very similar: ~/. One piece added to the Linux-puzzle. :slight_smile:

1 Like

I’m having a strange issue, and curious if this has happened with others. Noob user to the config, but have it working great with SSL, added to systemd no issues. But for some reason I don’t have events, entities, or services populating. I have the API link working, and tested to ensure I can reach the API via Postman. But still can’t troubleshoot what I’ve done wrong.

Appreciate any and all input. Thanks, and absolutely love the hass-poc-configurator. It’ll save me obscene time editing while on mobile, vs. using a mobile SSH interface.

The empty lists are usually a resukt of the configurator not being able to fetch the data from HASS. To investigate what the problem is, start the configurator manually so you can see if there’s an exception happening. If that is not the case, then HASS might not allow API access. This is controlled by the http-part of the HASS configuration, which could look like this to allow access from yout nework:

http:
  api_password: !secret http_password
  trusted_networks:
    - 127.0.0.1
    - 192.168.1.0/24
1 Like

Thanks @danielperna84. It was a stupid mistake with the API URL pointing to /api/config/ after identifying that it’s working great. Thank you very much!

This sounds like a really great addition to HASS, and I’m just wondering if it will become part of the standard all-in-one install, or would it be an add-on of some kind? Great work!

FEATURE REQUEST:

Possible to create custom command line button or text input?

Use case; Currently, the built in restart option in home assistant doesn’t work so I have a shell_command in hass to restart hass or reboot the system. On occasion, a configuration change I make has an error and prevents home assistant from restarting. I can currently read the log with the still running hass-poc-configurator and correct the error but don’t have a way to remotely try to restart hass again. Would be great to be able to create custom command line options and it would undoubtedly open possibilities beyond my use. An alternative to static, preconfigured buttons would be a text input field for entering commands to be sent.

If this is already possible, sorry for my ignorance and it would be great to hear how.

P.S. Thank you again for such a great tool.

Since sooner (or rather later) HASS will probably have it’s own configuation tool, I see “my” configurator only as an addition for the ecosystem. Until now I didn’t find the time though to make a proper documentation that can be added to the ecosystem-area of the HASS-site.

@Kbeesnees
Should be possible. I’ll create an issue for that in the repo. I think a texttual input will be the better way since it provides a lot more flexibility.

2 Likes

Executing commands shoud be possibe with the new configurator.py from the dev branch. Can you confirm that it’s working as intended?

PS: It’s located in the menu on the right side.

2 Likes