Commit 9c2adca
Add Govee H5140 Smart CO2 Monitor (#684)
* Add Govee H5140 Smart CO2 Monitor decoder
Adds support for the Govee H5140 Smart CO2 Monitor, which broadcasts
temperature, humidity, and CO2 readings via BLE manufacturer data.
Device identification:
- Advertisement name pattern: GV5140XXXX
- Manufacturer data: 20 hex characters (10 bytes)
Data format (hex positions):
- 0-7: Header (01000101)
- 8-13: 24-bit combined temp/humidity value
- 14-17: 16-bit CO2 in ppm (big-endian)
- 18-19: Padding
Decoding:
- Temperature (°C): 24bit_value / 10000
- Humidity (%): (24bit_value % 1000) / 10
- CO2 (ppm): 16bit_value directly
Tested with device GV5140A2D6 (MAC: 3C:DC:75:13:A2:D6) via
OpenMQTTGateway on ESP32.
* Fix H5140 condition to check manufacturer data header
Add compound condition to verify:
- Device name contains 'GV5140'
- Manufacturer data length >= 20 hex chars
- Manufacturer data starts with '01000101' header
This prevents false matches against other devices' data.
* Add H5140 to BLE_ID_NUM enum
The enum must match the order of entries in the devices array.
* Address review feedback for H5140 decoder
- Change tag from 0301 to 0f02 (AIR sensor classification)
- Rename co2 property to carbon_dioxide for HA MQTT discovery
- Add documentation page
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add regression test cases for H5140 decoder
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix test expected output - remove cidc field
H5140 uses a device-specific header (01000101) like H5179_N, not the
standard Govee company ID (88ec). Since there's no company ID check
in the condition, the decoder output doesn't include cidc.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* tag correction
* test adjustment for tag correction
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: DigiH <17110652+DigiH@users.noreply.github.com>1 parent 1475252 commit 9c2adca
File tree
5 files changed
+93
-0
lines changed- docs/devices
- src
- devices
- tests/BLE
5 files changed
+93
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| 192 | + | |
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
| |||
828 | 831 | | |
829 | 832 | | |
830 | 833 | | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
831 | 837 | | |
832 | 838 | | |
833 | 839 | | |
| |||
1048 | 1054 | | |
1049 | 1055 | | |
1050 | 1056 | | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
1051 | 1060 | | |
1052 | 1061 | | |
1053 | 1062 | | |
| |||
0 commit comments