Include device in notification

I have a simple IF statement where if any of 6 contact sensors is open it sends a notification (pushover device). Is there a way to specify in the notification WHICH of the 6 sensors triggered the notification?

Yes. You can include %device% in the notification.

%device% will contain the name of the device that triggered the rule.

Post a screenshot of your rule if you aren’t able to set this up and I or someone else from the community will be able to help out.

2 Likes

I've tried with %device% before - just added it back in to test again. Instead of identifying the open door %device% translated to "The Alarm" - which is from the parent IF at the beginning.

You need to show the Triggers also, not just the actions.

3 Likes

May not work for your application, %device% will show what device triggered the rule. I can't think of a way to pick the open contact from your list, short of a big IF ELSEIF type construct.

2 Likes

Adding to the above, but just to be clear: this is not where it's coming from. It's coming from a trigger event. (This is one of many reasons it's helpful to share an entire rule, not just the actions to run.) Note also that if you manually hit Run Actions, you can't depend on the value of this variable being what it would be when the rule actually triggers -- this doesn't count.

As an aside, this may not quite work for your use case, but also as hinted above, there isn't an easy way to store matching devices into a string, variable, etc., in RM. I wrote a custom app for my needs that does notifications or TTS for devices in a certain state because of this:

But you can also see the rule that it replaced there -- in case you do want to try this kind of thing in RM (assuming that is what you want ... have we mentioned it's hard to tell with only the actions? :smiley: ).

4 Likes

Also, take a look at this app which will fire on mode change and do what u waant and notify you of any locks or doors open , etc.

I'll second Device status announcer. I have 36 windows and use it to determine which window is open with if raining then tell us what window is open.

2 Likes

Nailed it! This app is exactly what I needed.

For those who asked what the triggers of my HSM rule - I have a virtual switch to turn on/off HSM and I have a “bypass” switch that prevents it from turning on. If either of these “change” the rule runs. Works as desired - now that I have removed the notifier IF statement and installed status announcer.

2 Likes

Jut curious why are you trying to turn things off in HSM? Or is it for modes?

This rule is triggered by one of two virtual switches being changed. I do not like the way HSM "automatically" activates/deactivates so I have other rules that turn on/off a virtual switch used to trigger this rule that either arms or disarms HSM (among other things).

Then the one piece in this rule that had been annoying was getting a generic notification that "a door or gate is open" when I wanted a notification that says "front door is open". Adding the other app for that part appears to have solved for me.

You could use device status announcer. I use this for windows. So if it starts raining, it kicks off and tells me which of our 36 windows is open.

As for doors, this is how I handle doors left open with kids... I use a virtual switch to turn off the notification. It's very passive aggressive.