SQLITE data to Charts - Various Issues

There's no need for blocking nodes ...

Of course I should! That's so obvious that I missed the concept while head down in the detail. What I had is one sqlite node with the insert and queries connected to it. I have now split this out as below. This represents a great simplification with the output from the mqtt in nodes being combined in the join node while the function node constructs the sql insert statement.

image

Too much data for the charts

I've not looked at influxdb, but will add that to my reading list. When I started this, I thought that this would work well with a RRD (round robin database) and it does appear that influxdb could be used in this manner.

It's true that I need to do something about reducing the data volume. At the moment that's a 'backlog' item and I'm focussing on trying to populate the charts at start-up. For the development I can restrict the data quantity by limiting the time range selected from the database.

I have now got multiple queries running at start up each with this flow structure and therefore avoiding the needed for switch node blocking.

The 'system flow' input at the top is simply the real-time data feed.

A single startup query and function

I've defined the query to get sample data from the database to seed the charts, but am not sure how to process the results from this.

SELECT unixtime, temperature, humidity, pressure, volts0, volts1, volts2, volts3 FROM rtu1 WHERE myDate > datetime('now','-3 hours');

Example query result (directly from sqlite) is
1641745177724|16.687|56.8|996.72|3.259|4.275|16.076|10.373
1641745207282|16.687|56.9|996.75|3.259|9.188|16.999|2.449
1641745236843|16.687|56.9|996.78|3.258|17.903|3.874|23.816

At the output of the sqlite node the object looks like this...

Presumably I need a function node with multiple outputs each feeding to a chart node?

I've also been struggling to work out how to get a chart with two lines and want a chart with two 'y' values - volts1 and volts2 vs time.