Number nDaily_energy_to_grid_yesterday "Daily energy to grid yesterday [%.2f kWh]" (gPersistRRDEndDaily,gSolar)
Number nDaily_energy_from_grid_yesterday "Daily energy from grid yesterday [%.2f kWh]" (gPersistRRDEndDaily,gSolar)
Number nMeter_energy_to_grid_yesterday "Meter energy to grid yesterday [%.2f kWh]" (gPersistRRDEndDaily,gSolar)
Number nMeter_energy_from_grid_yesterday "Meter energy from grid yesterday [%.2f kWh]" (gPersistRRDEndDaily,gSolar)
I can see the current values in my sitemap, but the values are not persisted.
No errors in the log regarding these items, nor for the rrd4j service.
Did you check for persisted values using the API-Explorer? If you did please state the timeframe you used.
Note that rrd4j is a special database which used to need an “everyminute” strategy ( before openHAB 3). I am not sure if the created daily strategies would work in openHAB 3.
In order to persist daily values I use a proxy item that is set via a (cron) rule once a day (or at whichever needed timestep).
In this case it seems that rrd4j is still in need of a strategy with smaller timesteps.
I am using my setup as with openHAB 2 ( customized archive setup AND (proxy) items that are set only once in the persisted timestep (like daily).
How often are your items with the daily strategy updated? If they are updated only once you could use the everyMinute strategy.
You probably really don’t want to use rrd4j at all then, with its averaging effects.
But if you must, you can create an Item and a rule that updates it only at 00:01 or similar. Then it doesn’t matter if the Item is persisted regularly in the standard rrd4j config (and averaging effects will be pretty minimal until to get to decades, I think)
yes sorry, I understand the confusion in my statements…
What I mean is that the daily item value grow during the day and I want to store it in a new item only at the end of the day and soon after reset to zero the daily item.
What doesn’t work is that it does not store the value inside the rrd4j persistence.
Yes, the item holds the desired value until the next midnight.
I thought about it, but I cannot use everyMinute until the next midnight otherwise I will get the counter with the value on the wrong date.
In other words, I want this:
Daily counters of imported/exported energy (kWh) = starts from 0 and grows from 0:00 to 23:57
At 23:57 I store (update the value) the daily counter values into hystorical Items (i.e. nDaily_energy_to_grid_yesterday).
What I haven’t been abe to do is to persist the hystorical Items associating them to the current day.
Then I reset the counters
I don’t really follow the objection here. Perhaps I wasn’t clear - create a new "dummy"Item and have a rule update at 00:01 or whatever.
If your Item is updated to NNN at 00:01, it stays at NNN all day, until next 00:01. It doesn’t matter if you record the new value at 00:01, or 00:05, or 08:00, or indeed every minute - that’s all the same value for that day.
If you want to record it just once, that is trivial (you can invoke persist in your midnight rule) but this is much easier to do in some other database.
rrd4j is based on preconfigured timeslots or pigeonholes, not arbitrary events. That’s great for e.g. sensor readings and plotting charts -but you’re fighting against its structure here.
It’s possible to define some special archiving strategy for select Items in rrd4j, maybe something something with one-day size pigeonholes would work. I don’t have the skills to do that, but it is likely tobe fiddly.
Me, I’d just make a dummy daily Item and let default settings handle it. Items are free.
Hi @rossko57 ,
I did understood your suggestion, but doing the way you are suggesting will record the value on the wrong day:
If my counter reaches 10 at 23:57 today, I want to store number 10 for today’s date.
Using your approach, I would store value 10 every minute on tomorrow’s date.
So I wouldn’t get the match between the vallue and the date.