How do I store all my openhab configuration to git?

  • Platform information:
    • Hardware: Raspi3

    • OS: Openhabian

    • openHAB version: 3.3

I started with openHAB2 and thought at the time that it would be a good idea to store the configuration completely in text files (.items etc.).

In openHab3, for example, the pages of the new GUI are stored in a different place than the previous configuration files.

Can you store your complete openHAB configuration in GIT? Does that make sense?

Yes and yes.

The summary of those links is: include userdata (e.g. /var/lib/openhab) as well as conf (i.e. /etc/openhab). You should definitely exclude the cache, tmp, and backup folders. Other folders (e.g. persistence) you can decide.

Even if you put all your configs from the conf folder into git and did no configuration through the UI, you’d want to include userdata in your git to have the full configruation.

Other folders you might want to consider excluding:

  • userdata/logs (I run quite a few bindings in DEBUG mode for development purposes, YMMV)
  • userdata/voicerss/cache (if you use voicerss)
  • userdata/zwave (if you use zwave; these files get regenerated)

Yes, I wasn’t thinking about a manual install. On an apt/yum install, the logs are in /var/log/openhab but in a manual install they are in userdata (Docker uses a manual install). Other bindings may also have folders there that should/should not be included.

Yeah, there definitely might be some other folders in userdata depending on what bindings you use. I pointed out some of the more annoying ones (for me at least) that tend to cause a lot of noise for git.