It helps to remember and think about OH as an event driven system. What you are looking for is something to happen if you don’t hear from a device after a certain amount of time. That’s much easier to approach than trying to approach it the way you describe messing with stored timestamps and such.
You can do the following:
- Link the Channel to an Item
- Set Expire on the Item to set it to NULL or UNDEF when it doesn’t receive an update for a given amount of time. The rule-of-thumb is to be at least twice the typical update period so if it updates every 30 seconds, set the expire to a minute.
- Create a rule that triggers when that Item changes to NULL/UNDEF to send your alert.
The rule will trigger when there has been no update from the device for too long of a period.
There are other approaches too. See Design Patterns: Generic Is Alive for more.