No custom code works in the new SmartThings (Samsung Connect) app at this point. It is best to use the SmartThings Classic app.