23 ESP_LOGCONFIG(TAG,
"PMSX003:");
24 LOG_SENSOR(
" ",
"PM1.0STD", this->pm_1_0_std_sensor_);
25 LOG_SENSOR(
" ",
"PM2.5STD", this->pm_2_5_std_sensor_);
26 LOG_SENSOR(
" ",
"PM10.0STD", this->pm_10_0_std_sensor_);
28 LOG_SENSOR(
" ",
"PM1.0", this->pm_1_0_sensor_);
29 LOG_SENSOR(
" ",
"PM2.5", this->pm_2_5_sensor_);
30 LOG_SENSOR(
" ",
"PM10.0", this->pm_10_0_sensor_);
32 LOG_SENSOR(
" ",
"PM0.3um", this->pm_particles_03um_sensor_);
33 LOG_SENSOR(
" ",
"PM0.5um", this->pm_particles_05um_sensor_);
34 LOG_SENSOR(
" ",
"PM1.0um", this->pm_particles_10um_sensor_);
35 LOG_SENSOR(
" ",
"PM2.5um", this->pm_particles_25um_sensor_);
36 LOG_SENSOR(
" ",
"PM5.0um", this->pm_particles_50um_sensor_);
37 LOG_SENSOR(
" ",
"PM10.0um", this->pm_particles_100um_sensor_);
39 LOG_SENSOR(
" ",
"Formaldehyde", this->formaldehyde_sensor_);
41 LOG_SENSOR(
" ",
"Temperature", this->temperature_sensor_);
42 LOG_SENSOR(
" ",
"Humidity", this->humidity_sensor_);
45 ESP_LOGCONFIG(TAG,
" Mode: active continuous (sensor default)");
47 ESP_LOGCONFIG(TAG,
" Mode: passive with sleep/wake cycles");
224 PUBLISH_STATE(this->pm_1_0_std_sensor_, pm_1_0_std_concentration);
225 PUBLISH_STATE(this->pm_2_5_std_sensor_, pm_2_5_std_concentration);
226 PUBLISH_STATE(this->pm_10_0_std_sensor_, pm_10_0_std_concentration);
228 "Got PM1.0 Standard Concentration: %u µg/m³, PM2.5 Standard Concentration %u µg/m³, PM10.0 Standard "
229 "Concentration: %u µg/m³",
230 pm_1_0_std_concentration, pm_2_5_std_concentration, pm_10_0_std_concentration);
235 const uint8_t pc_offset = is_luftmy ? 10 : 16;
242 ESP_LOGD(TAG,
"Got PM1.0 Concentration: %u µg/m³, PM2.5 Concentration %u µg/m³, PM10.0 Concentration: %u µg/m³",
243 pm_1_0_concentration, pm_2_5_concentration, pm_10_0_concentration);
245 PUBLISH_STATE(this->pm_1_0_sensor_, pm_1_0_concentration);
246 PUBLISH_STATE(this->pm_2_5_sensor_, pm_2_5_concentration);
247 PUBLISH_STATE(this->pm_10_0_sensor_, pm_10_0_concentration);
256 PUBLISH_STATE(this->pm_particles_03um_sensor_, pm_particles_03um);
257 PUBLISH_STATE(this->pm_particles_05um_sensor_, pm_particles_05um);
258 PUBLISH_STATE(this->pm_particles_10um_sensor_, pm_particles_10um);
259 PUBLISH_STATE(this->pm_particles_25um_sensor_, pm_particles_25um);
261 "Got PM0.3 Particles: %u Count/0.1L, PM0.5 Particles: %u Count/0.1L, PM1.0 Particles: %u Count/0.1L, "
262 "PM2.5 Particles: %u Count/0.1L",
263 pm_particles_03um, pm_particles_05um, pm_particles_10um, pm_particles_25um);
270 ESP_LOGD(TAG,
"Got PM5.0 Particles: %u Count/0.1L, PM10.0 Particles: %u Count/0.1L", pm_particles_50um,
273 PUBLISH_STATE(this->pm_particles_50um_sensor_, pm_particles_50um);
274 PUBLISH_STATE(this->pm_particles_100um_sensor_, pm_particles_100um);
281 ESP_LOGD(TAG,
"Got Formaldehyde: %u µg/m^3", formaldehyde);
283 PUBLISH_STATE(this->formaldehyde_sensor_, formaldehyde);
291 const float humidity = this->
get_16_bit_uint_(temperature_offset + 2) / 10.0f;
293 ESP_LOGD(TAG,
"Got Temperature: %.1f°C, Humidity: %.1f%%",
temperature, humidity);
295 PUBLISH_STATE(this->temperature_sensor_,
temperature);
296 PUBLISH_STATE(this->humidity_sensor_, humidity);
302 const uint8_t firmware_version = this->
data_[firmware_error_code_offset];
303 const uint8_t error_code = this->
data_[firmware_error_code_offset + 1];
305 ESP_LOGD(TAG,
"Got Firmware Version: 0x%02X, Error Code: 0x%02X", firmware_version, error_code);