[![english](https://img.shields.io/badge/language-english-C1C1C1?style=for-the-badge)](README.md) [![russian](https://img.shields.io/badge/also%20available%20in-russian-blue?style=for-the-badge)](README-ru.md) # BTHome THB1, THB2, THB3, BTH01, TH05 (HW: v1.3..1.6), TH05F Custom firmware for Tuya devices based on the PHY622x2 chipset. This firmware works with [Home Assistant](https://www.home-assistant.io/) and other software running in the [BTHome](https://bthome.io/) format. | [THB1](https://pvvx.github.io/THB1) | [THB2](https://pvvx.github.io/THB2) | [THB3](https://pvvx.github.io/THB3) | [BTH01](https://pvvx.github.io/BTH01/) | [TH05_V1.3](https://pvvx.github.io/TH05-v1.3) | [TH05_V1.4](https://pvvx.github.io/TH-05) | [TH05F](https://pvvx.github.io/TH05F) | |:---:|:---:|:---:|:---:|:---:|:---:|:---:| | ![THB1](https://pvvx.github.io/THB1/img/THB1.jpg) | ![THB2](https://pvvx.github.io/THB2/img/THB2.jpg) | ![THB3](https://pvvx.github.io/THB3/img/THB3.jpg) | ![BTH01](https://pvvx.github.io/BTH01/img/BTH01.jpg) | ![TH05V1.3](https://pvvx.github.io/TH05-v1.3/img/TH05-V1.3.jpg) | ![TH05V1.4](https://pvvx.github.io/TH-05/img/TH05V14.jpg) | ![TH05F](https://pvvx.github.io/TH05F/img/TH05F.jpg) All firmware supports any of these sensors: CHT8215 (CHT8310), CHT8305, AHT20..30. **Software for setting up and making BLE OTA: [PHY62x2BTHome.html](https://pvvx.github.io/THB2/web/PHY62x2BTHome.html).** > Uploading OTA files to [PHY62x2BTHome.html](https://pvvx.github.io/THB2/web/PHY62x2BTHome.html) is automatic. You don't need to download files from this repository for OTA. > To run [PHY62x2BTHome.html](https://pvvx.github.io/THB2/web/PHY62x2BTHome.html) offline, just copy the [html](bthome_phy6222/web/PHY62x2BTHome.html) file to a local folder. ## Boot and App firmware The [Boot](#fw-boot-and-ota) firmware has minimal functions. Boot is only used for downloading via OTA the full-featured version of APP (`.bin` files). * The device type can be distinguished externally by the smiley face symbol on the screen. | Device | Boot file | OTA file | Printed circuit board labelling | |:---:|:---:|:---:|:---:| | [THB1](https://pvvx.github.io/THB1) | BOOT_THB1_v17.hex | THB1_v17.bin | no | | [THB2](https://pvvx.github.io/THB2) | BOOT_THB2_v17.hex | THB2_v17.bin | no | | [THB3](https://pvvx.github.io/THB3) | BOOT_THB2_v17.hex | THB2_v17.bin | no | | [BTH01](https://pvvx.github.io/BTH01) | BOOT_BTH01_v17.hex | BTH01_v17.bin | no | | [TH05_V1.4](https://pvvx.github.io/TH-05) | BOOT_TH05_v17.hex | TH05_v17.bin | TH05_V1.4, TH05_V1.5, TH05_V1.6 (chip: BL55028) | | [TH05_V1.3](https://pvvx.github.io/TH05-v1.3) | BOOT_TH05D_v17.hex | TH05D_v17.bin | RSH-TH05-V1.3 (chip: BL55072) | | [TH05F](https://pvvx.github.io/TH05F) | BOOT_TH05F_v17.hex | TH05F_v17.bin | TH05Y_V1.1, TH05Y_V1.2 (chip: QD01 2332 NT) | The main firmware files, BOOT_XXX_vXX.hex (for programming via USB-COM adapter) and XXX_vXX.bin (for OTA), are located in the [bin](bin) directory. Files for updating boot via OTA are located in the [update_boot](update_boot) directory. **The process of updating boot via OTA is not safe. Please check the battery level before doing this. If boot is working fine, there is no need to update to the new version. The need to replace boot with a new version will be announced later.** > The current boot version is **v1.7** for devices with CHT8305 sensor. For other variants, boot is not required from version **v1.4**. ## Main features **With default settings**: * BLE advertisement interval in [BTHome v2](https://bthome.io) format is 5 seconds. * Humidity and temperature sensor is polled every second BLE advertisement interval - period of 10 seconds. * Battery voltage measurement is done every minute. * Recording of history every 30 minutes. * The button is used for quick connection to old BT adapters. Pressing the button switches the BLE advertising interval to a shorter period (1562.5ms). The action will continue for 60 seconds, then the interval will be restored to the one set in the settings. * The measured average consumption from a 3.3V source when scanning THB2 and BTH01 thermometers in passive mode is up to 8 µA. For TH05_V1.4 the average consumption is about 23 µA ([this is the current of the installed components](https://github.com/pvvx/THB2/issues/8#issuecomment-1908982171)). Other versions with screen: 12 to 14 µA with LCD on and 7 to 12 µA with LCD off. * Connection interval with Connect Latency (900ms). * Handling of input counter contact for transmitted [Open/Close events](https://github.com/pvvx/THB2/issues/10#issuecomment-1935169274) * Processing of output contact switchable by set temperature and/or humidity with hysteresis. * Support low-cost [BLE to Zigbee advertising repeater](https://github.com/pvvx/TLB2Z) ## Version History | Version | Description | |---|--- | | 1.0 | | | 1.1 | | | 1.2 | | | 1.3 | | 1.4 | | | 1.5 | | | 1.6 |