Firstly, I understand that monitoring batteries for most devices is an exercise in frustration. I wrote this rule prior to finding this out and learning about Device Activity Check. My question concerns creating a rule that does what I intended. If the battery level for a device is <= 40, then I want to receive a notification to that effect for any devices <= 40%. The problem is, the front door lock is now at 40% which triggered the rule. But the ONLY device it will report is the Porch Motion Sensor battery which is at 100%.
What do I need to do to report any devices that are <= 40%?
Thanks. I figured out how to add the "OR" logic. But I'm still stuck. Even though the Front Door Lock is the only device at 40%, I'm still getting notifications for devices at 100%. I'm trying to get a handle on creating this logic in Rule Machine for other purposes.
I had (have) a similar issue with a similar rule. One of about five sensors had a low battery but Iād get the notification as if it were from one of the sensors where the battery was at a normal level. It continued daily reporting different sensors until I replaced the correct battery.
It seemed that using %device% was populating the last device from those included as triggers that reported anything, rather than the one that actually sent the low battery that triggered the rule.
I never bothered to diagnose the problem at the time. It might be possible to replicate it by adding one virtual motion sensor in with the others and altering its battery level (though Iām not sure whether a virtual motion sensor has the battery level attribute?)
I think this is essentially what I interpret as happening, based on what has been explained previously. As I understand it each of the battery sensors selected will "trigger" the rule by reporting an updated battery percentage, then the rule will assess if any of the devices selected satisfy the condition defined. So for example, sensors A, B and C are selected as being "any under X%".... Battery A drops below X and the rule reports this when it happens, as would be expected. Battery B then reports a percentage, above or below X, triggering the rule to check sensors A, B and C, noticing that A is still below X, so sends the notification again, but references device B since it triggered the rule.
I could be wrong in this understanding. But would make sense to me and why separating the sensors out into separate trigger or even separate rules, or using an alternate monitoring app or approach would make more sense.
Yes, this is correct. It has nothing to do with %device% per se; it's just a consequence of the fact that this variable gets set to the name of the triggering device (and that is what happened).
It should be noted that Device Activity Check, which the OP has already explored, can also look at battery level. It seems they are just interested in this rule behavior.
Well, I did add the "OR" operators to the trigger. Then I deleted the trigger and for the life of me I am unable to add these OR operators again! Can someone show me how to enter events using using OR logic?
You don't explicitly add "OR" between trigger events. That's just the UI's way of saying that any matching trigger event will cause the rule to trigger: event 1 happening or event 2 happening orā¦. (You can't put trigger events together with any logic because they are events, not states, and events do not have truth values -- they just happen. See: Rule 5.1 | Hubitat Documentation for more.)
If the screenshot above is you current rule, that's exactly what you're looking for. If not, you just need to add one trigger event for each device, as mentioned above.
Separate to the suggested solutions and reading....
It is worth noting that, if only for others that may come across this discussion... this general space in automation, being the interplay between triggers, conditions and actions, can be something that some people do genuinely struggle to grasp, if only in part. I'm not suggesting this is entirely true for you @zbernie123 , but I do think it is worth pointing out to people that it is not uncommon to struggle with some of these concepts, and that discussions like this are an example of how to engage with others in the Community and learn from others.
So, asking questions, being curious, reading the documentation and pointing out areas of confusion (in a constructive manor), all help.
Don't worry, I feel as uncomfortable as anyone with these types of posts... But I keep posting them... Let's get back to solving problems...
I haven't seen anything about your issues with Geofencing, at least in your list of topics recently posted, but I'm sure you will find people happy to help you in that space as well.
Can someone explain to me why the local variable %device% is being assigned "Water Sensor - Master Bath Vanity", a device that is not included in this rule?
This is not about battery monitoring per se, I'm just trying to understand this logic.