Skip to content

Commit 7965873

Browse files
Add documentation for HC8 CO2 sensor (#5613)
* Add documentation for HC8 CO2 sensor * AI cleanup --------- Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
1 parent fffe051 commit 7965873

File tree

6 files changed

+83
-0
lines changed

6 files changed

+83
-0
lines changed

all_automations.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
"grove_tb6612fng.run",
137137
"grove_tb6612fng.standby",
138138
"grove_tb6612fng.stop",
139+
"hc8.calibrate",
139140
"homeassistant.action",
140141
"homeassistant.event",
141142
"homeassistant.service",

content/automations/all_actions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ title: ""
3131
- **fingerprint_grow:** `aura_led_control`, `cancel_enroll`, `delete`, `delete_all`, `enroll`, `led_control`
3232
- **globals:** `set`
3333
- **grove_tb6612fng:** `break`, `change_address`, `no_standby`, `run`, `standby`, `stop`
34+
- **hc8:** `calibrate`
3435
- **homeassistant:** `event`, `service`, `tag_scanned`
3536
- **http_request:** `get`, `post`, `send`
3637
- **htu21d:** `set_heater`, `set_heater_level`

content/components/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ Sensors are organized into categories; if a given sensor fits into more than one
240240
"GCJA5","components/sensor/gcja5","gcja5.svg","Particulate","",""
241241
"GP2Y1010AU0F","components/sensor/gp2y1010au0f","gp2y1010au0f.png","Particulate","",""
242242
"Grove Multichannel Gas V2","components/sensor/grove_gas_mc_v2","grove-gas-mc-v2.png","NO₂ & CO & Ethanol & Volatile organics","",""
243+
"HC8","components/sensor/hc8","hc8.png","CO₂","",""
243244
"HM3301","components/sensor/hm3301","hm3301.jpg","Particulate","",""
244245
"iAQ-Core","components/sensor/iaqcore","iaqcore.jpg","eCO₂ & Volatile organics","",""
245246
"MH-Z19","components/sensor/mhz19","mhz19.jpg","CO₂ & Temperature","",""
@@ -380,6 +381,7 @@ Sensors are organized into categories; if a given sensor fits into more than one
380381
"EMC2101","components/emc2101","emc2101.jpg","Temperature",""
381382
"ENS160","components/sensor/ens160","ens160.jpg","eCO₂ & Air Quality",""
382383
"ENS210","components/sensor/ens210","ens210.jpg","Temperature & Humidity",""
384+
"HC8","components/sensor/hc8","hc8.png","CO₂",""
383385
"HDC1080","components/sensor/hdc1080","hdc1080.jpg","Temperature & Humidity",""
384386
"HDC2010","components/sensor/hdc2010","hdc2010.png","Temperature & Humidity",""
385387
"HHCCJCY10 (MiFlora Pink)","components/sensor/xiaomi_hhccjcy10","xiaomi_hhccjcy10.jpg","Soil moisture & Temperature & Light",""

content/components/sensor/hc8.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
description: "Instructions for setting up HC8 CO2 sensors"
3+
title: "HC8 CO₂ Sensor"
4+
params:
5+
seo:
6+
description: Instructions for setting up HC8 CO2 sensors
7+
image: hc8.png
8+
---
9+
10+
The `hc8` sensor platform allows you to use HC8 CO₂ sensors.
11+
12+
{{< img src="hc8-full.png" alt="HC8 CO₂ Sensor" caption="HC8 CO₂ Sensor." width="50.0%" class="align-center" >}}
13+
14+
As the communication with the HC8 sensor is done using UART, you need
15+
to have an [UART bus](/components/uart) in your configuration with the `rx_pin` connected to the TX pin of the
16+
HC8 and the `tx_pin` connected to the RX Pin of the HC8 (it's switched because the
17+
TX/RX labels are from the perspective of the HC8). Additionally, you need to set the baud rate to 9600.
18+
19+
```yaml
20+
# Example configuration entry
21+
sensor:
22+
- platform: hc8
23+
co2:
24+
name: HC8 CO2 Value
25+
```
26+
27+
## Configuration Variables
28+
29+
- **co2** (*Optional*): The CO₂ data from the sensor in parts per million (ppm).
30+
All options from [Sensor](/components/sensor).
31+
32+
- **update_interval** (*Optional*, [Time](/guides/configuration-types#time)): The interval to check the
33+
sensor. Defaults to `60s`.
34+
35+
- **uart_id** (*Optional*, [ID](/guides/configuration-types#id)): Manually specify the ID of the [UART Component](/components/uart) if you want
36+
to use multiple UART buses.
37+
38+
- **id** (*Optional*, [ID](/guides/configuration-types#id)): Manually specify the ID used for actions.
39+
40+
- **warmup_time** (*Optional*, [Time](/guides/configuration-types#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 `NaN` during 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 to `75s`.
41+
42+
{{< anchor "hc8-calibrate_action" >}}
43+
44+
## `hc8.calibrate` Action
45+
46+
This [action](/automations/actions#all-actions) executes baseline calibration command on the sensor with the given ID.
47+
48+
Before executing baseline calibration, ensure the HC8 sensor has been operating in a stable gas environment
49+
(with known CO₂ concentration) for at least 2 minutes.
50+
51+
**Warning:** Only calibrate the sensor in a known stable environment (e.g., outdoors or in a well-ventilated room).
52+
Incorrect calibration will result in inaccurate readings.
53+
54+
```yaml
55+
on_...:
56+
then:
57+
- hc8.calibrate:
58+
id: my_hc8_id
59+
baseline: 420 # Current outdoor CO₂ level
60+
```
61+
62+
You can provide an [action](/components/api#api-device-actions) to perform from Home Assistant
63+
64+
```yaml
65+
api:
66+
actions:
67+
- action: hc8_calibrate
68+
variables:
69+
my_baseline: int
70+
then:
71+
- hc8.calibrate:
72+
id: my_hc8_id
73+
baseline: !lambda 'return my_baseline;'
74+
```
75+
76+
## See Also
77+
78+
- [Sensor Filters](/components/sensor#sensor-filters)
79+
- {{< apiref "hc8/hc8.h" "hc8/hc8.h" >}}
193 KB
Loading

static/images/hc8.png

83 KB
Loading

0 commit comments

Comments
 (0)