Access device inputs from app

You can look for something similar implemented in the Tuya Zigbee Multi-Sensor 4 In 1 driver - the SetPar() command. It accepts 2 parameters- the first one is the preference name and the second is the preference new value. The implementation is not the clearest one, but may give you some ideas.