Problem with persistence and graphic

Hello,
I’ve got some problems to figure out how it works to display a simple Temperature chart.

rrd4j.persist file

// Configuration file for "rrd4j" persistence module

// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {

// for rrd charts, we need a cron strategy
everyMinute : "0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyUpdate
}

Items {

// let's only store temperature values in rrd
temperatura : strategy = everyChange
}

sitemap file

sitemap home label="Tommy SmartHouse"
{
       Frame label="Temperatura"
       {
           Text item=temperatura
       }
       Frame label="grafico"
       {
           Chart item=temperatura period=h refresh=30000 service="rrd4j"
       }
}

item file

//Temperatura
Number  temperatura "Temperatura [%.1f °C]" <temperature> [ "CurrentTemperature" ] {mqtt="<[broker:Tommy SmartHouse/lights/temperatura:state:default]"}

The graph works, but not well and not how I want.


How you can see, it show the value, but not in real time, and some value are lost.
Example: in the photo the temperature is set to 19.0° , after it is changed al lot of time (the sensor is not accurate), and some value, like the 19.0°, doesn’t appears in the graph. How can I solve it? I try to set refresh in the sitemap file at lower or higher value but it seems doesn’t change.

rrd4j have to store eyeryMinute.

How can I make it happen more fast, like every second, or every half minute?

I have already read this document but I didn’t find nothing about on every time store the value

I don’t think you can - it sounds like one minute is as granular as you can get with rrd4j. So you may need to pick another persistence service if you require more a granular time series.

What can I used instead of rrd4j?

The strategy everyMinute must be used, otherwise no data will be persisted (stored).

ok, so I have understand that with rrd4j I can only store data at least 1 minute. If I want store data like every second, how can I do, also using other persistence?

I think rrd4j is a good way to store temperatue-values for a chart over a long time.
I would try and see if it works.

i am already using rrd4j and its ok, but I need to store a value every 1 or 10 seconds

Why?

because I need to put this temperature sensor in a controlled temperature room, and I need a graph very accurate that acquires data as fast as possible.

InfluxDB, MySQL/Maria, MongoDB etc may all be able to do that but you need to read the documentation accordingly and make your choice.

You can use any other database execpt mapdb which only stores the last value.

But our are talking about a room here not a formula 1 car. The temperature variations are not that fast.

Have a look at this:

But beware, the size of your DB will grow fast

Okok, I know that temperature doesn’t change so fast, but if the temperature in the room goes down 20° (for example) I will notice it only after a minute, too late for the circumstance.

I’m going to see them. Thank you

the persistence you listed me are all based on cloud services. I need them to be saved on the raspberry

Not right. You get the notice as soon as the device send it via MQTT.

1 Like

Incorrect, you can install influxdb on the PI.
Again, the pi SD card will wear down with rapid db updates

ok, I know it, but I need to see it on the graph