I’m kind of new to Docker, though I’ve been using openHAB on and off for a couple of years.
I recently rebuilt my setup and installed the official OH docker image. After fighting and winning the ZWave/udev issue, I thought I’d set up a chart of my thermostat temperature reading…
That’s when I discovered that the mysql add-on isn’t present in Paper UI. In fact non of the persistence add-ons are present.
So, it looks like mysql isn’t installed in the container and can’t be accessed from the host (I did say I’m new to Docker), I have the following questions:
What is the RIGHT way to add persistence?
Am I correct that the mysql add-on isn’t available because mysql isn’t installed?
Indeed yes, no external services are installed inside the container. Docker containers are intended to be “just enough to run the one program”. If you are going down the path of dockerization, you will need to run MySQL in it’s own container.
At this point you will have two choices depending on whether you have anything else that needs to talk to MySQL. You can set up a private network between the OH container and the MySQL container, or you can expose the MySQL container’s ports and have OH access it as if MySQL were running on some other computer.
But none of this addresses the lack of the mysql add-on. So the usual questions apply:
what version of OH are you running?
where are you looking in PaperUI? or are you installing bindings some other way?
what package did you choose when you initially opened the openHAB Dashboard?
The question about package is an interesting one… I fooled around a bit with the docker image getting it to work, but I don’t remember being asked about which package…
Looking into addons.cfg, I see “#package = minimal”, so a package isn’t explicitly set… is there a default value?
The package is set by clicking on the Dashboard when you first connect to it. Unless you explicitly manually edited addons.cfg, that file is having no affect.
It looks like you chose “Simple” as the package on that initial Dashboard screen when you first started OH (assuming a fresh OH install) which installed all the transformations and all of the persistence add-ons for you by default but also hides a lot from you. I don’t know how to change the package through PaperUI but I do know you can change it by removing the comment from that package line (i.e. delete the “#”) and leave it as minimal.