Govee Bluetooth Binding

Since the Govee Bluetooth binding was just merged into the main branch it is currently available in the OH 3.1 snapshot. This topic will be to address any bugs or feature requests regarding this binding.

2 Likes

Hi,

Thanks so much for creating this. I am probably not the ideal tester as I didn’t use this addon in Openhab2. However, in openhab3 latest snapshot, I am finding the GVH5075 successfully, but it is not recognised as a Govee Monitor. I have had a look in the logs and the message is:
2021-03-01 08:08:16.835 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘bluetooth:generic:hci0:[a4:c1:38:etc]’ to inbox.

Occasionally the device appears as GVH5075_C286 but it is still not recognised as a Govee monitor. The device was bought about 6 weeks ago.

I have also tested a second device bought at the same time with the same issue and the same first 6 characters in address a4:c1:38

Anything i should try?

There might be a bug in my auto discovery mechanism. I never tested discovery with the H5075. As a workaround just create the thing manually with the goveeHygrometerMonitor type. You will have to manually specify the bluetooth device address and set the model config to H5075.

Thanks for getting back so quickly. I’ve now created it manually but cant see a “model” config option. I added it manually to the code anyway so i now have this:

UID: bluetooth:goveeHygrometerMonitor:hci0:12620d407a
label: Govee Monitoring Hygrometer A
thingTypeUID: bluetooth:goveeHygrometerMonitor
configuration:
temperatureWarningMax: 0
humidityWarningMax: 0
address: A4:C1:38:AA:AA:AA
humidityWarningMin: 0
refreshInterval: 300
temperatureWarningMin: 0
temperatureWarningAlarm: false
model: H5075
humidityWarningAlarm: false
bridgeUID: bluetooth:bluez:hci0
location: Living Room

log
[INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘bluetooth:goveeHygrometerMonitor:hci0:12620d407a’ changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Failed to initialize device: null

Well shoot. I just checked and model is a thing property, not a config. So I guess you don’t have a way to configure this. Without a model configured the handler will default to the behavior of model H5074. That model is similar enough that you shouldn’t have any problems reading or calibrating the temperature but you won’t be able to use the temperature/humidity warning range feature.
Hopefully that should be good enough for you atm.

I’ll definitely have to put in a fix for this. Thanks for bringing this up.

I wish I noticed this from your post sooner. When I checked into the code it looks like an unhandled error occurred during initialization.

I find it rather upsetting that the error’s message is null since that tells me pretty much nothing about what actually went wrong. Unfortunately there is nothing you can do to provide me with more detail about the error without me making some code changes first. I’ll make some changes tomorrow and give you a snapshot jar that I hope will either fix or help narrow down the problem.

Thanks for this, and thanks again for your efforts. I suspect debugging with a device you dont own is the road to madness!!!

I have a bluetooth explorer and can see the devices sending out data
its not clear what is what, but if there is anything like that that will help let me know.

K, I’ve made a few changes to autodiscovery and some extra logging for null error messages. Just make sure to uninstall the built-in govee binding and then dump this jar into your addons directory.

https://github.com/cpmeister/openhab-addons/raw/blind-engine-snapshots/org.openhab.binding.bluetooth.govee-3.1.0-SNAPSHOT.jar

Hopefully this should provide a bit more insight into what is going on.

Great progress! Recognised the test units as a things and identified them as H5075. However there seems to be a value mapping issue. Only RSSI values are returning correctly. The others seem to be updating but with no result (null). Is there any other log I can look at for more info? Thanks again.

2021-03-02 22:33:08.364 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘bluetooth:goveeHygrometerMonitor:hci0:a4c13870c286’ changed from UNINITIALIZED to INITIALIZING

2021-03-02 22:33:08.383 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘bluetooth:goveeHygrometerMonitor:hci0:a4c13870c286’ changed from INITIALIZING to UNKNOWN

2021-03-02 22:34:12.282 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘GoveeTemperatureHumidityMonitor2_RSSI’ changed from NULL to -75

2021-03-02 22:34:29.858 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘GoveeTemperatureHumidityMonitor1_RSSI’ changed from -70 to -78

2021-03-02 22:34:46.135 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘GoveeTemperatureHumidityMonitor1_RSSI’ changed from -78 to -70

2021-03-02 22:35:35.000 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘GoveeTemperatureHumidityMonitor1_RSSI’ changed from -70 to -78

2021-03-02 22:37:00.527 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘GoveeTemperatureHumidityMonitor1_RSSI’ changed from -78 to -70

2021-03-02 22:37:10.523 [INFO ] [openhab.event.ItemUpdatedEvent ] - Item ‘GoveeTemperatureHumidityMonitor2_CurrentMeasuredTemperature’ has been updated.

2021-03-02 22:37:10.535 [INFO ] [openhab.event.ItemUpdatedEvent ] - Item ‘GoveeTemperatureHumidityMonitor2_HumidityWarningAlarm’ has been updated.

2021-03-02 22:37:10.551 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘GoveeTemperatureHumidityMonitor2_RSSI’ changed from NULL to -75.0

2021-03-02 22:37:10.553 [INFO ] [openhab.event.ItemUpdatedEvent ] - Item ‘GoveeTemperatureHumidityMonitor2_RSSI’ has been updated.

2021-03-02 22:37:10.570 [INFO ] [openhab.event.ItemUpdatedEvent ] - Item ‘GoveeTemperatureHumidityMonitor2_TemperatureWarningAlarm’ has been updated.

2021-03-02 22:37:10.604 [INFO ] [openhab.event.ItemUpdatedEvent ] - Item ‘GoveeTemperatureHumidityMonitor2_AtmosphericHumidity’ has been updated.

2021-03-02 22:37:10.703 [INFO ] [openhab.event.ItemUpdatedEvent ] - Item ‘GoveeTemperatureHumidityMonitor2_BatteryLevel’ has been updated.

2021-03-02 22:38:44.445 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘GoveeTemperatureHumidityMonitor2_RSSI’ changed from NULL to -75.0

How did you define your items? Did you use the UI or did you define them in text files?

Also do the things ever go online? It doesn’t seem like they do from the logs you posted.

I used the UI to define the items.

Had a look through the logs - you are right the items remain “UNKNOWN”. I will try manually assigning one just to see if it makes any difference. It does eventually change to offline (though I was running tests at the time this may also have caused it)

2021-03-03 07:55:37.280 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘bluetooth:goveeHygrometerMonitor:hci0:a4c13839f9b2’ changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Timeout waiting for characteristic 494e5445-4c4c-495f-524f-434b535f2011 write to finish

After a reboot of obenhab, they remain unknown and report RSSI only.