From ceb7cb3d5f3d7f2155a4d28a2eae281d3cbdc871 Mon Sep 17 00:00:00 2001 From: Nikolay Vasilchuk Date: Wed, 7 Aug 2019 14:42:48 +0300 Subject: [PATCH] Warm up check --- esphome/components/mhz19/mhz19.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/esphome/components/mhz19/mhz19.cpp b/esphome/components/mhz19/mhz19.cpp index cbac28f9c7..87d310c237 100644 --- a/esphome/components/mhz19/mhz19.cpp +++ b/esphome/components/mhz19/mhz19.cpp @@ -54,6 +54,12 @@ void MHZ19Component::update() { const int temp = int(response[4]) - 40; const uint8_t status = response[5]; + if (status <= 1) { + ESP_LOGW(TAG, "MHZ19 now warming up... Status=0x%02X", status); + this->status_set_warning(); + return; + } + ESP_LOGD(TAG, "MHZ19 Received CO₂=%uppm Temperature=%d°C Status=0x%02X", ppm, temp, status); if (this->co2_sensor_ != nullptr) this->co2_sensor_->publish_state(ppm);