BTHome Guide to the CO2 Gadget: Home Assistant without Wi-Fi or MQTT

Last modified 2 months

BTHome v2 is an open BLE beacon protocol that Home Assistant detects automatically: with your Gadget CO₂ sensor transmitting via Bluetooth, Home Assistant creates the entities without the need for Wi-Fi, MQTT or manual configuration. The CO2 Gadget supports 10 measurements (CO₂, temperature, humidity, battery, PM2.5, pressure, PM10, voltage, PM1.0 and PM4.0), AES-CCM encryption and coexistence with MyAmbiance.

Documentation is currently being updated. We are currently reviewing and improving all our pages. You may come across a broken link or some content that hasn’t been finalised yet. If you spot anything that isn’t quite right, please help us fix it at GitHub.

Tired of relying on MQTT or Wi-Fi to get your CO₂ sensor to appear in Home Assistant? With the new version v0.16.015-beta CO₂ Gadget: your monitor communicates directly with Home Assistant via Bluetooth Low Energy, no Wi-Fi network required, no MQTT broker, no configuration.

What do you need?

  • An ESP32 with CO₂ Gadget v0.16.015-beta
  • Home Assistant with the BTHome integrator (included by default)
  • It takes just a few seconds to activate BTHome in the Web UI

That’s it. You don’t need to configure MQTT, nor do you need your meter to be on the same Wi-Fi network, nor do you need to open any ports. The meter broadcasts its readings via BLE and Home Assistant collects them.


What is BTHome?

BTHome It is an open BLE beacon standard for home automation devices. CO₂ Gadget broadcasts its measurements as a BTHome data service under the UUID 0xFCD2. Home Assistant, with the BTHome integrator built in, automatically detects the device and creates the corresponding entities.

Advantages over MQTT:

  • Zero-config — you don’t need an MQTT broker or any configuration in Home Assistant
  • No Wi-Fi — it works even if the meter is in aeroplane mode or has no network connection
  • Low consumption — compatible with deep sleep (notifications on every wake)
  • Independent — works in conjunction with MyAmbiance or on its own

How to activate BTHome

From the Web UI (recommended)

  1. Open `http://ip_del_medidor/preferences.html`
  2. Go to Connectivity
  3. Active BLE (if it isn't)
  4. Active BTHome
  5. The BTHome configuration will be displayed, showing the sensor options
  6. Click Save

From the ‘Series’ menu

BLE Config
└── BTHome
    ├── BTHome output [ON]
    ├── Encryption [OFF] (optional)
    ├── BTHome key (32 hex)
    └── Publish Sensors
        ├── Core: CO₂, Temperature, Humidity, Battery
 ├── Optional: PM2.5, Pressure, PM10, Battery Voltage
 └── No BTHome object: PM1.0, PM4.0

Available sensors

CO₂ Gadget can display up to 10 types of measurement. They are grouped into three categories:

Group Sensors BTHome IDs
Core (by default) CO₂, Temperature, Humidity, Battery (%) 0x12, 0x02, 0x03, 0x01
Optional PM2.5, Pressure, PM10, Battery voltage 0x0D, 0x04, 0x0E, 0x0C
Not a BTHome object PM1.0, PM4.0 0xEE, 0xEF (private)

Default selection: Only the Core sensors. The others are opt-in via the Web UI or the menu.

Payload limit: BLE advertisements are limited to ~24 bytes. If you select too many sensors, those with the lowest priority are automatically omitted. The Web UI displays the remaining capacity in real time.

Note on PM1.0 and PM4.0: They use private IDs (not the standard BTHome IDs). Home Assistant does not recognise them, but they do not interfere with the other sensors. They are intended for systems capable of parsing custom IDs.


AES-CCM encryption

BTHome supports optional encryption using 128-bit AES-CCM.

  1. Active Encryption in the Web UI or the menu
  2. A bind key 32 hexadecimal characters
  3. To view it: in the Web UI, click Reveal (it will ask you to confirm)
  4. Copy the bind key and enter it into Home Assistant when pairing

⚠️ Important: The bind key not included in the backups (`preferences_backup.json`). If you restore a backup, you will need to enter the key again or regenerate it and re-pair Home Assistant.


Integration with Home Assistant

  1. Enable BTHome on the meter (and, optionally, encryption)
  2. If you are using encryption, reveal the bind key via the Web UI
  3. In Home Assistant: Settings → Devices and services
  4. The meter will automatically appear as a BTHome device
  5. If it is encrypted, paste the bind key when Home Assistant asks for it
  6. The units for the selected sensors will be created automatically

Standard measurements (CO₂, temperature, humidity, battery, pressure, PM2.5, PM10) appear as native entities. PM1.0 and PM4.0 do not appear (non-standard IDs).


Behaviour in low-power mode

In LOW_POWER mode (deep sleep), the behaviour changes slightly:

  • Particulate matter (PM) — They are not triggered during deep sleep. The particle sensors require several seconds to activate the fan, which is incompatible with the ~0.3 s wake time. The selection is retained and automatically resumed upon returning to HIGH_PERFORMANCE.
  • Pressure — It is only read in wake mode if you compile with `SUPPORT_LOW_POWER_PRESSURE` (opt-in). Currently only compatible with the BME280.
  • CO₂, temperature, humidity — They’re usually announced at every wake.

The meter posts a BTHome advert as soon as it wakes up, before going back to sleep.


How to update

If you’ve already installed CO₂ Gadget, update it via the Web UI:

  1. Open http://ip_del_medidor/update
  2. Upload the binary for the new version
  3. The meter resets automatically

If this is your first time, visit the Installation Guide.

Frequently Asked Questions

Can I have both BTHome and MyAmbiance at the same time? Yes. Both can be active at the same time. If both are active, BTHome switches to scan response mode so as not to interfere with MyAmbiance.

Does BTHome work without Wi-Fi? Yes. BTHome is purely BLE. It doesn’t need Wi-Fi at all.

How much battery power does BTHome use? Very little. The advertisements are short and are sent using configurable thresholds. In low-power mode, it only advertises on each wake.

Why can’t I see PM1.0/PM4.0 in Home Assistant? Because they use private IDs that Home Assistant does not recognise. If you need them, you’ll have to use a custom receiver (ESPHome, Theengs, etc.).

I have restored a backup, but HA cannot find the meter. The bind key is not included in the backup. Retrieve the key again via the Web UI or generate a new one and re-pair the device.


Known limitations

  • PM1.0 and PM4.0 do not appear in Home Assistant (private IDs)
  • In low-power mode, PM is not announced (the selection is retained)
  • Wake pressure using only `SUPPORT_LOW_POWER_PRESSURE` and BME280
  • Temperature is always given in °C
  • The byte budget is calculated conservatively (24 B), even in scan response mode


Did you find this helpful? Share this article. If you have any ideas or suggestions, or if you come across any problems, open an issue on GitHub or pop round to the Telegram group. See also the Menu Guide.

«>

Leave a comment