A device for diagnosing the ventilatory efficacy of a patient under respiratory assistance, said device being intended to cooperate with a system for ventilating the patient, the device having: a bidirectional thermal mass sensor for measuring, in real time, the air flows during insufflation and during exhalation, an electronic casing connected to said sensor and configured to receive and process data relating to the air flows measured by the sensor, the electronic casing having: i. a user interface comprising a display device and data input means, ii. a data-processing center, the data-processing center functioning according to programmed algorithms for acquiring, processing and displaying the data, for analyzing the efficacy of the ventilation in real time, and for managing alarms, and iii. means for supplying electricity.