APC1 Air Quality Combo Sensor
The apc1 sensor platform allows you to use the
ScioSense APC1 air quality sensor with ESPHome.
This sensor reports particulates, total volatile organic compounds (TVOC), estimated carbon dioxide (eCO2),
air quality index (AQI), temperature, and relative humidity.
As the communication with the APC1 is done using UART, you need to have a UART bus in your configuration with the RX and TX pins connected, and with the baud rate set to 9600.
The sensor reports two types of mass concentrations: the value as calibrated for normal ambient/atmospheric air
(e.g. pm_1_0), and the value as calibrated for “standard particle conditions” (e.g. pm_1_0_std). For home use,
it’s recommended to use the ambient air (e.g. pm_1_0) values.
Configuration
Section titled “Configuration”# Example configuration entrysensor: - platform: apc1 pm_2_5: name: "APC1 PM2.5" temperature: name: "APC1 Temperature" humidity: name: "APC1 Humidity" aqi: name: "APC1 AQI"Configuration Variables
Section titled “Configuration Variables”-
set_pin (Optional, Pin Schema): Pin connected to the SET pin of the sensor. Pulling HIGH enables normal operating mode; pulling LOW puts the sensor into low-power sleep mode.
-
reset_pin (Optional, Pin Schema): Pin connected to the RESET pin of the sensor. Pulling LOW resets the sensor.
-
update_interval (Optional, Time): The minimum amount of time between generating/publishing measurements. Defaults to
0s(forwards data as soon as valid frames arrive from the sensor, typically ~1s). -
uart_id (Optional, ID): Manually specify the ID of the UART Component if multiple UART buses are configured.
-
id (Optional, ID): Manually specify the ID for this APC1 component instance (useful when targeting the sensor with actions).
-
pm_1_0 (Optional): The concentration of particulates of size less than 1.0µm in µg per cubic meter calibrated for atmospheric air. All options from Sensor.
-
pm_2_5 (Optional): The concentration of particulates of size less than 2.5µm in µg per cubic meter calibrated for atmospheric air. All options from Sensor.
-
pm_10_0 (Optional): The concentration of particulates of size less than 10.0µm in µg per cubic meter calibrated for atmospheric air. All options from Sensor.
-
pm_1_0_std (Optional): The concentration of particulates of size less than 1.0µm in µg per cubic meter calibrated for standard particle conditions. All options from Sensor.
-
pm_2_5_std (Optional): The concentration of particulates of size less than 2.5µm in µg per cubic meter calibrated for standard particle conditions. All options from Sensor.
-
pm_10_0_std (Optional): The concentration of particulates of size less than 10.0µm in µg per cubic meter calibrated for standard particle conditions. All options from Sensor.
-
pm_0_3um (Optional): The number of particles with diameter >= 0.3 µm in 0.1L of air. All options from Sensor.
-
pm_0_5um (Optional): The number of particles with diameter >= 0.5 µm in 0.1L of air. All options from Sensor.
-
pm_1_0um (Optional): The number of particles with diameter >= 1.0 µm in 0.1L of air. All options from Sensor.
-
pm_2_5um (Optional): The number of particles with diameter >= 2.5 µm in 0.1L of air. All options from Sensor.
-
pm_5_0um (Optional): The number of particles with diameter >= 5.0 µm in 0.1L of air. All options from Sensor.
-
pm_10_0um (Optional): The number of particles with diameter >= 10.0 µm in 0.1L of air. All options from Sensor.
-
tvoc (Optional): Total Volatile Organic Compounds (TVOC) concentration in ppb. All options from Sensor.
-
eco2 (Optional): Equivalent Carbon Dioxide (eCO2) concentration in ppm calculated by the sensor. All options from Sensor.
-
aqi (Optional): Air Quality Index (AQI 1–5). Reports
NANwhile the gas sensor is warming up. All options from Sensor. -
temperature (Optional): Compensated temperature value in °C. All options from Sensor.
-
humidity (Optional): Compensated relative humidity value in %. All options from Sensor.
-
raw_temperature (Optional): Raw uncompensated temperature value in °C. All options from Sensor.
-
raw_humidity (Optional): Raw uncompensated relative humidity value in %. All options from Sensor.
-
rs0 (Optional): Raw resistance of the MOX gas sensor RS0 element in Ω. All options from Sensor.
-
rs2 (Optional): Raw resistance of the MOX gas sensor RS2 element in Ω. All options from Sensor.
-
rs3 (Optional): Raw resistance of the MOX gas sensor RS3 element in Ω. All options from Sensor.
-
error_code (Optional): Hardware diagnostic error code bitmask reported by the sensor. All options from Sensor.
Actions
Section titled “Actions”The apc1 component provides several actions to control operating and
measurement modes.
apc1.set_active_mode Action
Section titled “apc1.set_active_mode Action”This action puts the sensor into active measurement mode (the default). In active mode, the sensor continuously takes measurements and automatically outputs data periodically over UART.
on_...: then: - apc1.set_active_mode: id: apc1_idThis action can also be written in shorthand:
on_...: then: - apc1.set_active_mode: apc1_idConfiguration Variables
Section titled “Configuration Variables”- id (Required, ID): The ID of the APC1 component.
apc1.set_passive_mode Action
Section titled “apc1.set_passive_mode Action”This action puts the sensor into passive measurement mode. In passive mode, the sensor stops sending data frames
automatically. Readings are only transmitted when requested with
apc1.request_measurement.
on_...: then: - apc1.set_passive_mode: id: apc1_idThis action can also be written in shorthand:
on_...: then: - apc1.set_passive_mode: apc1_idConfiguration Variables
Section titled “Configuration Variables”- id (Required, ID): The ID of the APC1 component.
apc1.request_measurement Action
Section titled “apc1.request_measurement Action”This action requests a single measurement frame from the sensor when operating in passive mode. Once received, the component parses the data and publishes the updated sensor states.
on_...: then: - apc1.request_measurement: id: apc1_idThis action can also be written in shorthand:
on_...: then: - apc1.request_measurement: apc1_idConfiguration Variables
Section titled “Configuration Variables”- id (Required, ID): The ID of the APC1 component.
apc1.set_idle_mode Action
Section titled “apc1.set_idle_mode Action”This action puts the sensor into low-power idle (standby) mode, stopping measurements and turning off the fan and laser.
on_...: then: - apc1.set_idle_mode: id: apc1_idThis action can also be written in shorthand:
on_...: then: - apc1.set_idle_mode: apc1_idConfiguration Variables
Section titled “Configuration Variables”- id (Required, ID): The ID of the APC1 component.
apc1.set_measurement_mode Action
Section titled “apc1.set_measurement_mode Action”This action wakes the sensor from idle mode back into normal operating measurement mode, turning the fan and laser back on.
on_...: then: - apc1.set_measurement_mode: id: apc1_idThis action can also be written in shorthand:
on_...: then: - apc1.set_measurement_mode: apc1_idConfiguration Variables
Section titled “Configuration Variables”- id (Required, ID): The ID of the APC1 component.