Which version of the SmartThings app are you using: Smartthings classic or “smartthings (Samsung connect)”?
Also, I can’t read code, but look at the DTH and see if it sets the number of buttons value. See the following thread for discussion of this issue.