Grab the code from here: https://github.com/a4refillpad/Xiaomi/tree/master/devicetypes/a4refillpad/xiaomi-zigbee-button.src
Then read through this: FAQ: An Overview of Using Custom Code in SmartThings
Grab the code from here: https://github.com/a4refillpad/Xiaomi/tree/master/devicetypes/a4refillpad/xiaomi-zigbee-button.src
Then read through this: FAQ: An Overview of Using Custom Code in SmartThings