Create alert for last activity longer than "x" time

Has anyone figured out how to create an alert based on a devices (actually all of my water sensors) last activity after a set period?

See attached, I have HSM notify me when battery device statuses drop below 25%. This works well, accept that lithium batteries (from my reading) and there percentages aren't exact and always predictable. I have a device that I think dropped off a while ago.

I think this is why I maybe didn't get a notification as the battery in hubitat still reads 37%. Of course I could adjust the threshold from 25% up, but I'd like another redundancy for a device check in. Ideally a rule that looked at last activity over all the water sensors and let me set the time between a check in and what the rule is looking for.

The rule would say if no check in from device after 3 days from last activity notify my phone.

Thanks in advance.

It's a little tricky to detect last activity from a sensor within a rule but you can check for the elapsed time since a specific type of event, like motion. That might work for your needs. Or you can use an app like Device Watchdog to monitor last activity and post the results to a dashboard tile.

Highly recommend this app: [RELEASE] Device Activity Check - Get notifications for "inactive" devices

I have nearly all my devices setup in here, even light switches (in case they lock up).

I have the sensors set to a 14hr limit since they typically check in every 6-12 hours, and switches and other devices on 24hrs.

You can also do the battery alerts in this app and have it all in one place.


I also recommend the Device Activity Check.
One point though:
Use that app on the "original" hub that the device comes from, not a "mesh" hub.
The mesh hub copy of that device will have a bunch of events "HubMesh Disabled" - which would screw up your device activity checking.

Download the Hubitat app