1) Give a description of the problem
Here is my current piston. It works, but I need to make it better. I have a few improvements I would like to make. I just don’t know where to begin and I certainly don’t know how to do it effectively.
2) What is the expected behavior?
First off, I would like to build a string based on various conditions before passing as a push message. For example, “Front Door has been unlocked.” or “Side Door has been unlocked by Frank’s user code.” When I add the locking messages in, I want it to say things like “Back Door locked (Side Door, Front Door still unlocked).” or “Front Door locked (All doors now locked).” or “Front Door, Side Door locked (Back Door still unlocked w/ timeout).”
So one of my first hurdles has been that $args.usedCode is either null to represent that it was unlocked by the deadbolt or via SmartThings, or 0-32 where 0 is the programing code and 1-32 are user codes. How do I assemble an if statement based on $args.usedCode to detect these values and then use the value to look up a list of strings representing names assigned to the user code numbers?
As a nice to have, is there a way to capture multiple device events to achieve my last message request so that if a command to lock all doors is done, it will respond in that manner?
3) What is happening/not happening?
Just don’t know where to begin.
**4) Post a Green Snapshot of the piston