This piston backs up a smart lighting routine. In the link below to the project, you can see I have a door set up to function like an access control system. The power is controlled by a plain zwave switch. The smart letting routine turns the switch on anytime the switch is turned off. Do I understand the project feel free to go over and watch the video.
Point is, this piston is set up to back up the smart lighting routine shouldn’t feel which occasionally does. This watches for the switch to be off, and turns it back on if it is left off. It also sends a notification every time that happens so I’m aware when smart lighting is failing, and it updates the piston state. Also the piston state formatting can be seen to bolt the text, in this case change it Green as well. Hopefully this proves to be a clean example of various functionality
Original project on SmartThings community forms: