Prolonged hospitalization has many consequences, including loss of autonomy and nosocomial infection. Moreover, these complications themselves lead to an extension of the length of stay. This has an impact on the cost of care: several studies have shown that hospitalization is the most costly factor in the management of pneumonia, and that even a small amount of hospital stay, led to significant financial savings. Automated oxygen therapy is a device that automatically adjusts with the saturation the amount of oxygen administered. Investigator hypothesis is that automated oxygen therapy could shorten the length of stay of patients hospitalized for hypoxemic pneumonia. One group of patients will receive the automated oxygen therapy and the other group will receive the standard Oxygen therapy. The investigator will compare in each group the average length of stay, the duration of oxygen therapy, the time spent outside of the target saturation, the cost on the medical-economic level and the patient's experience.