HC8 CO₂ Sensor
The hc8 sensor platform allows you to use HC8 CO₂ sensors.
As the communication with the HC8 sensor is done using UART, you need
to have an UART bus in your configuration with the rx_pin connected to the TX pin of the
HC8 and the tx_pin connected to the RX Pin of the HC8 (it’s switched because the
TX/RX labels are from the perspective of the HC8). Additionally, you need to set the baud rate to 9600.
# Example configuration entrysensor: - platform: hc8 co2: name: HC8 CO2 ValueConfiguration Variables
Section titled “Configuration Variables”-
co2 (Optional): The CO₂ data from the sensor in parts per million (ppm). All options from Sensor.
-
update_interval (Optional, Time): The interval to check the sensor. Defaults to
60s. -
uart_id (Optional, ID): Manually specify the ID of the UART Component if you want to use multiple UART buses.
-
id (Optional, ID): Manually specify the ID used for actions.
-
warmup_time (Optional, Time): The sensor has a warmup period during which it returns inaccurate readings (e.g., 500ppm, 505ppm). This setting discards readings until the warmup time has elapsed (returning
NaNduring warmup). The datasheet specifies a 10-minute preheating time for full accuracy, with 90% accuracy achieved after 3 minutes. Empirical evidence shows that reasonable values are usually returned after about 1 minute. Defaults to75s.
hc8.calibrate Action
Section titled “hc8.calibrate Action”This action executes baseline calibration command on the sensor with the given ID.
Before executing baseline calibration, ensure the HC8 sensor has been operating in a stable gas environment (with known CO₂ concentration) for at least 2 minutes.
Warning: Only calibrate the sensor in a known stable environment (e.g., outdoors or in a well-ventilated room). Incorrect calibration will result in inaccurate readings.
on_...: then: - hc8.calibrate: id: my_hc8_id baseline: 420 # Current outdoor CO₂ levelYou can provide an action to perform from Home Assistant
api: actions: - action: hc8_calibrate variables: my_baseline: int then: - hc8.calibrate: id: my_hc8_id baseline: !lambda 'return my_baseline;'