Slot 0=Code 0 is a Manual open of the door - turning the knob from the inside or using a key on the outside. I manually set slot 1 (using the lock keypad) to 1 of the default codes that came with the lock. Then all user codes are slot 2 and up and I only use the Smart Lock Guest Access smartapp to add/remove them.
My pistons always had problems with slot 0 or 1 trying to get attribute info other than the slot # even if I had a user code stored there from the SmartApp . My current piston detects which code was used in the lock and then takes specific action…lights and an a voice announcement of who came in…depending on who came in the door. But it has been so long since I wrote the piston I can’t remember exactly what the problem was. Either way…do no attempt to store your user codes in slot 0 or 1.
This is what I use to extract the data I need from the lock. I store Slot names as “name #” where # corresponds to their room. We have a hallway light in front of each room that turns on when the front door opens. So the $args.codeName gives me the first name and the room number of who unlocked the door.
Hope this helps.
This is the whole piston