I have searched for a snippet of SQL that will allow Grafana to graph multiple items dynamically. But I am not finding a solution that is to my liking.
I have persistence running and logging to MySQL.
Here’s how I see the MySQL binding working:
There is a table (Items) that has a list of OH item names and a corresponding numbers. This number corresponds to a separate DB table (e.g., “2” corresponds to “Item2” table).
There are tables for each item. Each table has two columns, a time stamp and a value.
So I am trying to craft a SQL statement that will select all of the Item names that have “Temp” in them and then select from each named table the data points for Grafana.
I know that in Grafana I could manually add queries for each Item table and it will work; I am looking for a more dynamic query so that when I add more sensors they just appear in the graph.
Has anyone done this?
Or is there another MySQL binding that would create one table with columns for Item, timestamp, value.
Thanks in advance