How to persist data info multiple InfluxDB databases

My OH2 system holds both “private” data and semi-public data like the plant watering levels from a Xioami sensor binding which I am in the process of creating. I would like to graphically visualize the data from that binding on an external website too.

I got the influxdb addon working, and it persists all the data I want to. Now, I would like to either push some of that data (The earth humidity of the plants, to be precise) to a secondary, external, database. Best would be if OH2 has a built-in way of achieving this.

If this is not possible, I would have to periodically export data from the “internal” influxdb and import it on the external one. To be honest, this feels really clumsy :smile:

A search on google and StackOverflow also gave me no hints as to how I could achieve this mirroring. Any ideas anyone?

There is no way I know of to do this through OH. If you were willing to use some other DB for one store versus the other store, or isolate the data in some other way (e.g. reverse proxy rules that only allow access to certain URLs, take advantage of Grafana users and only allow that user to have read only access to only the charts you want to expose, etc) you can get the same thing you are shooting for without mirroring the DB.

Personally I’d go with the Grafana user’s route as Grafana appears to be built to handle this use case. Your InfluxDB is not exposed at all. Only Grafana is exposed. In grafana you would create a separate panel with just the charts you want to expose. Then create a new user and allow that user read only access to just that panel. (I’m not using the right word, but I’ve been traveling all day and can’t think of the right word. I mean the page with lots of graphs on it). Then your externally exposed UI would only access these charts using the limited user so only have access to what you want to expose.

Actually, thinking a bit more about your setup, I think I would go with two Grafana setups. One holds only the “public” graphs, and the internal one holds every other thing I want to use Grafana for.

Then, both Grafana installations would access the same influxdb (which is installed in my internal network). But as I know the address of the “external” installation, I could put rules in my firewall that allow access to influx only from that one host.

Still not as secure as a completely seperated database but good enough for a proof of concept installation I guess :smile: