I have multiple temperature sensors linked to items and from time to time, their battery runs out. Because I’m not regularly looking at the system, it may happen that hours pass between the last valid point and the new value when I have changed the batteries.
In the analyze graph, this leads to this kind of “flat line” effect:
I believe it is still there, the value is simply not updated. I mean it comes from a binding that reads wireless data coming through. If it reads a packet for a given sensor it updates the temperature value, but it does not have any “timeout” between values before setting it to null.
Well, this shows my lack of knowledge in openHAB, I don’t understand where to find this setting.
I did find this page but I’m not sure this is applying to my use case here.
Set an expire on each Item, for 2-3 times the usual reporting period. Have expire set state to 0 or 0°C or -100°C or whatever is appropriate for your visual need. You’d normally set UNDEF for situations like this, but UNDEF will not get persisted, and even if it did you can’t plot UNDEF so the charting would still fill in the gaps.
The only way to reproduce “no line at all” would be to delete all persistence data at the moment of failure, you probably don’t want to do that.
Ok, I understand the idea behind using a “weird” value, even if it means it will have the sharp fall to that -100 for instance. And the cards in the overview page may not scale well.
I can live with that, but can you tell me how to set an expire on an item? I looked through the UI and could not find it. The page I mentioned is talking about scripts, but it did not seem that obvious to me that this could be the explanation I’m looking for.
That’s too bad, I find it nice to have a “hole” when no data has come in for a long amount of time. Do you think I should create a feature request for this?
I’m curious to see how that works with real persisted data? Foresee a problem because we don’t persist “nulls”, by design. Some databases would just have no available data for periods; rrd4j can have NaN values internally in its time series pigeonholes … but you can’t retrieve those. The persistence service assumes the last known “good” value still holds true.
Thanks, I did open that menu but did not register the existence of that item. It now works just fine.
Thanks, I just discovered what that “Save” button does.
I added the option like this:
Well, I tried leaving the value unset for the expiration timer, which gave a nice “UNDEF” value on the card in the overview. In a later experiment, I tried forcing it to “NULL”, which appeared in the same place as well.
The analyze view however, does not seem to care:
But that was expected as Analyze is quite limited. But as you hinted, the option for graphs did not change anything either, there is not hole in the graph itself.
That’s too bad, I’ll have to resort to the “out of place value” trick then.