Unchanged values are not logged

  • Platform information:
    • Hardware: RPI 3-B
    • OS: Openhabian
    • Java Runtime Environment: standard

Hello All,

This is my first post her as I recently started in the wonderful world of OH.

I first installed OH on a RPI using the repository. Afterwards I started a new installation on a stand-alone RPI with Openhabian (I like this experience certainly better). Everything was working fine, after a while I switched over to InfluxDB to play with Grafana.
From that point my channels/graphs (in OH it self) don’t display unchanged values any more.

So for example I log my memory usage (Systeminfo-binding) this works fine when the usage change often, then i see all values in a graph. When the memory usage stays unchanged for 5 hours i don’t see any line on my graph for the last hours. when it changes after several hours this new value is plotted and a diagonal line connects the old and new value. But there is no value from 2 hours ago.

This same effect I also see on a power meter. If this plug is turned off i only get one zero watt value then when i turn it back on I get one 1300watt value. (see picture of 3 days loging)

I never saw this effect when i used the RRD4j database. Is there something i’m missing here?

Maybe.
The built-in OH3 charting relies on whatever the system setting “default persistence”
points to. If you have retained rrd4j as well as influxdb, you might choose to keep that pointing to rrd4j.

But after you’ve decided which database you want to use, the next thing to look at would be when/what you have asked it to store for you.
If you are relying on a default persistence selection, it may not be the same strategies for rrd4j and influxdb.

There is a difference between When openhab persists a value (on every change, every Update or every x-minutes…) and at which timesteps the persistence binding stored those persisted values into the database.
rrd4j in the present default config does the later every 10 seconds.
Viewing the posted chart it looks to me as if openHAB does persist every change and the persistence binding stores only this value.

Merry Christmas everybody!

Thx for the explanations.
I now understand the standard configurations for rrd4j and influxdb are not the same out of the box (feels a bit strange to me, but okay) and this caused my issue.

I started playing with an “influxdb.persist” file and now it is recording nicely.

In the beginning i had some difficulties understanding the CRON syntax.
I used a linux cron in the past but that doesn’t have a character for seconds. So my first tries i was recording every second instead of every minute.

As example some strategies ( for other people that are as stupid as me):

  • everySecond : "* * * * * ? " // Record every second
  • everyMinute : "0 * * * * ? " // Record every minute
  • every2Minute : "0 */2 * * * ? " // record every 2 minutes
1 Like

Hi,

thx for starting this discussion. I have also installed OH3 on RaspPi4 (Openhabian latest build) and installed Influx and Grafana (out of the openhabian-config menu). Worked perfectly fine:)

Here is my first panel/dashboard. I have a similar issue. If you look on the data you see that the timestamps are not aligned. The data is from HUE motion sensors and from Netatmo temp sensors.

What is a proper persistance rule to get the data whenever the sensors provide them? If I fix it to “every minute” I dont know whether HUE and Netatmo provide information…

Sorry for those simple questions…could not find simple tutorial or doc where this is explained…

br
Alex


Why do expect or want to have all data with the same timestamp. Shouldn’t each Individual device report any change immediately? Using a “everyChange” strategy would fit such.

thx for your reply. good point. hmmm, the data that is reported in my graph looks strange tough. I cant believe that the values change so seldomly on all those sensors…I have the feeling that there is something wrong…

I would be concerned only if there was a “big” change with no datapoint in between and the time-difference is rather large. The “normal” timestamp between readings can be seen when there is a slow change.
Looking at the posted chart I don’t see a problem.

You could find out? There doesn’t seem to be much point in frequently recording data, if the sensors do not supply it very often

Looking in your events.log will show you when your sensor Items change.

They may in addition be giving you updates more often than that - update-to-same value are not shown in events.log.
If you want to find out about those, you can capture with a little rule.

rule "update check"
when
   Item mySensor received update
then
   logInfo("update", mySensor.name + " updated to " + mySensor.state)
end
1 Like