@bravenel
Bruce,
I noticed something interesting today about a simple RM rule I have for monitoring doors that have been left open for too long. I have attached an image of the rule below. In it, you can see that if any of three doors are left open for at least 10 minutes, a notification is sent. That notification is configured to include the name of the device as part of the message. This works as written, but I did notice an interesting behavior.
If the "Back Door" is opened, and left open for 10 minutes, I get notified that the "Back Door" was left open. This is the 'normal situation' and works as I would expect.
However, if the "Back Door" is opened, and then the "Kitchen Door" is opened, and then the "Back Door" is closed... 10 minutes later I get a message that the "Back Door" was left open (even though it is the "Kitchen Door" that is still causing the rule to be true, not the "Back Door".) So, it appears that the 'device' is captured on the initial Truth of the rule, not when the delay expires. This makes sense, however it does lead to a little confusion as to which door is actually still open.
Of course, this is easily fixed by simply adding a rule for each door. I just thought it might be interesting to think about if there was an easy solution to prevent others from getting confused as well. I guess RM could just keep track of the last device that makes the rule true, instead of the first...but that may not give the desired result in all cases either.
I'm not claiming this is a bug... Rather, it is something to be aware of. Thoughts?
Thanks,
Dan
What happens is that the last device that causes a rule evaluation to occur, irrespective of the rule outcome, is captured and then used for [device]. So in your case that last device is actually the Back Door closing. I'll scratch my head tomorrow about possibly changing that, but it's tricky to figure out.
I have a similar rule that I use to send me a text if we leave and one of our garage doors is left open. I think I've seen it report the wrong door, probably for a similar reason as yours.
The solution may lie in using a trigger instead of a rule (which might require two rules). The reason I say that is that a condition of a rule, like in your example, is hit with every event for the devices, so it can detect the change from true to false for the condition. But a trigger is only looking for the specific event.
This sort of thing is too messy in RM. Maybe it should be a custom HSM sort of thing, as it fits that context better.
1 Like
Hubitat Safety Monitor has a Custom Monitoring Rule just for this use case. Check it out. It reports your scenario correctly.
2 Likes
I remember trying this in HSM but couldn’t get the device to report correctly. Will try this again.
I just tried to set this up in HSM again and it reminded me that the issue with the device names was not my issue in HSM . The issue was that there was no notification option, only text message,etc.
The device name issue occurred in RM for me as well so I ended up making separate rules for each door.
Bruce,
Thanks for the explanation. As @stephack mentioned, HSM does not currently allow notifications to custom devices, like Pushover. The current 10 SMS per day limit is a little too constraining. Perhaps a future enhancement to HSM to add custom notifications?
Dan
1 Like
This will be in the next release.
3 Likes