(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 app from the above (raw link: https://raw.githubusercontent.com/RMoRobert/Hubitat/master/apps/DeviceActivityCheck/DeviceActivityCheck2.groovy) to "Apps Code." Or, find it in Hubitat Package Manager.
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:
- 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).
- 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.
- 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.
- 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.
- 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
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:
- 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.
- 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.
- 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.
- 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.