I just wrote a small app for myself to replace a hard-to-edit (if devices change) rule I was previously using and figured I'd share in case anyone else has a use. The basic idea is that you can choose locks, contact sensors, and motion sensors of concern, then choose to get an announcement (TTS) and/or notification either at a specific time or when a switch turns on if any of those devices are in an "undesired" state (lock unlocked, contact open, or motion active).
(Placing link to code near top of post so it's easy to find ... read on for more information on the app)
App code can be found below (install parent and child code):
or direct raw link to:
- parent: https://raw.githubusercontent.com/RMoRobert/Hubitat/master/apps/DeviceStatusAnnouncer/DeviceStatusAnnouncerParent.groovy
- child: https://raw.githubusercontent.com/RMoRobert/Hubitat/master/apps/DeviceStatusAnnouncer/DeviceStatusAnnouncer2Child.groovy
It is also available in Hubitat Package Manager.
My particular use case for this is that I turn on a virtual "momentary" switch in Hubitat as part of a "good night" rule I run via other means. That switch then "triggers" this app, which announces if any of my locks are unlocked or any of my contact sensors are open so I can fix them before going to bed. I made the app a bit more general than this specific case in the hopes others may find it more broadly useful.
Here's a screenshot of (most of) the app:
...and for comparison, here's the rule it replaced:
As I was moving my locks between different hubs, I got tired of editing this rule and figured an app would be easier to edit (it is). Hopefully others find it useful, too! If not, I at least have a place the "documentation" link the app can point to now if anyone stumbles upon it: here.