TommySharp
(Tommy Sharp)
April 13, 2017, 11:28am
1
Currently I have a few sensors and I have individual rules for each to populate a separate LastUpdated item for each item.
What I’m looking for is a way to just put all my sensors into a special “LastUpdated” group and then get notified by some sort of alert when one of those items has not been updated after x hours.
Can anyone comment if this is possible?
No one got any bright ideas on this?
pahansen
(Paul Hansen)
May 30, 2017, 11:50pm
3
Perhaps this might be somewhere to start?
Please see Design Pattern: What is a Design Pattern and How Do I Use Them for how to read and use DPs.
Problem Statement
Often one will have a number of separate Items which are all related to each other in some way. For example, one might have a Contact on a door and a DateTime to represent when the last time the door was opened. This is easy enough to keep track of if there are only one or two such Items, but if one has a lot of similar Items or is using a lot of generically coded rules where…
You’d have to extend the rule to compare the filtered lastUpdate items with a current DateTime item (NTP?) Maybe something from here would help with that part of the rule.
One small point: A DateTime item in openHAB is not at all the same thing as a DateTime object from org.joda.time. They unfortunately share the same name, but they aren’t actually related.
A DateTime item in openHAB usually has a state of class DateTimeType. When you have a DateTimeType, you can reference its java.util.Calendar member using .calendar in a rule. Then you can access this calendar’s properties, such as .timeInMillis. Then you can use that returned long to create or modify org.…
rlkoshak
(Rich Koshak)
May 31, 2017, 2:17am
4
In addition to @pahansen ’s links, I’ll include:
There is now a Rule Template on the marketplace to implement this for you. See below for instructions on how to set it up.
Please see Design Pattern: What is a Design Pattern and How Do I Use Them for a description of what Design Patterns are and how to use them.
Problem Statement
Many sensors report status to openHAB periodically (e.g. temperature sensor) or unpredictably (e.g. motion sensors) and a subset of these sensors do not have a built in way for openHAB to query whether or not they a…
Pay particular attention to the Expire Binding version near the bottom of the first post.