The objective is to receive a Notification (email or text) when a SharpTools User presses a Switch on a Shared Dashboard, and include the name of the User that pressed the Switch.
I was able to create a Notification Rule that triggers when a SmartThings Switch transitions to ON, then sends an SMS Text.
Ideally, I’d like to trigger it based upon when a User actually presses a Switch on the Dashboard (rather than triggering off the SmartThings Device).
In either case, I’d like to include the SharpTools User Name in the Notification.
There’s a Context Variable available that would tell you which user executed a Rule Tile on a dashboard, but they would have to directly execute the rule.
There is not a context variable available for device events as those are generated by your smart home hub and don’t have the context of where the event / action originated from.
The approach I mentioned in my previous reply could work for that. Instead of controlling the device or alarm directly, you would have a rule perform the action, then add the rule to the dashboard instead of the device/alarm.
In this example, I don’t have anything in the Triggers section since the rule will only be executed manually from a dashboard. Then I would just add this rule to my dashboard as a tile and anytime it is tapped, it would perform the Disarm action and send the notification with who tapped the tile.
With your wonderful example and further explanation, I was able to set up a Test Tile to run a Test Rule… to trigger the device… to send a notification including the user’s name.
I can certainly see cases where that would be helpful and make sense.
Please bear with me on this one as my programming experience is just a fraction of yours …
In using this Rule Method, for say 10 Dashboard Tiles:
I would have to Create 10 Individual Rules for Each Device/Tile where I would want this User Notification, then create 10 Individual Tiles calling each of those rules. Of course, if I want this notification on more Tiles/Devices, it becomes even more cumbersome. A minor point is that pressing the Rule Tile results in the Green Pop-Up “Executing Rule”, rather than the “Command Sent” Pop-Up.
Whereas if I could Trigger a Rule from any Dashboard “Tile”, I could create one rule referencing any/all 10 “Tiles” as the Trigger, then pass the TileName and User DisplayName with the Notification. As well, the Green Pop-Up would continue as “Command Sent”.
Any way… just a thought for a possible Feature in the future.
If I’m reading between the lines a bit, it sounds like you want to know who controls a device, is that right? Can you expand more on what you would do with that, exactly what type of information you would be looking for, and why would you need that information in a rule?
I’m struggling to read between the lines much further as to what problem we are trying to solve.
When I’m operating my own SmartThings App, I know what I’m turning on, off, etc at any given time and why I did it. But when sharing with multiple Users through SharpTools, I don’t have a sense of who is doing what, at what times, and how those actions may conflict with other User’s actions/expectations. Having this information will help me better assess my systems, solve problems, and help guide Users in terms of using a SharpTools Dashboard.
Here’s One Example:
User A turns on the Living Room Fireplace at 6am in the morning, expecting it to be on and warming the room before coming down at 6:30am.
In the meantime, User B intentionally (or unintentionally) turns off the fireplace at 6:05am
User A enters the Living Room at 6:30am and is like… What happened, I could have swore I turned on the fireplace?
User A says to me: I thought I turned on the fireplace. Why isn’t it working? I was freezing!!! Your system doesn’t work!
With this information, I could go to User B and ask, did you mean to turn off the fireplace? To which they might say either: Yes, here’s why… or oops, I didn’t mean to do that, I was trying to do X instead.
From there, I can help them both use the system better.
Without this information, I have no idea who did what and when and why the fireplace was off when it was expected to be on.
With only two Users in the example above, perhaps a simple conversation would solve it. Now give me 5 Users and it becomes more difficult to figure out. With this information, I can see a much clearer picture of the User interactions.
I can imagine more scenarios in which having the “who triggered what” information would be helpful in solving problems
Thanks for the examples. As I was reading through that, it sounded like wanting to refer to a log of user actions rather than a use-case around needing it in rules. Would having some sort of user actions log cover the need?
You’re welcome! And thank YOU for your infinite patience
I was thinking in terms of real time notifications, drawing my attention to things as they’re happening well, in real time Things like Armed Away, Armed Stay, Disarmed… “seeing” that User A came home and Disarmed the Alarm, or Armed Away while User B was still there, etc. I think the flexibility in any Tile becoming a trigger would open up a lot of possibilities, and less Rule writing.
That being said, the log idea is interesting!
If it already exists, I would love to take a look at it.