Usernames, passwords, hostnames and API-keys for Service and binding in an central place

Hi I’m not sure under which topic to post this.

I’m working to implement openhab2 in my house and I’m at a point where I have a production installation (2.5 testing) and a development installation(2.5 unstable). But I’m missing a place to store usernames and passwords etc. some where so I don’t have to set them when I deploy

I’m using multiple services and bindings: jdbc, unifi, mqtt, openweathermap, openweathermap, ihc, mqtt, verisure, networkupstools, openhabcloud and google-tts

It there a way to do this? Or do you have something like this on your roadmap?

I really hope you can help :slight_smile:

Openhab is awesom

BR Soren

Unfortunately there is no way to do this right now. Though all those settings are stored in /var/lib/openhab2 somewhere. Either in the jsondb or in the config folder.

It has been mentioned before but I don’t know where it falls in the priority list.

If you want to clone the configs for a given OH instance on another one, your best approach right now is to use the backup and restore.

Ok, no problem.

I did get all settings from /var/lib/openhab2 and made my own runtime.cfg. My setup is 98% text file based. This way it was much easier just to have /etc/openhab2/ in my git repo.
I think I’ll make a ansible role and deploy all things, items, etc. and then have services/* as templates

I think that will be an easy way to manage this for now :slight_smile:

Thanks for your reply

I also put my config in git. What I do is also store the important parts of /var/lib/openhab2 in git as well. I have a .gitignore to only include the etc and jsondb folders. I should probably add the config folder as well.

That could also be a way with .gitignore and maybe have e.g. mqtt.cfg-prod and mqtt.cfg-dev and a link mqtt.cfg -> mqtt.cfg-prod and have the link mqtt.cfg in .gitignore

I only have etc in my git. I have no need for /var/lib/openhab2. I found all settings and put them in services/runtime.cfg. Much more simple :wink:

Unless you want to take advantage of automated discovery of Things instead of fighting with the syntax.

That’s true. I used it once with my google home devices until i figured out how to do it by hand. I like to know everything about my setup with no magic :wink:

There’s no magic in the JSONDB. It’s all there in plain text JSON for inspection and, in a pinch, manual editing.

Another option for managing files like this is Chezmoi