Smart sensing systems suffer complexity requiring interface circuits, microcontrollers, switches, and actuators to detect and sense, process the signal and take a decision, and trigger an action upon demand. This increases the device footprint and boosts significantly the power required to actuate the system. Here, we present a hybrid sensor and switch device, which is capable of accurately measuring gas concentration and perform switching when the concentration exceeds specific (safe) threshold. The device is based on a clamped-clamped microbeam coated with metal-organic frameworks (MOFs). Using the electrostatic harmonic voltage, we employ dynamic multi-modal actuation in which the microbeam is simultaneously excited at the first mode of vibration, near the pull-in band, and at the third mode. We demonstrate experimentally the effectiveness of this technique in measuring the concentration of water vapor and achieving switching when the concentration exceeds a threshold value. In contrast to the first mode operation, we show that monitoring the third mode enhances sensitivity, improves accuracy, and lowers the sensor sensitivity to noise.