Playing with Golang parsing of Govee temperature hydrometers
Processing overheard BTLE advertisements from Govee devices requires this library to be always-active-scanning. This will prevent bluetooth use by other devices. If you need bluetooth for other services, consider buying a USB dongle?
This library should be refactored to allow all overheard advertisements to be captured externally - and a subset filtered / passed into Govee temp processing (to allow maximum re-use of advertisements received by the blocked BLE device).
I have observed anamalous jumps in temperature readings by 4 degrees - yet humidity values show no such jumps. I'm exploring possible causes.
- This Home Assistant Forum Post
- Perhaps the best I've found
I liked This project layout advice, and am leveraging it.
TODO: Review vs This
For Ubuntu 20.04 Rpi 3 This worked for me:
sudo apt-get install pi-bluetooth
sudo vim /boot/firmware/usrcfg.txt
paste in include btcfg.txt and save
sudo reboot
Device shows up now with:
hcitool dev
sudo bluetoothctl
scan on
Look for your Govee_HS074_XXXX
- E3:60:58:E1:90:E3 Govee_H5074_90E3
Or (simpler?):
sudo hcitool -i hci0 lescan --duplicates --passive
There are Bluetooth scanners available on Google Play Store.
With stderr-based logging at info and higher
sudo go run cmd/govee-mon/main.go --logtostderr
curl http://localhost:2112/metrics
scrape_configs:
- job_name: myapp
scrape_interval: 10s
static_configs:
- targets:
- localhost:2112
This issue appears identical to that posted by Martso:
- Govee advertisements are overheard
- But not the shorter ones containing temp data
Well, somehow got it working – some combination of manually resetting the hci interfaces and enabling active scanning.
sudo hciconfig hci0 down
sudo go run cmd/govee-mon/main.go
Worked for me.