Add button function for controlling devices.