{% if installed or pending_update %}
Fix:
- Update bleson package to version 0.18, fixes non BLE spec device name errors
NOTE FOR THOSE WHO ARE UPGRADING FROM V0.5 - a restart of the host device is suggested after upgrading this component. The previous implementation may still have processes running or sockets open which.could cause unforeseeable issues. I apologize for the inconvenience and future updates should go much smoother.
{% endif %}
A custom component for Home Assistant that listens for the advertisement message broadcast by Govee Bluetooth Thermometer/Hygrometers.
- Govee H5051 (BLE only)
- Govee H5072
- Govee H5074
- Govee H5075
- Govee H5101
- Govee H5102
- Govee H5177
1. Install the custom component:
-
The easiest way is to install it with HACS. First install HACS if you don't have it yet. After installation, the custom component can be found in the HACS store under integrations.
-
Alternatively, you can install it manually. Just copy paste the content of the
sensor.goveetemp_bt_hci/custom_components
folder in yourconfig/custom_components
directory. As example, you will get thesensor.py
file in the following path:/config/custom_components/govee_ble_hci/sensor.py
.
2. Stop and start Home Assistant:
- Stop and start Home Assistant. Make sure you first stop Home Assistant and then start Home Assistant again. Do this before step 5, as Home Assistant will otherwise complain that your configuration is not valid (as it still uses the build in
govee_ble_hci
integration), and won't restart when hitting restart in the server management menu.
3. Add the platform to your configuration.yaml file (see below)
4. Restart Home Assistant:
- A second restart may be required to load the configuration. Within a few minutes, the sensors should be added to your home-assistant automatically (at least one period required).
Specify the sensor platform govee_ble_hci
and a list of devices with unique MAC address.
NOTE: device name is optional. If not provided, devices will be labeled using the MAC address
sensor:
- platform: govee_ble_hci
govee_devices:
- mac: "A4:C1:38:A1:A2:A3"
name: Bedroom
- mac: "A4:C1:38:B1:B2:B3"
- mac: "A4:C1:38:C1:C2:C3"
name: Kitchen
Option | Type | Default Value | Description |
---|---|---|---|
rounding |
Boolean | True |
Enable/disable rounding of the average of all measurements taken within the number seconds specified with 'period'. |
decimals |
positive integer | 2 |
Number of decimal places to round if rounding is enabled. |
period |
positive integer | 60 |
The period in seconds during which the sensor readings are collected and transmitted to Home Assistant after averaging. The Govee devices broadcast roughly once per second so this limits amount of mostly duplicate data stored in Home Assistant's database. |
log_spikes |
Boolean | False |
Puts information about each erroneous spike in the Home Assistant log. |
use_median |
Boolean | False |
Use median as sensor output instead of mean (helps with "spiky" sensors). Please note that both the median and the mean values in any case are present as the sensor state attributes. |
hci_device |
string | hci0 |
HCI device name used for scanning. |
Example with all defaults:
sensor:
- platform: govee_ble_hci
rounding: True
decimals: 2
period: 60
log_spikes: False
hci_device: hci0
govee_devices:
- mac: "A4:C1:38:A1:A2:A3"
name: Bedroom
- mac: "A4:C1:38:B1:B2:B3"
- mac: "A4:C1:38:C1:C2:C3"
name: Kitchen
This was originally based on/shamelessly copied from custom-components/sensor.mitemp_bt. I want to thank @tsymbaliuk and @Magalex for providing a blueprint for developing my Home Assistant component.