Persistence issue with updatedSince

Hi, I have the following in rrd4j.persist:

// for rrd charts, we need a cron strategy
everyMinute : "0 * * * * ?"

      default = everyChange

}

Items {
* : strategy = everyUpdate
} 

And in my Rule that is run every minute, I am using

var i1change = Item1.updatedSince(now.minusMinutes(1),"rrd4j")

I know that Item1 is changing every 10 minutes so I expect that it will be false 9 times out of 10, and true 1 time out of 10 but it isn’t - instead it is always false.

Any help appreciated

rrd4j only work with everyMinute as specified in the docs there:

Thanks. I have influxdb going too… how should I set that up?

Set what up?
rrd4j everyMinute or persistence with influx?
If you have influx set up for persistence for that item with influx then replace rrd4j with influxfb in:

var i1change = Item1.updatedSince(now.minusMinutes(1),"rrd4j")
1 Like

Sorry, I meant the influxdb.persist after I change to

var i1change = Item1.updatedSince(now.minusMinutes(1),"influxdb")

I currently have it as:

Strategies {
    everyMinute : "0 * * * * ?"
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"
}

Items {
    
    *                     : strategy = everyUpdate, everyChange, everyMinute
}

But this isn’t working.
Should I take off “everyMinute”
I’m not familiar enough with how this works and don’t want to break things!

Are you actually storing anything? You can use REST API to find out.

Yes I am definitely storing data since I can see it on Grafana etc.

If the state was actually changing e.g. 5.67 to 8.12 to 8.45 etc. then I can use changedSince which seems to work fine for other Items. Unless it happens to be the exact same number as one minute ago, this works.

However for this other item, the state doesn’t constantly change, but I want to make sure that the device is still checking in and logging data, hence why I want to use updatedSince

I notice your influxdb.persist doesn’t have a default strategy defined.
I believe this is mandatory even if you don’t intend to use it.
I cannot see how it would lead to your problem, though.

For test purposes, what happens if you look back 2 minutes? I have a worry it is slipping down the cracks between the granularity somehow.