custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.9k stars 245 forks source link

Govee H5074 Issues #909

Closed jazz127 closed 1 year ago

jazz127 commented 2 years ago

Hello. Firstly, thanks for this awesome module - it's really helping my with my HA Setup goals.

I have a number of Govee Hygrometers with different models - H5074, H5101, H5075 mainly. The H5101 & H5075 work wonderfully - I get data points every few minutes at least. Unfortunately, with the H5074, I'm lucky to see data once an hour, it chops and changes around so much, very very sporadic.

I don't think it's a signal issue, this happens if the H5074 is right next to the receiver, RSSI sits around 40. The 5101&5075 are a lot further away and run about 100.

Using other tools, I can see the advertisements for the 5074 models floating around in the air regularly. My setup is a NUC running KVM, I have the onboard Intel bluetooth in the Host ubuntu (that i see the advertisements on) and another adapter passed through to my HA OS appliance VM. So technically I'm using different cards to verify the advertisements are being received at the moment (I can't get the intel to work when passed through via KVM).

I have enabled the Active Scanning - the 5074's didn't really work at all until i manually added the MAC address as a device in BLE config page. After I added them, i started getting the sporadic data. I actually added them manually to enable unknown advertisement logging - i couldn't believe it when i started seeing SOME data. I'm also catching messages like this from the H5074's fairly regularly

2022-06-27 22:48:27 INFO (Thread-3) [custom_components.ble_monitor.ble_parser] BLE advertisement received from MAC/UUID a4c1389c232c: 043e330d011300002c239c38c1a40100ff7fb000000000000000000019020106030388ec1109476f7665655f48353037345f32333243

Not sure if it will be helpful but I also get 2x "Apple iBeacon" devices registered. These are rather weird to me - the MAC address seems to constantly change between various devices (inc my 5074s and other govee MAC addresses).

Is anyone able to provide any assistance or ideas on how I can get my H5074's working more reliably? Thank you very much in advance!

Ernst79 commented 2 years ago

iBeacons constantly change their mac, that is why we add them based on the uuid. This is normal behavior and is related to privacy, I thought.

i will have a look at the ble message later today. If you can collect some more, it might give us a clue what is wrong.

Ernst79 commented 2 years ago

I had a look at the BLE advertisement. The data is always in the part after the zeros.

020106 = flags 030388ec = UUID16 (88EC is common for Govee) 1109476f7665655f48353037345f32333243 = Name

The name translates to Govee_H5074_232C (hex to text).

So, this message doesn't contain data, only the name of the device.

Perhaps you can make a longer log with more BLE advertisements.

Ernst79 commented 2 years ago

any change to get some more data?

Ernst79 commented 2 years ago

Could you try 9.0.1. There has been a fix for Govee Sensors that add extra bytes to the data. It might be related to your issue, not sure, but its worth to try.

jazz127 commented 2 years ago

Terribly sorry for my slow reply. a few things

One theory I do have is that maybe the display & detail of the data is clouding my judgment here - it seems that a 5074 entry is only showing one decimal point in the logs whereas other models show more (examples below). Perhaps because there isn't as much variance, somewhere along the line of the module/HA, the point isn't recorded/shown because the there isn't any change in the data?

2022-07-18 18:23:58 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Data binary sensor received: {'firmware': 'Govee', 'temperature': 21.4, 'humidity': 51.38, 'battery': 100, 'rssi': -102, 'mac': '', 'type': 'H5074', 'packet': 'no packet id', 'data': True}

2022-07-18 18:24:42 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Data binary sensor received: {'firmware': 'Govee', 'temperature': 25.7615, 'humidity': 61.5, 'battery': 96, 'rssi': -58, 'mac': '', 'type': 'H5072/H5075', 'packet': 'no packet id', 'data': True}

Ernst79 commented 2 years ago

The number of decimals is not something to worry about, the have different formulas to decode the data, on resulting in more decimals than the other. Govee isn't really consistant in how the format the BLE message with different devices.

At the moment we are working of moving BLE monitor into Home Assistant as core integrations. (one integration for each brand). Govee is most likely to make it in the next release of Home Assistant, so my advise would be to wait and try it with the Home Assistant core integration after 2022.8. However, if you have multiple brands of BLE sensors, keep in mind that BLE monitor probably won't work nicely together at the same time with these new core integrations (as often only one integration can use the Bluetooh dongle at the same time).

Ernst79 commented 1 year ago

Closing this issue to keep things clean. In case this issue is still relevant, please reopen it.