Govee H5075 and H5074, Bluetooth Low Energy, and MRTG

I have been wanting a method of keeping track of temperatures for a long time. Last week I acquired a Govee H5075 Bluetooth Thermometer Hygrometer. It communicates with an app from Govee on my iPhone using Bluetooth Low Energy (BLE).

I’ve now learned some details on BLE, and have written a program that listens for BLE advertisements from either type of thermometer and logs the temperature and humidity in a text file. The code for my project is available on GitHub. https://github.com/wcbonner/GoveeBTTempLogger

The same program can also be called to get the last value from the log and produce output compatible with MRTG. MRTG is not the best method for graphing these temperatures, because all graphs start with zero on the Y axis, and neither the temperature or humidity is likely to be near zero.

MRTG graph of Temperature and Relative Humidity

My program seems to receive advertisements from each thermometer about every ten seconds. I’ve had a friend running the code in his location with a different set of thermometers and it doesn’t get advertisements nearly as frequently. I don’t know if that’s just because environment is different, or if there’s something else going on.

Govee GVH5075 Thermometer Hygrometer

Last week I came across a deal on a small thermometer with display and Bluetooth access for under $10 so I had to give it a try. The fact that the data is available via bluetooth instead of via a web service was a major selling point for me. I am hoping to be able to to log the data via a Raspberry Pi4.

GVH5070 near my Raspberry Pi4

I installed the Govee Home app on my iPhone and it was able to find the device, communicate with it, and pull both current and accumulated data.

When I attempted to find it from my Pi4 it was much more difficult. I live in an apartment with units all around. I’m not just dealing with my own devices that may be visible, but my neighbors as well.

I managed to find the device using linux command line tools, but was not able to successfully connect. A friend suggested BLE Scanner 4.0 for my iPhone for discovering the details, and it was at least able to confirm what I should be looking for using the linux command line tools. I still had timeout issues with the iPhone app, but at least was able to confirm that I could connect to the device and retrieve GUID information.

This is my first time attempting to gather data from a Bluetooth device. I’m still in the research and test phase. I’m listing a bunch of the URLS I’ve found that have been helpful.

https://www.reddit.com/r/Govee/comments/e8ljbp/work_to_access_data_from_a_govee_h5075_indoor/
https://www.jaredwolff.com/get-started-with-bluetooth-low-energy/
https://github.com/neilsheps/GoveeTemperatureAndHumidity
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=241686
https://www.cnet.com/how-to/how-to-setup-bluetooth-on-a-raspberry-pi-3/
https://www.real-world-systems.com/docs/hcitool.1.html

From the command line on my Pi4 I already had the tools installed to try several Bluetooth commands. I believe they were installed as part of the bluez package. The first two commands below get details on the Raspberry Pi Bluetooth hardware, then the hcitool lescan command produced a lot of devices, and I found the line referencing the GVH5075 so I could use the address in further commands.

pi@WimPi4:~ $ sudo hcitool dev
Devices:
        hci0    DC:A6:32:1C:B5:74

pi@WimPi4:~ $ sudo hciconfig -a
hci0:   Type: Primary  Bus: UART
        BD Address: DC:A6:32:1C:B5:74  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING 
        RX bytes:21284 acl:25 sco:0 events:791 errors:0
        TX bytes:4401 acl:26 sco:0 commands:172 errors:0
        Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH SNIFF 
        Link mode: SLAVE ACCEPT 
        Name: 'WimPi4'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous, 
        HCI Version: 5.0 (0x9)  Revision: 0x13b
        LMP Version: 5.0 (0x9)  Subversion: 0x6119
        Manufacturer: Cypress Semiconductor Corporation (305)

pi@WimPi4:~ $ sudo hcitool lescan
LE Scan ...
7B:F9:68:96:C4:92 (unknown)
57:FA:0A:E7:61:A4 (unknown)
A4:C1:38:37:BC:AE GVH5075_BCAE
A4:C1:38:37:BC:AE (unknown)
15:FF:0C:3F:E7:35 (unknown)
57:FA:0A:E7:61:A4 (unknown)

pi@WimPi4:~ $ sudo hcitool leinfo A4:C1:38:37:BC:AE
Requesting information ...
        Handle: 64 (0x0040)
        LMP Version: 4.2 (0x8) LMP Subversion: 0x22bb
        Manufacturer: Telink Semiconductor Co. Ltd (529)
        Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Another command that I attempted before I used the hcitool command was the bluetoothctl command. It scrolls a lot of data, but now that I have an idea what I’m looking at, I may be able to see announcement data from the thermometer periodically in the stream by filtering just to see the data coming from the MAC address.

pi@WimPi4:~ $ sudo bluetoothctl
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Controller DC:A6:32:1C:B5:74 Discovering: yes
[NEW] Device 57:75:EA:B6:EC:2B 57-75-EA-B6-EC-2B
[NEW] Device E7:E7:B4:AB:4A:1F 846B219FB80338A3E9
[NEW] Device 48:56:2E:FF:59:45 48-56-2E-FF-59-45
[NEW] Device 46:53:2F:D4:6F:A1 46-53-2F-D4-6F-A1
[NEW] Device 5C:C9:C5:C9:70:5F 5C-C9-C5-C9-70-5F
[NEW] Device 48:CF:F7:19:4A:3A 48-CF-F7-19-4A-3A
[NEW] Device 4E:30:D1:5D:0F:48 4E-30-D1-5D-0F-48
[NEW] Device 7D:4A:A3:81:32:22 7D-4A-A3-81-32-22
[NEW] Device 7E:0F:63:2B:DC:3E 7E-0F-63-2B-DC-3E
[NEW] Device 7F:5D:37:A2:4E:BA 7F-5D-37-A2-4E-BA
[NEW] Device 7F:6B:44:CD:3A:E5 7F-6B-44-CD-3A-E5
[NEW] Device 00:07:80:37:BD:35 00-07-80-37-BD-35
[NEW] Device 04:52:C7:BC:1C:E3 LE-Bose Revolve SoundLink
[NEW] Device 4F:84:D2:AC:59:FF 4F-84-D2-AC-59-FF
[NEW] Device 4E:F0:6A:DD:3D:7E 4E-F0-6A-DD-3D-7E
[NEW] Device 75:25:34:3F:B9:29 75-25-34-3F-B9-29
[NEW] Device 60:EC:A4:49:B6:67 60-EC-A4-49-B6-67
[NEW] Device 98:D6:BB:20:EB:3B 98-D6-BB-20-EB-3B
[NEW] Device 78:13:28:A8:0A:FF 78-13-28-A8-0A-FF
[NEW] Device 56:6F:B2:E0:40:E3 56-6F-B2-E0-40-E3
[NEW] Device 69:D9:38:44:5C:04 69-D9-38-44-5C-04
[NEW] Device 56:63:50:90:82:D6 56-63-50-90-82-D6
[CHG] Device A4:C1:38:37:BC:AE RSSI: -43
[CHG] Device A4:C1:38:37:BC:AE ManufacturerData Key: 0xec88
[CHG] Device A4:C1:38:37:BC:AE ManufacturerData Value:
00 03 32 62 64 00 ..2bd.
[CHG] Device A4:C1:38:37:BC:AE ManufacturerData Key: 0x004c
[CHG] Device A4:C1:38:37:BC:AE ManufacturerData Value:
02 15 49 4e 54 45 4c 4c 49 5f 52 4f 43 4b 53 5f ..INTELLI_ROCKS_
48 57 50 75 f2 ff c2 HWPu…
[CHG] Device 75:25:34:3F:B9:29 RSSI: -83
[NEW] Device 47:10:2F:15:99:2E 47-10-2F-15-99-2E
[NEW] Device B8:31:B5:8B:12:D2 ETOBAN386
[NEW] Device F0:6E:0B:D1:1B:BF ELRWLK345
[CHG] Device 75:25:34:3F:B9:29 RSSI: -72
[CHG] Device 7D:4A:A3:81:32:22 RSSI: -89
[CHG] Device 7D:4A:A3:81:32:22 RSSI: -81
[CHG] Device 98:D6:BB:20:EB:3B RSSI: -94
[NEW] Device A4:83:E7:20:06:5B A4-83-E7-20-06-5B
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Key: 0x05a7
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Value:
03 13 31 68 39 63 51 6f 4b 76 54 34 00 ..1h9cQoKvT4.
[NEW] Device 00:07:80:37:CA:7D 00-07-80-37-CA-7D
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Key: 0x05a7
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Value:
03 12 78 4d 32 49 31 6d 31 6a 6f 32 67 ..xM2I1m1jo2g
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Key: 0x05a7
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Value:
03 10 01 99 44 de ad be ef 00 0a 00 ca ….D……..
[CHG] Device 4E:30:D1:5D:0F:48 ManufacturerData Key: 0x004c
[CHG] Device 4E:30:D1:5D:0F:48 ManufacturerData Value:
10 06 10 1e b0 2a e1 be …..*..
[CHG] Device 98:D6:BB:20:EB:3B RSSI: -85
[NEW] Device 00:07:80:37:BE:C9 523
[CHG] Device 5C:C9:C5:C9:70:5F ManufacturerData Key: 0x004c
[CHG] Device 5C:C9:C5:C9:70:5F ManufacturerData Value:
10 06 5a 1e 56 a0 e1 eb ..Z.V…
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Key: 0x05a7
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Value:
03 13 31 68 39 63 51 6f 4b 76 54 34 00 ..1h9cQoKvT4.
[CHG] Device 75:25:34:3F:B9:29 RSSI: -81
[NEW] Device 6B:C2:D2:28:1E:A5 6B-C2-D2-28-1E-A5
[CHG] Device 5C:C9:C5:C9:70:5F ManufacturerData Key: 0x004c
[CHG] Device 5C:C9:C5:C9:70:5F ManufacturerData Value:
0c 0e 00 41 32 56 c8 79 5a 01 9d 63 d5 79 c7 80 …A2V.yZ..c.y..
10 06 56 1e 56 a0 e1 eb ..V.V…
[CHG] Device A4:C1:38:37:BC:AE RSSI: -35
[CHG] Device A4:C1:38:37:BC:AE ManufacturerData Key: 0xec88
[CHG] Device A4:C1:38:37:BC:AE ManufacturerData Value:
00 03 32 61 64 00 ..2ad.
[CHG] Device A4:C1:38:37:BC:AE ManufacturerData Key: 0x004c
[CHG] Device A4:C1:38:37:BC:AE ManufacturerData Value:
02 15 49 4e 54 45 4c 4c 49 5f 52 4f 43 4b 53 5f ..INTELLI_ROCKS_
48 57 50 75 f2 ff c2 HWPu…
[CHG] Device 48:CF:F7:19:4A:3A RSSI: -76
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Key: 0x05a7
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Value:
03 10 01 99 44 de ad be ef 00 0a 00 ca ….D……..
[NEW] Device 78:11:F9:E8:7A:DA 78-11-F9-E8-7A-DA
[CHG] Device 47:10:2F:15:99:2E RSSI: -84
[CHG] Device 69:D9:38:44:5C:04 RSSI: -83
[CHG] Device 47:10:2F:15:99:2E ManufacturerData Key: 0x004c
[CHG] Device 47:10:2F:15:99:2E ManufacturerData Value:
10 06 1c 1e 9a e0 28 9b ……(.
[CHG] Device 5C:C9:C5:C9:70:5F ManufacturerData Key: 0x004c
[CHG] Device 5C:C9:C5:C9:70:5F ManufacturerData Value:
0c 0e 00 42 32 7b fc b2 b6 a1 46 31 82 0f 67 02 …B2{….F1..g.
10 06 56 1e 56 a0 e1 eb ..V.V…
[CHG] Device 75:25:34:3F:B9:29 RSSI: -73
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Key: 0x05a7
[CHG] Device E7:E7:B4:AB:4A:1F ManufacturerData Value:
03 13 31 68 39 63 51 6f 4b 76 54 34 00 ..1h9cQoKvT4.
[CHG] Device 47:10:2F:15:99:2E ManufacturerData Key: 0x004c
[CHG] Device 47:10:2F:15:99:2E ManufacturerData Value:
10 06 14 1e 9a e0 28 9b ……(.
[NEW] Device 5C:53:86:8D:A4:61 5C-53-86-8D-A4-61
[NEW] Device 42:32:EC:5F:59:C5 42-32-EC-5F-59-C5
[bluetooth]# scan off
Discovery stopped
[CHG] Device E7:E7:B4:AB:4A:1F TxPower is nil
[CHG] Device E7:E7:B4:AB:4A:1F RSSI is nil
[DEL] Device E7:E7:B4:AB:4A:1F 846B219FB80338A3E9
[CHG] Controller DC:A6:32:1C:B5:74 Discovering: no
[CHG] Device 42:32:EC:5F:59:C5 TxPower is nil
[CHG] Device 42:32:EC:5F:59:C5 RSSI is nil
[CHG] Device 5C:53:86:8D:A4:61 RSSI is nil
[CHG] Device 78:11:F9:E8:7A:DA TxPower is nil
[CHG] Device 78:11:F9:E8:7A:DA RSSI is nil
[CHG] Device 6B:C2:D2:28:1E:A5 TxPower is nil
[CHG] Device 6B:C2:D2:28:1E:A5 RSSI is nil
[CHG] Device 00:07:80:37:BE:C9 RSSI is nil
[CHG] Device 00:07:80:37:CA:7D RSSI is nil
[CHG] Device A4:83:E7:20:06:5B RSSI is nil
[CHG] Device F0:6E:0B:D1:1B:BF TxPower is nil
[CHG] Device F0:6E:0B:D1:1B:BF RSSI is nil
[CHG] Device B8:31:B5:8B:12:D2 TxPower is nil
[CHG] Device B8:31:B5:8B:12:D2 RSSI is nil
[CHG] Device 47:10:2F:15:99:2E TxPower is nil
[CHG] Device 47:10:2F:15:99:2E RSSI is nil
[CHG] Device A4:C1:38:37:BC:AE RSSI is nil
[CHG] Device 56:63:50:90:82:D6 RSSI is nil
[CHG] Device 69:D9:38:44:5C:04 TxPower is nil
[CHG] Device 69:D9:38:44:5C:04 RSSI is nil
[CHG] Device 56:6F:B2:E0:40:E3 TxPower is nil
[CHG] Device 56:6F:B2:E0:40:E3 RSSI is nil
[CHG] Device 78:13:28:A8:0A:FF TxPower is nil
[CHG] Device 78:13:28:A8:0A:FF RSSI is nil
[CHG] Device 98:D6:BB:20:EB:3B RSSI is nil
[CHG] Device 60:EC:A4:49:B6:67 TxPower is nil
[CHG] Device 60:EC:A4:49:B6:67 RSSI is nil
[CHG] Device 75:25:34:3F:B9:29 TxPower is nil
[CHG] Device 75:25:34:3F:B9:29 RSSI is nil
[CHG] Device 4E:F0:6A:DD:3D:7E TxPower is nil
[CHG] Device 4E:F0:6A:DD:3D:7E RSSI is nil
[CHG] Device 4F:84:D2:AC:59:FF TxPower is nil
[CHG] Device 4F:84:D2:AC:59:FF RSSI is nil
[CHG] Device 04:52:C7:BC:1C:E3 TxPower is nil
[CHG] Device 04:52:C7:BC:1C:E3 RSSI is nil
[CHG] Device 00:07:80:37:BD:35 RSSI is nil
[CHG] Device 7F:6B:44:CD:3A:E5 TxPower is nil
[CHG] Device 7F:6B:44:CD:3A:E5 RSSI is nil
[CHG] Device 7F:5D:37:A2:4E:BA TxPower is nil
[CHG] Device 7F:5D:37:A2:4E:BA RSSI is nil
[CHG] Device 7E:0F:63:2B:DC:3E TxPower is nil
[CHG] Device 7E:0F:63:2B:DC:3E RSSI is nil
[CHG] Device 7D:4A:A3:81:32:22 TxPower is nil
[CHG] Device 7D:4A:A3:81:32:22 RSSI is nil
[CHG] Device 4E:30:D1:5D:0F:48 TxPower is nil
[CHG] Device 4E:30:D1:5D:0F:48 RSSI is nil
[CHG] Device 48:CF:F7:19:4A:3A TxPower is nil
[CHG] Device 48:CF:F7:19:4A:3A RSSI is nil
[CHG] Device 5C:C9:C5:C9:70:5F TxPower is nil
[CHG] Device 5C:C9:C5:C9:70:5F RSSI is nil
[CHG] Device 46:53:2F:D4:6F:A1 TxPower is nil
[CHG] Device 46:53:2F:D4:6F:A1 RSSI is nil
[CHG] Device 48:56:2E:FF:59:45 TxPower is nil
[CHG] Device 48:56:2E:FF:59:45 RSSI is nil
[CHG] Device 57:75:EA:B6:EC:2B TxPower is nil
[CHG] Device 57:75:EA:B6:EC:2B RSSI is nil
[DEL] Device 57:75:EA:B6:EC:2B 57-75-EA-B6-EC-2B
[DEL] Device 48:56:2E:FF:59:45 48-56-2E-FF-59-45
[DEL] Device 46:53:2F:D4:6F:A1 46-53-2F-D4-6F-A1
[DEL] Device 5C:C9:C5:C9:70:5F 5C-C9-C5-C9-70-5F
[DEL] Device 48:CF:F7:19:4A:3A 48-CF-F7-19-4A-3A
[DEL] Device 4E:30:D1:5D:0F:48 4E-30-D1-5D-0F-48
[DEL] Device 7D:4A:A3:81:32:22 7D-4A-A3-81-32-22
[DEL] Device 7E:0F:63:2B:DC:3E 7E-0F-63-2B-DC-3E
[DEL] Device 7F:5D:37:A2:4E:BA 7F-5D-37-A2-4E-BA
[DEL] Device 7F:6B:44:CD:3A:E5 7F-6B-44-CD-3A-E5
[DEL] Device 00:07:80:37:BD:35 00-07-80-37-BD-35
[DEL] Device 04:52:C7:BC:1C:E3 LE-Bose Revolve SoundLink
[DEL] Device 4F:84:D2:AC:59:FF 4F-84-D2-AC-59-FF
[DEL] Device 4E:F0:6A:DD:3D:7E 4E-F0-6A-DD-3D-7E
[DEL] Device 75:25:34:3F:B9:29 75-25-34-3F-B9-29
[DEL] Device 60:EC:A4:49:B6:67 60-EC-A4-49-B6-67
[DEL] Device 98:D6:BB:20:EB:3B 98-D6-BB-20-EB-3B
[DEL] Device 78:13:28:A8:0A:FF 78-13-28-A8-0A-FF
[DEL] Device 56:6F:B2:E0:40:E3 56-6F-B2-E0-40-E3
[DEL] Device 69:D9:38:44:5C:04 69-D9-38-44-5C-04
[DEL] Device 56:63:50:90:82:D6 56-63-50-90-82-D6
[DEL] Device 47:10:2F:15:99:2E 47-10-2F-15-99-2E
[DEL] Device B8:31:B5:8B:12:D2 ETOBAN386
[DEL] Device F0:6E:0B:D1:1B:BF ELRWLK345
[DEL] Device A4:83:E7:20:06:5B A4-83-E7-20-06-5B
[DEL] Device 00:07:80:37:CA:7D 00-07-80-37-CA-7D
[DEL] Device 00:07:80:37:BE:C9 523
[DEL] Device 6B:C2:D2:28:1E:A5 6B-C2-D2-28-1E-A5
[DEL] Device 78:11:F9:E8:7A:DA 78-11-F9-E8-7A-DA
[DEL] Device 5C:53:86:8D:A4:61 5C-53-86-8D-A4-61
[DEL] Device 42:32:EC:5F:59:C5 42-32-EC-5F-59-C5
[bluetooth]# exit

I’m posting all of this here and hopefully will be able to make progress on retrieving the data in the next few days.

TaoTronics Bluetooth Transmitter connected to my Samsung Soundbar

A couple of years ago I bought a discount sound bar to use as my computer speaker. I’ve been really happy with the sound quality. It’s connected via an optical cable to my computer and has a separate subwoofer.

This summer I moved into a new apartment, and during the last month I’ve run into a problem. One of my neighbors seems to be connecting to my soundbar via Bluetooth.

By watching the display I was able to at least learn what brand device was connecting. I still don’t know the exact model name. https://www.taotronics.com/bluetooth-transmitter-reset.html shows how to reset the device itself. Unfortunately my soundbar doesn’t have a way of setting the Bluetooth pairing code, or resetting the handshake with any devices that may want to connect with it, or fully disabling Bluetooth. https://www.samsung.com/us/support/owners/product/2015-soundbar-w-subwoofer-hw-j355

When I first noticed the problem, the sound bar was in a mode that would let Bluetooth turn on the sound bar, which was extremely frustrating when I was nearly asleep and the soundbar would start playing noises for no reason. That caused me to learn how to disable the Bluetooth power on feature of the sound bar.  Now at least it will only switch to Bluetooth when I’m actually using the soundbar for computer output.

The TaoTronics devices seem to be able to connect to multiple devices at the same time. I’m guessing that my neighbor has no idea that they are connecting to a second device at all. Obviously it’s built to make connecting to devices as easy as possible.

If anyone has suggestions on how to reject an already paired device from Bluetooth, I’d love to see it in the comments. I’m willing to use one of my Raspberry Pi devices that supports Bluetooth to see if there’s a way to send an interrupt signal.