[RELEASE] Device Activity Check - Get notifications for "inactive" devices (or view in report)

(Putting this at the top to make it easier to find...explanation of the app is below.)

This app is available on GitHub and is also available from Hubitat Package Manager:

To install, just add the parent and child apps from the above (raw link: Hubitat/apps/DeviceActivityCheck/DeviceActivityCheck3.groovy at master · RMoRobert/Hubitat · GitHub and Hubitat/apps/DeviceActivityCheck/DeviceActivityCheck3.groovy at master · RMoRobert/Hubitat · GitHub) to "Apps Code." Or, find it in Hubitat Package Manager.

NOTE: If you are upgrading from v2 (or v1), install v3 as a new app; do not overwrite the existing v2 app code.


App Description:

While there have been at least a couple apps with similar purposes, none did exactly what I was looking for, so I decided to write one to meet my own simple need: get notified daily at a specific time (or on an arbitrary schedule you could set up with a rule -- or not at all and only when you look at the report) if specific devices haven't "checked in" (generated activity) in a while. Additionally, I wanted to be able to configure different "thresholds" (inactivity timeouts) for different devices while keeping them all part of the same report/notification. A couple other methods for inclusion in a report are also available, including battery level.

Enter: Device Activity Check. Here's a screenshot with a most of the options exposed:

While there is a way to "manually" view the report or trigger the notification (which will only get sent if anything is actually "inactive" or otherwise meets the report criteria), sending an automated notification is the primary intention behind this app. However, an in-app plus local and cloud endpoints for viewing the report are also available.

Documentation:

Let me know if you have any questions, but the general idea is:

  1. Choose the devices you want to "monitor" (Device Activity Check doesn't actually "monitor" or subscribe to any of their events; instead, it evaluates the criteria at the time the report or notification is generated).
  2. Optionally, you can create multiple "groups" of devices with the "Add new group" button, which will enable you to configure different intervals (or inactivity detection methods: "Last Activity At," battery, etc.) for different sets of devices. If you only want one interval/type for all selected devices, you do not need to do this.
  3. Choose your notification device (for example, your phone/tablet with the Hubitat app or another service) for the "Send notification with list of inactive devices to this device:" field.
  4. Optionally (but you probably want this), configure a daily time at which to send the notifications. The notification will be sent only if there are inactive devices according to your criteria.
  5. Optionally, choose a switch or button device that can also "trigger" the notification to be sent, again only if there are devices to report. This is how you could automate sending reports via more complex criteria you create in a Rule Machine rule, etc., instead of relying on the app's built-in daily schedule.

Other options:

  • "Include last activity time in notifications": if configured, inactive devices will also display their last activity date/time in the notifications. Un-select this option to show only the list of devices.
  • "View current report": will show list of "inactive" devices (manual alternative to using notifications; may be useful to consult when configuring app for first time to see what devices are listed)
  • "Test Notification Now": will send notification (using the same criteria for the daily schedule or switch--only if there are inactive devices to report). May be useful for testing.
  • Advanced options: configure logging or restrict sending of notifications to only specific modes (may be useful if using the "switch" option but you want to restrict notifications at certain times).

License:

This code is licensed under the Apache 2.0 license, as seen in the code and also available online: Apache License, Version 2.0 | Apache Software Foundation

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Tips:

  1. While this app is designed to catch devices that have stopped working for some reason or other, there is generally no universal way to know when this has happened for any particular device. For "Last Activity At" evaluation, you'll need to have some idea of how long your devices normally go between event generation (or any updating of this value). If you're not sure, go longer: catching something "late" is better than never, and it's likely better than a false-positive "early" notification that you may learn to ignore.
  2. This app is probably most useful for battery-powered devices where the main cause of such issues is the battery dying. It would be rare to need to check on a mains-powered device with this app. If you have problems with such devices, especially Z-Wave or Zigbee devices, there is likely an underlying device or network/mesh problem that should be fixed instead.
  3. A "refresh" option is available if desired, but I suggest using it sparingly, if ever. Some battery-powered devices do not support refreshes; in some cases it may not generate "activity"; for those that do, it may reduce battery life if done too frequently; and in general, the suggestion to choose appropriate thresholds per tip 1 is a better idea.
  4. This app cannot instantly notify you when a device goes "offline," nor is there a good way to tell this for all devices (see point 1). Think of it as a way to periodically check in on devices that you may have some concern about (e.g., dead batteries in a sensor) -- that is how it was designed.
39 Likes
Must-have apps
How to identify disconnected Zigbee devices
Status/health of devices?
Zigbee Motion Sensor Recommendations?
Schlage lock
[Project] Device Health Status [Tuya, Aqara, Ikea, Sonoff, Lidl, ThirdReality and others]
Batteries level reading
Battery Alarm false trigger
Looking for help with Notifications App not running as expected
Sonoff Water Leak Sensor support
Can someone explain how to use the setBattery() function? (Or: How to use Device Activity Check)
Fibaro button doesn't have refresh option, battery levels are incorrect
Fibaro button doesn't have refresh option, battery levels are incorrect
Buggy devices
[DRIVER] Zooz ZAC36 Titan Water Valve Actuator
Push Notification that includes device status
Rules: Add "between time"
Generic Low Battery Alert
Struggling with Battery Reporting on Zigbee Motion Sensor – Normal or Fixable?
Battery Life and Healthcheck
Time Since Event Condition Help
I would like to get or develop a watchdog timer app
Inferring a power failure
Low Battery Alert for Window Shades
Notify using %text% or %device%
Notify using %text% or %device%
RM help needed - ZooZ MultiRelay Zen16 "Last Activity At"
RM help needed - ZooZ MultiRelay Zen16 "Last Activity At"
No indication of Konnected board being offline
[Resolved] Notifications app not creating new notifier
[DRIVER] Zooz ZEN55 DC Sensor (for Smoke/CO Alarms)
Device Activity Check Working?
Tip When Using Contact Sensors and Motion Sensors For Lighting Triggers
[Project] Device Health Status [Tuya, Aqara, Ikea, Sonoff, Lidl, ThirdReality and others]
A way check offline/online status of devices
A way check offline/online status of devices
[DRIVER] Zooz ZEN55 DC Sensor (for Smoke/CO Alarms)
Zigbee Details page
How to tell if leak sensor goes offline
Z-Wave poller doesn't list any devices
API RESTful Documentation?
[RELEASE] Device Watchdog
[Project] Device Health Status [Tuya, Aqara, Ikea, Sonoff, Lidl, ThirdReality and others]
[RELEASE] IKEA Zigbee drivers
Notification for devices going Offline, Electric, Wifi, Zigbee, & Zwave
Notification for devices going Offline, Electric, Wifi, Zigbee, & Zwave
[RELEASE] Device Watchdog
[RELEASE] Matter Advanced Bridge (limited device support)
Leak Detectors
[RELEASE] HD+ - Android Dashboard
Generic Zigbee Contact Sensor - battery change date
Maker API - what does the 'date' field represent?
[DEPRECATED] Kasa Plug, Switch, and Bulb integration
Help installing custom app
[Feature Request] Request Status Update Notification
Sensors with batteries that actually report?
Batteries for sensors
Zigbee device activity monitoring
Question about Inovell child driver changes and forum software
How to use device watchdog
[Project] Device Health Status [Tuya, Aqara, Ikea, Sonoff, Lidl, ThirdReality and others]
[DRIVER] Zooz ZEN55 DC Sensor (for Smoke/CO Alarms)
Device watchdog type app / alternatives
How about a test for "Unchanged" as well as "Changed"?
[DRIVER] Zooz ZAC36 Titan Water Valve Actuator
Battery Devices offline check
Fridge Freezer rule
Device Watchdog HPM errors
Do you replace batteries by time or as needed?
Method of reporting to Hubitat whether or not a device has power?
ZEN34 Kicking Out Battery 100% When Battery Is Low
ZEN34 Kicking Out Battery 100% When Battery Is Low
First Alert combo detector
Zigbee Repeater Not Working?
Zooz tilt sensor not reporting
Phillips hue motion sensor battery status
Autobuild a dashboard for all battery devices?
[DRIVER] Zooz ZEN55 DC Sensor (for Smoke/CO Alarms)
Tradfri outlet not responding
Help modifying an app code
All Z-Wave devices stopped working on C7
Elevation C-8 exception handling
DevicePresent capability ('Health Check' capability and 'healthStatus' attribute)
Last update vs last activity?
[RELEASE] Tile Builder - Build Beautiful Dashboards
Offline/Online in App Notifications
How to bypass a motion sensor
Question about subscribe and unsubscribe
What to use for home security?
No change in Temp Alert
Z-Wave devices not reporting battery
First Alert Zwave Smoke detector status checker
Aeotec Door/Windows Sensor 7 - presence reporting
Low Battery Notification
Plug inactive, but turned on?
DevicePresent capability ('Health Check' capability and 'healthStatus' attribute)
[RELEASE] Tuya NEO Coolcam Zigbee Water Leak Sensor
Hue Battery Sensor Reporting
Future support for Linkind water leak sensors
Create alert for last activity longer than "x" time
HE Features and Requests for 2023?
Rule to alert that any device is no longer responding?
SONOFF SNZB-04 door contact battery status
Battery Reporting
Alert for when a sensor is not reporting - need help
Save Yourself Some Money and Only Replace Your Device Batteries when They Die
What is best practice for setting triggers to account for sensors that fall off the network?
How to do Weekly Battery Reports
Repeater nightmare, a "single-point-of-failure" (Ikea TRADFRI)
Notification for battery based devices
Device health
[RELEASE] Tuya NEO Coolcam Zigbee Water Leak Sensor
Rule behavior changed after going from 2.3.0.124 to 2.3.1.137
ST to Hubitat Piston Question
Which affordable sensors (door/motion) are most stable on Hubitat?
Is there a definitive and reliable way to actively monitor devices going down?
Hard Wired (AC) Z-wave or zigbee Smoke &CO Detectors
Offline Devices - Shouldn't there be more of an indicator?
Manual Polling for Zigbee Motion Sensor Battery Strength
Method to Poll Device Batteries
[RELEASE] Idle Node Refresher
Let's talk about a set up that "self fixes"
Detect Zwave device offline
Send message when device go offline
Zigbee Contact Sensor Failing in Closed Status
How to monitor switch / dimmer to know if it has dropped off the mesh?
Non-Responding Device Polling?
Would be nice to call an URL within the Notifications app
Battery reporting incorrect on smartthings smartsense multisensor v4
Must-have apps
[PROJECT] Driver for WADWAZ-1 Contact Switch
[DRIVER] Zooz ZEN Switches Advanced (and Dimmers)
[Release] Battery Monitor 2.0
How to check for broken rules?
Inactive Device Dashboard?
Problem with %device%
Revise "battery level", starting with Generic Zigbee Shades
Any way to trigger a rule based on device "Last Activity at"?

This is a fantastic app. Exactly what I've been looking for as battery monitoring on zigbee devices is hit and miss. Good amount of customisation too!

Awesome to see you're supporting the Hubitat Package Manager - that is a real game changer with the search functionality.

Hey @bertabcd1234

I've started to see an error when triggering the report/notifcation. Here is a copy of the logs:

At present I have two groups with different periods. The only thing which has recently changed is the addition of some devices. I have removed them but the error still remains.

Any ideas?

UPDATE: A screenshot from the error within the app:

Hmm, not sure. Could you PM me (or post here if you don't care that everyone can see your device names and whatnot) a screenshot of the app status page? I mean from the cogs/gear icon in the upper right and am particularly looking for the "Settings" and "Application State" section. Thanks!

Appreciate you having a look:

I installed it through the Hubitat Package Manager so if you need me to reinstall, just let me know.

Thanks

Hmm, so it thinks there's a third group. That should display in the UI, and you should be able to click in to that and use the "Remove group" option (follow through to confirm...I made it harder than one click to do this due to some...accidents...in testing). I'll look into making it not error out on empty groups. If you don't see a group listed in the UI at all, I'm not sure why.

1 Like

That would be it, there is a Group 3 with no devices in it. I will populate or properly remove this group. Thanks for the trouble shooting!

UPDATE: Issue has been resolved - it was definitely the empty group.

1 Like

Released a small bugfix (1.0.1) to address unhandled errors if the group is "empty" (no devices selected) and also one I saw that would happen if you didn't select a notification device (though I'd recommend choosing one, but I guess if you only want to use the app for in-app reports, you don't need to).

1 Like

Hello,
So I have a pond pump powered by a Zooz Relay that consistently pops the circuit breakers. That is currently being fixed but in meantime I want to be notified when the pump goes offline; I used a rule so the relay is pinged every 5 minutes and I want to use your app to notify me when that happens. However after I set it up it does not automatically send me a notification if it is offline, I have to manually click the button for it to send. This is how your app is set up at the moment. I would greatly appreciate any help you can provide.!

This is how it is set up at the moment.
Screenshot_2020-06-28 Device Activity Check|690x431

Not sure, so I'll throw out a few ideas:

As written, that should send a notification at 9 AM. You can check the "Scheduled Jobs" section of the "App Status" (gear/cogs icon) page to see if anything is listed there. It will check only at this time, not constantly based on the selected interval if that's what you were expecting (this avoids excessive device subscriptions and whatnot). If you wanted a more freqent schedule, see below.

I also see you have the "Any time this switch is turned on" option selected with the same devices. You may have a reason for that, but that is more or less intended to be used to replace or supplement the daily scheduled check (e.g., you could use a virtual switch and a rule that turns it on multiple times a day). Selecting the same devices there seems unusual to me, as if they do in fact turn on, you already know they're responding and wouldn't need DAC to check for you.

The only other thing I can think of is that DAC looks at the "Last Activity At" field on the device page. If for some reason your devices still generate events when they're not really online, then it will mess up these checks. Most built-in Z-Wave and Zigbee devices don't do this; some community or LAN drivers may, though I personally consider that bad practice. (If you see the device in "View Current Report" or when doing "Test Notification Now," this is not the issue, at least not at that particular time.)

Hello,
I want your program to notify me when the pond pump goes on within 15 minutes or so. So I've disabled the scheduled notifications at 9 AM. Anyways I set up the rule machine to ask for a update every five minutes so it updates "Last Activity At" for that time and I asked your program to notify me every six minutes.

So I'm not supposed to select the same device for the "Or any time this switch is turned on:" section? I interpreted that part as it will send me a notification if it is offline even though it is supposed to be on.

I've tested if the device still sends events even when it lost power and it doesn't so it isn't that.
-Thanks

The "or any time this switch is turned on " option is to supplement (or replace) the time-based check. Devices you actually want to check do not belong there. In your case, I'd create a virtual switch and have a rule that turns that switch on every so often (and then back off), which will "trigger" my app to perform a check. You wouldn't need to fill in a time.

It also sounds like you might be wanting this app to work sort of backwards: it notifies you if a device has not had activity within the specified time. This is to assist users with finding devices that aren't responding, possibly due to network or device problems. If you just want to be notified every time a switch turns on, Rule Machine and probably even the Notifications app (both built in) could handle that.

Oh I see I think I will try creating a virtual switch then.

Yeah sorry maybe I'm not being clear enough. I do want your app to notify me when the device has not had activity within the time period, this being five minutes. There is no switch turning on at all, the pump is supposed to stay on 24/7 (except for brief moments) but the circuit breaker keeps on popping and the device loses power and I want to be notified when that happens so I can reset the breaker.

Update: I've released version 1.2, which adds:

  • ability to ignore disabled devices, which are now excluded by default (since they are certainly not going to be generating any activity on the hub as far as the driver is concerned) -- I actually meant to release a 1.1 version with this feature but apparently kept it to myself :slight_smile:
  • ability to monitor devices/drivers that use the "presence" attribute as a self-monitored proxy for online/offline status instead of "Last Activity At" data, as a few popular community drivers have started doing

As before, available on the GitHub links in the first post or Hubitat Package Manager.

Hi @bertabcd1234

I recently found your "Activity Check" app and it definitely fits the bill. Thank you for sharing.

I do have a question though; Is there a way to perform a Hubitat action for a notification. A low battery on a temperature sensor is not something I want to generate a Twilio message?

I mostly use one of two methods of notification:

  1. Inovelli Color bulb (yellow = take a look, Orange = Take a look quickly, Red = too late go fix it) :slight_smile:

  2. Pretty much the same as 1 but I use a Inovelli Red dimmer LED strip.

I would not like to do away with the ability to send a Twilio notification but I will likely not use it for the current batch of battery operated sensors.

Thanks
John

1 Like

Hmm, directly there isn't, but I suppose I could add a "turn on this switch if there's something in the report" option, which you could then use with RM or any app of your choice to do whatever action you really want.

1 Like

That would be great. I don't think such an addition would cause the app to be over complex. One of the reasons I like your app so much is the simplicity.

Thanks for the app!

I second this - it would be very useful for making visual notifications.

It is grate update, but before this update,
I got pushed messages without the child app name on it.

Now I have no idea how to get the push notification without the child app name on it.
Please help
Thanks

The notification has always included the child app name (ever since I publicly released the app as version 1.0), so nothing would have changed with that recently. There is an option to also include the hub name. This is under "Advanced Options":

"Include hub name in reports"

Maybe you inadvertently checked this box and are noticing that change? If so, unchecking it should address the issue.