Ok here goes with some details from my config

rrd4j.persist

```
Strategies {
everyMinute : "0 * * * * ?"
every5Minutes : "0 */5 * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
}
Items {
// gTest : strategy = everyMinute
// use restoreOnStartup to save the setting
gBR1_Temp* : strategy = everyMinute
gBR2_Temp* : strategy = everyMinute
gBR3_Temp* : strategy = everyMinute
gBR4_Temp* : strategy = everyMinute
gLR_Temp* : strategy = everyMinute
gGR_Temp* : strategy = everyMinute
gHO_Temp* : strategy = everyMinute
gBR1_Humid* : strategy = everyMinute
gBR2_Humid* : strategy = everyMinute
gBR3_Humid* : strategy = everyMinute
gBR4_Humid* : strategy = everyMinute
gLR_Humid* : strategy = everyMinute
gGR_Humid* : strategy = everyMinute
gHO_Humid* : strategy = everyMinute
// global groups
chartpersist* : strategy = everyMinute
statepersist* : strategy = everyChange, restoreOnStartup
}
```

here is the item definition

```
Number POWSO1_Total "Total Power" (chartpersist) { mqtt="<[MQTT:tasmota/POWSO1/tele/SENSOR:state:JSONPATH($.ENERGY.Total)]" }
```

And here is the rule example

```
val Number kWh_cost = 0.1779
val Number kWh_co2 = 0.1
rule "Midnight Freezer updates"
when
Time is midnight
//Time cron "0 * * ? * *"
then
Thread::sleep(2000)
logInfo("energy.rules", "Freezer")
var POWSO1_TCd = POWSO1_Total.deltaSince(now.minusDays(1))
var POWSO1_TCw = POWSO1_Total.deltaSince(now.minusDays(7))
var POWSO1_TCm = POWSO1_Total.deltaSince(now.minusDays(30))
var POWSO1_TCq = POWSO1_Total.deltaSince(now.minusDays(90))
if (POWSO1_TCd != null) {
postUpdate(POWSO1_Total_kwh_day,POWSO1_TCd)
//logInfo("energy.rules", "Freezer:1d " + POWSO1_TCd)
logInfo("energy.rules", "Total Power - yesterday " + POWSO1_Total_kwh_day.state)
}
if (POWSO1_TCw != null) {
postUpdate(POWSO1_Total_kwh_week,POWSO1_Total.deltaSince(now.minusDays(7),"rrd4j"))
//logInfo("energy.rules", "Freezer:7d " + POWSO1_TCw)
logInfo("energy.rules", "Total Power - last week " + POWSO1_Total.deltaSince(now.minusDays(7),"rrd4j"))
}
if (POWSO1_TCm != null) {
postUpdate(POWSO1_Total_kwh_month,POWSO1_Total.deltaSince(now.minusDays(30),"rrd4j"))
//logInfo("energy.rules", "Freezer:30d " + POWSO1_TCm)
logInfo("energy.rules", "Total Power - last month " + POWSO1_Total.deltaSince(now.minusDays(30),"rrd4j"))
}
if (POWSO1_TCq != null) {
postUpdate(POWSO1_Total_kwh_year,POWSO1_Total.deltaSince(now.minusDays(90),"rrd4j"))
//logInfo("energy.rules", "Freezer:90d " + POWSO1_TCq)
logInfo("energy.rules", "Total Power - last quarter " + POWSO1_Total.deltaSince(now.minusDays(90),"rrd4j"))
}
if (POWSO1_Total_kwh_day.state != NULL) {
POWSO1_Total_Cost_day.postUpdate((POWSO1_Total_kwh_day.state as DecimalType) * kWh_cost)
logInfo("energy.rules", "Total Costs - yesterday " + POWSO1_Total_Cost_day.state)
}
if (POWSO1_Total_kwh_week.state != NULL) {
POWSO1_Total_Cost_week.postUpdate((POWSO1_Total_kwh_week.state as DecimalType) * kWh_cost)
logInfo("energy.rules", "Total Costs - last week " + POWSO1_Total_Cost_week.state)
}
if (POWSO1_Total_kwh_month.state != NULL) {
POWSO1_Total_Cost_month.postUpdate((POWSO1_Total_kwh_month.state as DecimalType) * kWh_cost)
logInfo("energy.rules", "Total Costs - last month " + POWSO1_Total_Cost_month.state)
}
if (POWSO1_Total_kwh_quarter.state != NULL) {
POWSO1_Total_Cost_quarter.postUpdate((POWSO1_Total_kwh_quarter.state as DecimalType) * kWh_cost)
logInfo("energy.rules", "Total Costs - last quarter " + POWSO1_Total_Cost_quarter.state)
}
end
```

The number of data points seems to hover around 358 and 360 from what I have seen. here is a snippet of the output from the REST interface for the data

```
{
"name": "POWSO1_Total",
"datapoints": "359",
"data": [
{
"time": 1517377440000,
"state": "23.259666666666664269769171369262039661407470703125"
},
{
"time": 1517377680000,
"state": "23.263000000000001676880856393836438655853271484375"
},
{
"time": 1517377920000,
"state": "23.268000000000000682121026329696178436279296875"
},
{
"time": 1517378160000,
"state": "23.271333333333334536519032553769648075103759765625"
},
{
"time": 1517378400000,
"state": "23.272999999999999687361196265555918216705322265625"
},
{
"time": 1517378640000,
"state": "23.273333333333329875358685967512428760528564453125"
},
```

Thanks for looking at this for me.

Regards

Paul