Developing and distributing a package. What approaches are available?

I wrote the Simplified Zwave Lock Manager project, just to manage my lock. I had no intentions of turning this into a community project, yet that’s exactly what happened. I’ve had a lot of help from the community, particularly from @firstof9 helping other users get started.

Unfortunately, to install the package requires you to have some basic Linux tinkering skills. My goal is to find a way to install/update/delete “the package” completely within HA, preferably using HACS.

The way the system works now works as follows:

  1. The user downloads or uses git clone the project into the config/packages directory.

  2. For each zwave lock the user wishes to control, they create a named ini file for that lock in the package directory. e.g.

    • config/packages/lock-manager/FrontDoor.ini
    • config/packages/lock-manager/BackDoor.ini
  3. The user edits the ini file to determine how many “slots” the lock should create, which zwave lock to work with, etc.

  4. The user runs from a bash prompt the included config/packages/lock-manager/setup.sh script. This script is dependent on certain packages be available to the shell. Including but not limited to sed, awk, grep. The script will look at each ini file and create a matching folder which will contain all the declarations, automations, scripts, etc. for that lock. It will also contain a file of lovelace UI representing a new view dedicated to that lock. So using the FrontDoor/BackDoor example from above you would see two new directories:

    • config/packages/lock-manager/frontdoor
    • config/packages/lock-manager/backdoor
  5. Restart HA and the entities, scripts, automations, etc will be active.

It’s not complicated, and with just a base set of linux skills and ha knowledge you can install this under a minute. However…

How can we help someone without linux knowledge install and maintain this? I believe in order to get from here to there we need at least the following:

  1. A way to load the code into config/packages/lock-manager.
  2. A way for a user to create/update/delete ini files. Obviously a UI would be a requirement. Part of this would be selecting a zwave lock in the system to associate to this lock. When deleting a lock (ini file) we need to delete the directory associated with it.
  3. A way to execute the setup.sh script
  4. A way to copy the contents of the lovelace file into clipboard memory, to paste into the lovelace UI editor.
  5. How can we notify the user when the package has been updated? How can they update to the latest code?

Is this something that HACS could handle?

HACS would handle this.

These could technically all be done via a custom component, I’d be willing to assist with cranking one out.

This part might be tricky, the component could spit the lovelace UI config into a file in the user’s configuration directory (ie: /config) for them to copy/paste into the UI on their own.

Integration complete.
I’d be happy to merge this into your repo.