GoveeBTTempLogger
Govee H5072, H5074, H5075, H5100, H5101, H5104, H5105, H5110, H5174, H5177, H5179, H5181, H5182, and H5183 Bluetooth Low Energy Temperature and Humidity Logger
Install / Use
/learn @wcbonner/GoveeBTTempLoggerREADME
GoveeBTTempLogger
Govee H5074, H5075, H5100, H5101, H5104, H5105, H5110, H5174, H5177, and H5179 Bluetooth Low Energy Temperature and Humidity Logger, and Govee H5181, H5182 and H5183 Smart Meat Thermometers
Each of these devices currently cost less than $15 on Amazon and use BLE for communication, so don't require setting up a manufacterer account to track the data.
GoveeBTTempLogger was initially built using Microsoft Visual Studio 2017, targeting ARM processor running on Linux. I'm using a Raspberry Pi 4 as my linux host. I've verified the same code works on a Raspbery Pi ZeroW, Raspberry Pi Zero2W, Raspberry Pi 3b, and a Raspberry Pi 5.
GoveeBTTempLogger creates a log file, if specified by the -l or --log option, for each of the devices it receives broadcasted data from using a simple tab-separated format that's compatible with loading in Microsoft Excel. Each line in the log file has Date (recorded in UTC), Temperature, relative humidity, and battery percent. The log file naming format includes the unique Govee device name, the current year, and month. A new log file is created monthly.
2026-02-12 Modification to user creation and groups
Access to the /dev/rfkill device for writing seems to be allowed by adding the user goveebttemplogger to the group "netdev". I've added this to the postinst script. I've also changed the inclusion of the user in the www-data group to be a secondary group instead of the primary group, which seems to be more standard for system users.
2026-02-11 rfkill support
I have been having a recurrent problem with rfkill soft blocking the bluetooth adapter on my Raspberry Pi 4. I have added code to display the rfkill status of all devices in /dev/rfkill and unblock all bluetooth adapters. With the addition of the code in the program, I removed the calls to the external rfkill command in the postint script.
Trixie Release Information 2025-10-07
Raspberry released the update to Trixie this week https://www.raspberrypi.com/news/trixie-the-new-version-of-raspberry-pi-os/ and while GoveeBTTempLogger works on the updated system, the built in bluetooth is blocked on many systems.
I had two issues open related to Trixie, https://github.com/wcbonner/GoveeBTTempLogger/issues/89 and https://github.com/wcbonner/GoveeBTTempLogger/issues/91 with the second finding the solution, which is to run the command rfkill unblock bluetooth
wim@WimPiZeroW-Sola:~ $ rfkill
ID TYPE DEVICE SOFT HARD
0 bluetooth hci0 blocked unblocked
1 wlan phy0 unblocked unblocked
Minor update 2022-12-17
Added the option --index to create an html index file based on the existing log files. This option creates an index file and exits without running any of the bluetooth code. It can be run without affecting a running instance of the program listening to Bluetooth advertisments. Example command to create index:
sudo /usr/local/bin/goveebttemplogger --log /var/log/goveebttemplogger/ --index index.html
Major update to version 3.
Conversion to Bluetooth using BlueZ over DBus! DBus is the approved method of Bluetooth communication. It seems to use more CPU than the pure HCI code. When I tried building this on a machine running Raspbian GNU/Linux 10 (buster) the system builds but the BlueZ DBus routines to find the bluetooth adapter fail. For this reason, I've left the old HCI commands in the code and fallback to running HCI if DBus fails.
I've added an --HCI option to allow the user to force it to run the HCI commands instead of using the DBus interface.
When running DBus, there is no way to run in passive scanning mode. The --passive option is ignored.
When running HCI mode, the whitelist created with the --only option is sent to the bluetooth hardware and only those devices are sent from the hardware to the software. In DBus mode whitelisting does not appear to be available. In DBus mode I'm filtering the output based on the whitelist.
2024-10-10 HCI Code in #ifdef sections
The code has been rearranged slightly for clarity, moving all of the HCI access code into #ifdef blocks. The CMakeLists.txt file defines _BLUEZ_HCI_ to keep the code in the application. Removing or commenting out the line add_compile_definitions(BLUEZ_HCI) will compile without the Bluetooth HCI libraries. I should also be able to ignore the files att-types.h, uuid.c, and uuid.h. I'm proficient at CMake to do this yet.
HCI code uses libbluetooth functionality from BlueZ on linux to open the default Bluetooth device and listen for low energy advertisments from Govee thermometers.
2024-10-01 Run As goveebttemplogger
Updated the postinst debian install script to add a user goveebttemplogger and make changes to the permissions on the default directories appropriately. Changed the service file to specify running the program as user goveebttemplogger. This is possible because accessing BlueZ via DBus does not require root access.
2025-02-18 Added --download to default service command
The download functionality is now working with the DBus code base as well as being more robust using the HCI code. As such I've added it to the default running configuration. It does not attempt to download data more than every two weeks, to reduce battery usage of the bluetooth device. It retrieves the oldest data first, and if the transfer is stopped midway, will attempt to start from the new "oldest" data downloaded.
Major update to version 2.
Added the SVG output function, directly creating SVG graphs from internal data in a specified directory. The causes the program to take longer to start up as it will attempt to read all of the old logged data into an internal memory structure as it starts. Once the program has entered the normal running state it writes four SVG files per device to the specified directory every five minutes.
Here is an example filename: gvh-E35ECC215C0F-day.svg
The most recent temperature and humidity are displayed in the vertical scale on the left. The temperature scale is displayed on the left side of the graph, the humidity scale on the right. The most recent time data is displayed in the top right, with a title on the top left of the graph.
Minimum and maximum temperature and humidity data, at the granularity of the graph, may be displayed. This is most useful in yearly graphs, where the granularity is one day. Here is the corresponding yearly graph for the previous daily graph: gvh-E35ECC215C0F-year.svg
Humidity, and the humidity scale on the right, are automatically omitted if the current data reports a humidity of zero. The meat thermometer reports its current temperature and its alarm set temperature but no humidity measurement.
A simple text file mapping Bluetooth addresses to titles will be read from the filename gvh-titlemap.txt in the svg output directory. Each line in the file should consist of the bluetooth address (in hexadecimal format with (:) between octets), whitespace, and the title. See gvh-titlemap.txt for an example. If no title mapping exists, the Bluetooth address is used for the graph title.
If the --svg option is not added to the command line, the program should continue to operate exactly the same as it did before.
Verbosity has been significantly changed since the intial release.
- -v 0 no output to stdout. Errors still sent to stderr.
- -v 1 prints all advertisments that have been decoded from Govee H5075, H5074, H5174, and H5177 thermometers to stdout.
- -v 2 prints all advertisments recieved and categorized
- -v levels higher than 2 print way too much debugging information, but can be interesting to look at.
Prerequisites
Linux
- Kernel version 3.6 or above
libbluetooth-devlibdbus-1-dev
Ubuntu/Debian/Raspbian
Build Process changed from using make with a makefile to cmake 2023-09-18
This seems to better build the debian package with the correct installed size, dependencies, and md5sums details. I'm still learning CMake so there may be regular updates for a while.
sudo apt install build-essential cmake git libbluetooth-dev libdbus-1-dev
git clone https://github.com/wcbonner/GoveeBTTempLogger.git
cmake -S GoveeBTTempLogger -B GoveeBTTempLogger/build
cmake --build GoveeBTTempLogger/build
pushd GoveeBTTempLogger/build && cpack . && popd
The install package will creates a systemd unit goveebttemplogger.service which will automatically start GoveeBTTempLogger. The service can be configured via
the systemctl edit goveebttemplogger.service command. By default, it writes logs to /var/log/goveebttemplogger and writes SVG files to /var/www/html/goveebttemplogger.
The postinst install routine creates a user and three directories. It also will change the permissions on those dirctories to be owned by and writable by the newly created user.
adduser --system --ingroup www-data goveebttemplogger
mkdir --verbose --mode 0755 --parents /var/log/goveebttemplogger /var/cache/goveebttemplogger /var/www/html/goveebttemplogger
chown --changes --recursive goveebttemplogger:www-data /var/log/goveebttemplogger /var/cache/goveebttemplogger /var/www/html/goveebttemplogger
chmod --changes --recursive 0644 /var/log/goveebttemplogger/* /var/cache/goveebttemplogger/* /var/www/html/goveebttemplogger/*
sudo setcap 'cap_net_raw,cap_net_admin+eip' /usr/local/bin/goveebttemplogger
Debian 13 (Trixie) 2025-12-08
The systemd unit file section ExecStart to start the service has been broken into several lines for clarity.
[Service]
Type=simple
Restart=always
RestartSec=30
User=goveebttemplogger
Group=www-data
ExecStart=/usr/local/bin/goveebttemplogger \
--verbose 0 \
--log /var/log/goveebttemplogger \
--time 60 \
--download 7 \
--restart 3 \
--svg /var/www/html/govee
