Trigger periodically a value to database

Hi !

is it possible to trigger a value every day at 0:00h and write it to influxdb ?

grafik

this are the values from the integrated heat meter of my heat pump.

I would like to build the consumption of every month / year.

January: value of 1.2. - value of 1.1. = ...

if influx is not necessary... even better :wink:

greetings

The built-in inject node has an option to send its message at a given time on selected days...

Wire that to the logic that reads the kWh value and pushes it to the database. InfluxDb is not the only database you could use, but it is nice for time-series data, like this. Since you want to keep a long-term history, I would say a database is the right tool, especially if you plan to query for the data later in order to build reports or graphs.

A lighter-weight solution would be to write the data into a CSV file, or a local file-based database like sqlitedb. Search the flows.nodered.org site for example flows that do something similar...

1 Like

thx.
grafik
so I can feed Influxdb every day 0:00 :slight_smile:

is it possible to calculate with the values in Grafana ?

does somebody know how to get the values from influxdb back in Node Red ?

I have no idea, and every thing I found doesn´t work.

Which version of influx are you using (1.8 or 2.0)?

I see you have selected, in the influx node, v1.8 using the flux query language. Unless you want to use flux then just select 1.8 (assuming you are using 1.8). Then you can query the database using the SQL like query language. Influx Query Language (InfluxQL) | InfluxDB OSS 1.8 Documentation

grafik

I got the values, I had to change the server from 1,8 to 1,x.

Does anybody know how to calculate the values by time series?

I want: value of 2021-02-01 "-" value of 2021-01-01 = _____ calculate.

I don't think that influx 1.8 supports that, though I believe 2.0 does. I think it is possible in grafana using timeshift but I don't know exactly how.

I have avoided this problem by also storing the difference from the last value in the influx record. Then you can use cumulativeSum to add them up between two times.