First off, great work on the Hubitat and it's many features. It's been performing admirably so far.
I think already found the issue and I wanted to document it to bring it to the developer's attention so that they can take a look and hopefully make an update. And hopefully this issue isn't the same with the other rule triggers.
I have an RM4 rule setup to alert me whenever any of my battery powered sensors reports anything under 15%. In this rule there are over a dozen sensors and a push notification sent to my phone listing what %device% reported the low battery. Some of my sensors were already below that threshold already when I created the rule. It appears that the Rule doesn't get called until a sensor actually reports a battery level. So what happened was that my door lock was the first thing to report a level and it was at 71, which is obviously above the threshold, but it still triggered the RM event and sent a notification to my phone with the lock being the device that reported low battery. After thinking I screwed up the Rule and double, double checking how it's setup I realized that what may be happening is that the lock battery report called the rule, the rule resulted in a 'true' condition because other sensors were already below that level. Then the %device% sent in the notification happened to be the device that called the rule and not the sensor that actually created the 'true' condition.
This is how I was able to prove it out; I forced a refresh from my lock, battery came back above 15% and I still got a notification with my lock as the low battery device. I repeated this twice with the same result. I then removed the 2 sensors from the rule that were already below that level and repeated the test, this time no notification. Put the 2 sensors back in and the bad notification returned. I replaced all the low batteries and repeated the test and did not receive any notification.
I think that this scenario will result in many, many unneeded notifications, in my case, if a sensor reports back less the 15% I'll get a notification, great. But... every subsequent battery level report from every other sensor will also trigger another notification. And since the %device% listed in the notification it is the device that calls the rule and not the one that satisfies the trigger I'll get a notification that every sensor has a low battery.
Please take a look and let me know what you find and if my assertions are accurate or I have something else screwed up.
PS battery reporting on many devices is poor at best, mostly due to lithium's discharge curve, which is charged-> dead, no gradual decline like alkaline or lead. In the last ~4 years, out of changing over 100 batteries, I'd say I have received maybe 15% accurate reports, between 2 years on ST and almost 2 on HE.
(it's Mark, actually)
Yea, I saw that app, too. I'm just converting from ST to HE so I'm starting simple. (Believe me, I lived batteries for 2 decades and I know much more than I care to about them.) In any event, yea, I know that LI battery monitoring is a challenge. I'll probably change over to this app later, I'm more concerned about how RM4 reacts to this trigger situation and wanted to bring it to Hubitat's attention.
@wecoyote5 I would think of creating a rule for each device so that these issues go away. It’s not that much work, and you can have different messages for each device, such as URGENT! Siren Battery Low! for a battery siren but have it say thermostat battery low for a thermostat.
When I started this rule 2 out of those sensors were at 12% 161 and B40. My lock (150) was the first to report a level of 71 and I still got a notification that 150 is reporting low battery.
You can read the rest of my debug steps above.
Actually I was using the logs when this was happening and remember the gist of them. The order if I recall correctly was '150 Battery at 71'...'Battery Check: 150 Battery 71'...'Action: Notify Phone_Mark....'
Now all the logging options are checked and I'll see if I can re-create when I get a chance.
I realize you are reporting this mostly as a RM issue, and appreciate you for doing it. I just wanted to mention that you can look in the events on the device page and see how often a device is reporting its battery %. I stopped trying to get battery notifications on most of my button controllers once I discovered that many of mine only report when initially joined. They still say 100% after they have died and fallen off the mesh. My motion and contact sensors are much more reliable at reporting, but use CR2 and AA batteries. It all depends upon the device's reporting interval. Also, I have never seen anything below 30% in a functioning device using lithium batteries.
I know battery reporting is flakey at best (not an HE/RM issue for sure). My concern was why the 'action' was still taking place even though the device calling the rule wasn't the reason for the 'trigger' to be satisfied. I hoping it's something I did as I'm new to the HE setup, but the debugging effort has led me down the road to where I need the assistance of the RM guy.
I just upped the threshold to 40 which put 2 of my sensors below. I then refreshed the battery level from the lock, 150 and I received a notification that 150 have a low battery. Here is the log...
dev:12020-08-05 07:00:56.396 pm infoMessage:[150 Has Reported Low Battery], was sent to Phone_Monica
OK, I see the problem. It is looking at all of the lock battery values when triggered, not just the one that triggers it. So, it's finding one that is below the value, and then reporting that with the device that sent the battery event. Will dig into fixing that.