about the scripting datasource executionDelaySeconds, p1.value execute time
-
in below situation
To calculate a daily consumption based on a incrementing register. This is most commonly used for calculating daily kWh values
return p1.value - p1.ago(DAY)somes, to avoid much resource execute one same time(et 59 59 23 * * ?),we setup the executionDelaySeconds,for example,executionDelaySeconds is 30 seconds,then we use
p1.value - p1.ago(DAY),p1.ago(day) 's value is the last day 23:59:59 's value ,but the p1.value's time is not the firetime'value ,it is today 23:59:59+30seconds times value, it have Deviation.
so,if have some way to calculating exactly p1.value-p1.ago(DAY) in executionDelaySeconds case
-
You could do something like this:
return p1.value.previous(DAY).maximumValue - p1.value.previous(DAY).minimumValue
-
Thanks, and the p1.value.previous(DAY) base on the cron time, not the execute time(it DelaySeconds),so the cron need after 0 clock, etc 5 0 0 * * ?,not the 59 59 23 * * ? is it right?
-
I'm not sure, you'll have to test this and let us know.
-
And i have tested, it is base on cron time,so the cron need after the 0 clock.