heya,
thanks for your answer! Before diving into your reply I think I need to expand a little here:
When I started using openhab a couple months ago, I started with tracking some wireless temperature sensing devices. In my naive thinking as an absolute newbie to the project I simply assumed the following would occur when there was a communication problem with the device (poor signal, no battery, MQTT down, etc…):
(chart 1)
but instead what happened was this:
(chart 2)
So I was a little surprised, as OK this zig zagging on a multi-hour basis can be spotted but this did not appear like the expected way of handling this in my view.
So then I started googling and found about an expire binding, that seemed to do what I initially had in mind: If I know the device usually pings me in 10 secs intervals, put a 1 min expiration timer that nulls the values after that time signifiying that there seems to be a problem.
But this seems to have 2 problems:
a) in the charting this does not appear to make any difference. In my experience the chart above would look exactly the same as chart 2, as the null values are simply skipped and the last 2 known values are “glued” together by simply drawing a linear connection between the two.
b) the expire binding seems to have been deprecated because I cannot find it in OH4 documentation. Instead the only things I can find is to clone every item with a +“_last” sibling and record the last Update into this item whenever there is an update and then additionally create a rule that checks if the +“_last” value is too old and then setting the original item to NULL.
So here I am wondering two things:
a) Am I totally misunderstanding OH4 and I just need to put a checkbox somewhere and everything works as I would assume it works?
b) If not, I really wonder why that decision to leave out a handling of an “offline/expired” state was made? Shouldn’t that appeal to a large audience?
OK so now with this questions out and maybe someone is kind enough to help me get on track, I still would like to answer @rlkoshak:
Yea charting a datetime doesn’t really make sense, that’s why I suggested graphing an expression like “now().TotalSeconds-value.TotalSeconds” instead. This should like this:
(chart 3)
and in the case of outages would look like this:
(chart 4)
(sorry for my crude drawing)
and lastly, one could probably overlay my first chart with @rlkoshak’s solution with just another on/off item with a markArea like this:
(chart 5)
to show the offline parts.
So I am really curious to the replies to this! Many thanks in advance!
EDIT: bleh sorry it seems like I can only upload one picture. So all charts combined here: