Govee BLE Thermometer/Hygrometer sensor

No, either one should be enough if the MAC addresses are correct. I don’t think the Alexa Media Player would interact with HA via Bluetooth. Place the one that is inside next to the host. The one outside likely is out of range but until the indoor sensor display data there is no way to confirm it is not another issue…

1 Like

Thought some might find something of interest in these graphs. I am still doing some analysis of the data and I do have a couple other sensors that I may add to the tests.

Of the sensors I have tried, the units that yield the finest granularity of reading for both temperature and humidity are the Govee H5052 (no longer available) and H5074. The Xiaomi LYWSD03MMC with custom code is at the same level in it’s temperature data, but does not yield the same number of samples for the humidity readings.

This analysis says nothing about the absolute accuracy of any of the readings, it may be possible to extract some relative comparison between sensors.

Okay! After commenting out the outside H5101 in my configuration.yaml, moving the kitchen H5101 directly next to the bluetooth, and doing a full physical laptop shutdown and restart (and restart of HASS.OS)…

Success!!! I can get a reading!!
image

The weird thing is my iPhone Govee app can read both bluetooth sensors and I am sitting next to the laptop with it. So I’m kinda doubting it is a sensor range issue.

Next step will be to uncomment the outdoor sensor in the configuration.yaml and try again with two sensors configured. It is really cold outside, not sure if that has to do with the statistics.StatisticsError previously seen?

I’ll post what happens.

Okay, so I managed to break it again…

image

When two H5051 are in my configuration.yaml, I don’t get any readings. That was the only change I made. I did notice an interesting thing in the VM console. Not sure if these files are related?

The error probably killed the polling thread for the component. This component captures the BLE advertisement while the app connects directly via Bluetooth. The difference is that if the app can sync the data from the devices memory if it there is interference. You may want to try the beta release for the outdoor temperature. I am in upstate New York and it is currently 29F outside; the beta version should handle freezing temperatures for the H5101.

1 Like

The next test I will do is isolation test the outdoor sensor. I will bring it in next to me, 1 foot from the bluetooth USB. I will comment out the kitchen sensor. This will accomplish a few things. 1. It should double confirm the MAC address. 2. It will let us know if it is a distance issue. 3. Depending on its temp reading at the time, it may tell us if it is temp range issue.

Based on what you are saying, it sounds like you may have a fix for the low temps in the beta version? I’ll have to look around for that. I’m assuming it would be on github…

It is starting to point to #2 - a possible distance issue.

image

Next step is to enable both in my configurations.yaml and see if that works.

At this point, I’m unsure if it is a distance issue or low temp issue…

Okay, so we have success with two sensors now. I’m still unsure if it is a distance thing (since my iphone Govee app can read them from anywhere in the house) or if it was related to low temp.

image

Thanks for all of your help getting this working!!

1 Like

I have two H5101 sensors that have been running fine with my phone and the Govee app, but now I want to add them to Home Assistant. Trying to get this set up and running in to some issues. I’m running HA as a docker container on a Raspberry Pi 4b. I’m new to a lot of the HA pieces and even newer to Raspberry Pi and Docker, so bear with me a little bit.

I’ve installed through HACS and added the sensor in configuration.yaml. Restarted both the RPI and the container a few times, but nothing shows up. Put one of the H5101 right next to the RPI to make sure it wasn’t a distance problem, no luck. If I run bluetoothctl, I can see the device. I enabled debug logging, but the only thing I see is [custom_components.govee_ble_hci.sensor] Starting Govee HCI Sensor

Anything I’m missing?

Are you using the Home Assistant rPi 4 build or are you running Home Assistant on a docker container on something like Raspbian? If the second, you probably are missing the --privileged flag in the docker run command.

I am running HA in a docker container on Raspbian. How do I add the privileged flag? Sorry for my ignorance in basic Docker commands.

It will depend on how you started it. If it was started using a command similar to docker run ..., then it would be docker run --privileged ...

I originally started the container with

docker run --init -d --name="home-assistant" -e "TZ=America/New_York" -v /home/pi/homeassistant:/config --net=host homeassistant/raspberrypi4-homeassistant:stable

and later set it to start automatically when the RPI starts up. It doesn’t look like you can add privileged the same way. How do I add that without overwriting all the changes I’ve made?

The -v is used to the mount home assistant’s config externally. Stop and remove the container, then bring it back up with the correct flags. Assuming you set restart to “unless-stopped”, then the command would be:

docker run --init -d --restart unless-stopped --privileged --name="home-assistant" -e "TZ=America/New_York" -v /home/pi/homeassistant:/config --net=host homeassistant/raspberrypi4-homeassistant:stable

All of your information should be when it returns but it the libraries/dependencies will need to be installed. Home Assistant does not indicate that is it doing this in the background, the interface will sluggish and a few items will not appear immediately or display correctly for a few minutes while this it installs them (depending on the number of the dependencies, size, etc). You refresh the page to see the progress.

Hey there! Love this project! Any plans for adding support for the H5179 model? Thanks!

No, the H5179 appears to be a WiFi thermometer. This component is only for Bluetooth.

@Thrilleratplay
I updated the plugin to the most recent version… 0.8.0, I’m getting these errors:

Logger: root
Source: /usr/src/homeassistant/homeassistant/bootstrap.py:312
First occurred: 11:39:07 AM (1 occurrences)
Last logged: 11:39:07 AM

Uncaught thread exception
Traceback (most recent call last):
File “/usr/local/lib/python3.8/threading.py”, line 932, in _bootstrap_inner
self.run()
File “/usr/local/lib/python3.8/threading.py”, line 870, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python3.8/site-packages/bleson/providers/linux/linux_adapter.py”, line 58, in _socket_poller
data = self._socket.recv(1024) # blocking
BrokenPipeError: [Errno 32] Broken pipe

Logger: homeassistant
Source: custom_components/govee_ble_hci/sensor.py:190
First occurred: 11:40:07 AM (1 occurrences)
Last logged: 11:40:07 AM

Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/govee_ble_hci/sensor.py”, line 190, in update_ble_loop
adapter.start_scanning()
File “/usr/local/lib/python3.8/site-packages/bleson/providers/linux/linux_adapter.py”, line 276, in start_scanning
self.set_scan_enable(False)
File “/usr/local/lib/python3.8/site-packages/bleson/providers/linux/linux_adapter.py”, line 132, in set_scan_enable
self.write_buffer(cmd)
File “/usr/local/lib/python3.8/site-packages/bleson/providers/linux/linux_adapter.py”, line 51, in write_buffer
self._socket.send(data)
OSError: [Errno 77] File descriptor in bad state

You had this same issue before in September. Did you update from v0.5? If so, as I do not know why you and you alone are having these issues, I think it is best you stay on v0.5.

Did you ever get this working? I have a remote RPI that I’d like to just use to collect the data and then pass it via MQTT. I’d be curious to see how you made it work.