Extend add-on capabilities

Im reallty looking forward homebridge in hassio

For persistant data storage inside add-on, you can use /data. That is a private storage per add-on otherwise /share that can be available on ever addon and is also mount to homeassistant. /data will be also auto cleanup on uninstall of add-on.

I would like to add tmpfs capability to the addons. It is relatively trivial to add a new dictionary in config.json to use the tmpfs option on the docker api. I could propose a PR in github if you think you can integrate it.

Adding this option to addons config is needed to prevent multiple write on the sd card when it is not needed. I will use it for the pipe file between mopidy and snapcast.

Ok, I see not mutch case who that is needed but I donā€™t see any security problems. Yes please make PR. I will cleanup the docker code, but I wait until your PR is done.

Why canā€™t you use /dev/shm as mentioned in https://unix.stackexchange.com/questions/26364/how-can-i-create-a-tmpfs-as-a-regular-non-root-user ?

I didnā€™t know that one. Thanks ! With the tmpfs option it is possible to specify the size limit, which is not possible with /dev/shm. But it is another possibility I will keep in mind.

EDIT : /dev/shm is a mount point, and not a device :

docker: Error response from daemon: linux runtime spec devices: error gathering device information while adding custom device "/dev/shm": not a device node.

Should I put Homebridge config in /share? As a user, I like the idea of having all my configs in the same folder (/config).

Loosely related: where are the add-ons configs stored? Is there a way to back them up or restore them all at once? Something like /config/addons/addon_slug.json or /config/addons/addon_slug/config.json would be nice :slight_smile:

Then, it would maybe be cleaner to move HA config folder from /config to /config/homeassistant.

Addon data/config are in /data. Addons should be have only options they are available over the UI. In your case, you should setup the homebridge config from options every startup like the core addons does.

I thought about that, but the config file of homebridge can be very complex, depending on the installed plugins. Is it possible to say we accept ā€œany valid JSONā€ under one or more fields of the add-on config? The current schema property doesnā€™t seem to allow that.

In addition, I would like users to be able to access the persist folder of homebridge as itā€™s useful for backups (and debug).

In next hass.io release you can use schema: false and use any json for options.

Backup/restore will be a core feature in few weeks and work with /data too. Anyway it is your addon repository and you can do what you want do.

Thanks for your answer :slight_smile: Glad to hear backup/restore will be core features!

I wanna be a good citizen of the platform, Iā€™ll update my add-on then to take advantage of them and place the config/persistance files correctly.