Feature Request for device drivers of battery operated devices / and non responding devices

I would like to see device drivers of battery operated devices have a built in capability to monitor the device's batteries and respond if the battery goes below a certain point and / or the device has not checked in within a specified amount of time.

I know there are Apps that can monitor devices however they require additional administration.

After some more thought, I think this feature might benefit non-battery devices especially non light related devices.

John

I know you are asking about a built in capability but it is very easy to set up battery monitoring in HSM.
image

2 Likes

To be honest I haven't tried HSM for battery monitoring. However one issue I have is my devices cannot agree on how to report battery level, some voltage some %age and even the ones that support %age can't agree on how low is low. Some devices have a nice even drop in %bat as the batteries discharge, others go from 100 to off quickly.

That's why I think it best to address in the driver.

I understand even if this idea is implemented, it will start with new drivers and maybe make it back to some existing ones at a likely slow rate.

Just wondering: how would you propose this work? A driver can't send you a notification, for example--you need an app to select devices in that manner (a device can't select another device with an input). I think we'd end up with something about like Device Watchdog if we worked with the existing platform possibilities (the battery attribute and Last Activity fields are already available, for example). But this is just my mindset knowing the way things currently work, so I'm not sure if you had a particular enhancement in mind.

2 Likes

Thanks for your response :slight_smile:

No, I don't have an implementation in mind, I only know a few capabilities of a driver.

I've read many of your posts so I'm sure you're correct about requiring an app to actually create the notification. But the way I look at the goal I naturally see the setup in the driver. Perhaps others see it differently.

Just thinking out loud, could RM be used to monitor the device low battery or lack or activity if the driver initiated an event?

I think I can imagine something like what you want: on the device page, a preference or two for something like "send a notification to this notification-capable device when battery reaches x%" or "...when there has been no activity for x hours," or maybe "create new event z when battery reaches x%." As we both mentioned now, the first two would not be possible in a driver: Hubitat's device model does not give devices direct access to other devices--this is effectively an automation, which is the role of an app (and apps, of course, do allow users to choose devices as inputs). The latter would theoretically be possible, but I'd say it's unlikely--first, you'd have to either convince Hubitat to add something mandatory for all battery devices or convince both them and custom driver authors to add something if possible. Second, this information is really already all there for you to do with as you please--more below. (Side note: I'm not saying this is necessarily intuitive, just a product of the way the app vs. device model in Hubitat--and ST--works. Think of new users who just got a button device and want to start setting it up to do things from the device page. Nope, need an app!)

To answer your question on RM: battery level is a standard attribute (battery), part of a standard Hubitat device capability. It is available for use as a trigger (or condition) in Rule Machine. In fact, even custom attributes are available for use in RM (I think this was a relatively recent addition, but I know this wasn't there since the beginning), but with many stock attributes (this one included), there's an easier way to choose them than needing to resort to the "Custom Attribute" option. You could do something like:

Triggers: Device 1 battery becomes < 50% OR Device 2 battery becomes < 50%

Actions: Notify: "%device% battery is %value% percent"

This would somewhat naïvely notify you every time the a specific device's value reported a reading below a certain level. (Note that the trigger is two separate triggers, not a giant "any" trigger; they look similar but behave different.) But there's no reason to use Rule Machine here: the Notifications app can also be configured for battery devices, and it has options to only notify "once within x minutes" or "only once per day," something you could also configure in RM but is a lot easier to set up here. I've never used HSM for this purpose, but you can do so with either specific devices or the special option for all devices (this would be a "Custom Monitoring Rule" if you wanted to try). That might be the closest to what you want, but I avoid it myself because I assume it would create an HSM alert I'd have to clear (same as smoke, intrusion, etc.), and that's a little bit too much of a notification for me. Your preferences, of course, may vary.

For last device activity, this isn't a "regular" device attribute, but it is information you can see yourself in the device list, the "Device Details" section the device page, or that an app can access (if the user has selected the device somewhere within the app, per the typical Hubitat security model). This is effectively what Device Watchdog in "last activity" mode does. Device Watchdog can also monitor battery levels, but that is also something I don't do with that app, mostly because battery reports from devices are notoriously unreliable (and it's only one of multiple reasons a device may no longer work, which is really what I care about); the device no longer responding is usually a better clue for me, albeit a bit more reactive than proactive on my part. Devices that I really care about like door locks already notify me in person with a beep, and I'll find it apparent when a motion or contact sensor stops working because my lighting automations will go wonky (if Device Watchdog doesn't catch the lack of activity first). Again, your preferences may vary.

So, I guess to summarize, some of this (if I'm thinking what you are) would require Hubitat to make changes to their model, and all of it is already possible with existing native or third-party solutions. My opinion is that this is unlikely to change, and while the suggestion still stands, I'd recommend trying some of these rather than holding your breath waiting for something else given these circumstances. :slight_smile:

Wow, thank you for the lengthy explanation. :slight_smile: I learned a lot about the Hubitat model/platform(?) capability.

I understand well the comment "holding my breath". My philosophy on ideas and suggestions is... " if you think it is a good idea ask for / suggest it. If you do it may happen but if you don't it will never happen.

So I'll likely give Device Watch Dog another try. However I still think the battery / reporting should be in the driver. From what you've told me another application would be required. I see this application as a bare bones app used to select which devices to monitor and what device to announce that one of the inputs needs attention. I do not however expect it to be incorporated within any useful time frame.

Again thank you for the time you took responding to my suggestion.

John

1 Like

This is exactly what I do. I haven't had a battery fail yet as I'm new to HE. However, as a test I set a threshold to 80% (my door lock was at 70% using AA alkaline batteries) and I was notified within a few minutes. I know that Lithium can have a much quicker drop off, so I'll need to monitor those more closely.

As previously stated, HSM works fine without the additional overhead the driver redo would require. All my battery monitors are alarmed at 10% and it’s very reliable. Having a driver to notify you wouldn’t change the end result. (At least in my own opinion). I also have temp alarms set up in hsm should certain parts of the house reach 35 degrees so I can check for problems in the furnace and prevent frozen pipes. HSM is fairly simple but both power and reliable. Honestly prefer it to RM 4

This one from erocm123 is not much effort to administrate.
If adding more devices, just open and check the empty boxes.
But it does not solve getting info from devices that does not send the status, but thats logical. :slight_smile:

Link to app, just go to Apps Code, add new app and enter this link under import button:
https://raw.githubusercontent.com/erocm123/Hubitat/master/Apps/device-monitor.src/device-monitor.groovy

Give it a try but just delete if you do not like it, or do not do what you ask for. At least it is a solution to get low battery warnings you need, now. :slight_smile:
RogerThat

1 Like