I have a raingauge set up to deliver mm rainfall to my OH2.2.
On that data, I use
rainmm.deltaSince(now.toDateMidnight, "rrd4j")
to give me rainfall since midnight, minusHours(1) to give me rainfall in the last hour etc.
Everything works
Now I want to also show yesterdays rainfall - meaning from midnight to midnight the day before this one. Is there a simple “deltaSince” command which would bring me that ? I am guessing that you could fiddle with the “now.” part - to set a different endpoint for the deltaSince ?
But wouldnt this give me the rain from 24h ago until last midnight (so if it is 12:20 now, I would get the rain from yesterday at 12:20 until midnight ?
I’m an idiot - can’t read my own data. Your first suggestion - as well as the last one works !!
Thanks - I actually didnt know that you could just insert the pointer after now. like you showed. With that it was easy to do i.e. “rain day before yesterday” as well…
Thanks !!
Where do one look up the valid syntax and possibilities for this ?
now.withTimeAtStartOfDay.plusDays(1).minusHours(24-hours).plusMinutes(mins)
For example I want to set a timer to 18:36 today
So I have
hours=18
mins=36
The now expression goes likes this:
now
.withTimeAtStartOfDay - Today 00:00
.plusDays(1) - Jumps to tomorrow to avoid daylight changing problems so: Tomorrow 00:00
.minusHours(24 - Hours) - Today 18:00
.plusMinutes(mins) - Today 18:36