Rrd4j persistence once a day issue

Alright, you’re trying to back-project your value n time. I really don’t think you’ll have much luck trying to do that in rrd4j.

openHAB persistence service is all about storing values represent “now”,not past or future events. There was a recent thread about posting updates using low-level API for arbitrary timestamps,might help you.

The much simpler alternative remains to use another db, and persist to it by rule at 23:59

Yes. Which db do you suggest? I am using a PI3 with 1GB of RAM.

Personally I don’t use any other than rrd4j and mapdb. Influxdb seems popular and flexible.

You allready know how to use xxx.persist files to select what to do when, don’t let default settings persist everything to every database or you’ll lose performance.

I did not read the whole chain (hopefully this is relevant :wink:) but I use mysql/maria/jdbc to store a daily KWH reading on a Pi3. Some pictures


jdbc

Sorry to spam the topic, but the pictures are easier than trying to explain. There are some “getting going” issues with mysql. I also have an Excel spreadsheet that pulls from the DB for further calculations.

Bob

1 Like

Actually, I am not trying to change the date of my data.
Infact I am collecting the value of the item at 23:57.
What I wanted to do was to store that single value in the db before midnight.
Apparently it’s not possible with rrd4j?

That’s easy, put your value in an Item that is not persisted at all automatically. Allow a 100mS or so for the Item to update properly, then call yourItem.persist from a rule that runs at 23:57.

I’m not sure that will give whatever end effect it is you are trying to achieve though. There may be only the one value recorded at the end of each day … but that means the value assumed for the rest of the day beforehand will be the previous day’s value, in charting etc.

1 Like

There is a difference between what openHAB is providing to be persisted by a persistence service and what the special persistence service is doing with those values.

openHAB uses either a strategy (like everyMinute etc…) to provide a state to be persisted . This provided value will only be changed at the selected events (a chang of state within a minute will not be provided unless an everyChange strategy is used). How often the provided value is actuaaly used (stored, sampled…) by the respective persistence service is up to this service.
rrd4j always takes samples in timesteps as configured or the service (sample rate). These timesteps are completly seperated from the openHAB strategies.

In other words the plan from @oppo1967p is not possible.