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.

Can you try to enable debug logging on the org.openhab.binding.bluetooth.govee package? That should provide a bit more insight into what is going on.

If that doesn’t provide enough information you can also enable debug logs for the org.openhab.binding.bluetooth package as well.

I have enabled the debugging. Is this any use?

Govee logs:

00:18:23.580 [DEBUG] [govee.internal.GoveeHygrometerHandler] - Initializing Govee Hygrometer A4:C1:38:39:F9:B2 settings
00:18:23.582 [DEBUG] [govee.internal.GoveeHygrometerHandler] - sending message: GetOrSetTemWarningCommand
00:18:27.248 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - waiting for connection
00:18:27.249 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - connection successful
00:18:27.250 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - discovering services
00:18:27.749 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - service discovery successful
00:18:27.749 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Service discovery completed for ‘A4:C1:38:39:F9:B2’
00:18:27.751 [DEBUG] [govee.internal.GoveeHygrometerHandler] - Failure to initialize device: Service with uuid 494e5445-4c4c-495f-524f-434b535f4857 could not be found. Retrying in 30 seconds
00:18:29.275 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Service discovery completed for ‘A4:C1:38:39:F9:B2’
00:18:57.753 [DEBUG] [govee.internal.GoveeHygrometerHandler] - Initializing Govee Hygrometer A4:C1:38:39:F9:B2 settings
00:18:57.755 [DEBUG] [govee.internal.GoveeHygrometerHandler] - sending message: GetOrSetTemWarningCommand
00:19:00.119 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - waiting for connection
00:19:00.120 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - connection successful
00:19:00.803 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Wrote 3304000000000000000000000000000000000037 to characteristic 494e5445-4c4c-495f-524f-434b535f2011 of device A4:C1:38:39:F9:B2
00:19:00.995 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Wrote AA010000000000000000000000000000000000AB to characteristic 494e5445-4c4c-495f-524f-434b535f2012 of device A4:C1:38:39:F9:B2
00:19:01.259 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Service discovery completed for ‘A4:C1:38:39:F9:B2’
00:18:27.751 [DEBUG] [govee.internal.GoveeHygrometerHandler] - Failure to initialize device: Service with uuid 494e5445-4c4c-495f-524f-434b535f4857 could not be found. Retrying in 30 seconds
00:18:29.275 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Service discovery completed for ‘A4:C1:38:39:F9:B2’

Bluetooth logs:

00:24:04.630 [DEBUG] [oth.bluez.internal.BlueZBridgeHandler] - Found 2 Bluetooth devices.
00:24:04.643 [DEBUG] [h.bluez.internal.BlueZBluetoothDevice] - updateBlueZDevice(BluetoothDevice [device=org.bluez:/org/bluez/hci0/dev_A4_C1_38_39_F9_B2:interface org.bluez.Device1, adapter=/org/bluez/hci0, getBluetoothType()=DEVICE, getDbusPath()=/org/bluez/hci0/dev_A4_C1_38_39_F9_B2])
00:24:04.708 [DEBUG] [h.bluez.internal.BlueZBluetoothDevice] - updateBlueZDevice(BluetoothDevice [device=org.bluez:/org/bluez/hci0/dev_A4_C1_38_70_C2_86:interface org.bluez.Device1, adapter=/org/bluez/hci0, getBluetoothType()=DEVICE, getDbusPath()=/org/bluez/hci0/dev_A4_C1_38_70_C2_86])
00:24:10.844 [DEBUG] [h.bluez.internal.BlueZBluetoothDevice] - Received manufacturer data for ‘A4:C1:38:70:C2:86’: 88 EC 00 02 67 52 64 00
00:24:10.856 [DEBUG] [h.bluez.internal.BlueZBluetoothDevice] - Received manufacturer data for ‘A4:C1:38:70:C2:86’: 4C 00 02 15 49 4E 54 45 4C 4C 49 5F 52 4F 43 4B 53 5F 48 57 50 75 F2 FF C2
00:24:10.862 [DEBUG] [nternal.BlueZPropertiesChangedHandler] - PropertiesPath: /org/bluez/hci0/dev_A4_C1_38_70_C2_86
00:24:10.868 [DEBUG] [nternal.BlueZPropertiesChangedHandler] - PropertiesChanged: { ManufacturerData => [{ 60552 => [[B@55824e],76 => [[B@a91f9d] }] }
00:24:14.741 [DEBUG] [oth.bluez.internal.BlueZBridgeHandler] - initializeAndRefreshDevice()
00:24:14.794 [DEBUG] [oth.bluez.internal.BlueZBridgeHandler] - Found 2 Bluetooth devices.
00:24:14.808 [DEBUG] [h.bluez.internal.BlueZBluetoothDevice] - updateBlueZDevice(BluetoothDevice [device=org.bluez:/org/bluez/hci0/dev_A4_C1_38_39_F9_B2:interface org.bluez.Device1, adapter=/org/bluez/hci0, getBluetoothType()=DEVICE, getDbusPath()=/org/bluez/hci0/dev_A4_C1_38_39_F9_B2])
00:24:14.864 [DEBUG] [h.bluez.internal.BlueZBluetoothDevice] - updateBlueZDevice(BluetoothDevice [device=org.bluez:/org/bluez/hci0/dev_A4_C1_38_70_C2_86:interface org.bluez.Device1, adapter=/org/bluez/hci0, getBluetoothType()=DEVICE, getDbusPath()=/org/bluez/hci0/dev_A4_C1_38_70_C2_86])

From the logs it looks like it is able to successfully connect to the device and write to the characteristic, but I don’t see any sort of notifications being received for that characteristic. It is almost like the device isn’t responding. Can you give me the govee logs over a 5 minute period?

Sorry for delay. As my original system was an upgraded openhab2, I decided to do a fresh install to make sure everything is as vanilla as it can be. Unfortunately I seem to have logging issues on the new install. As soon as I resolve them I will post some logs. Thanks.

OK here are 5 min Govee logs. I believe the first warning happens on device removal.

10:37:47.442 [WARN ] [govee.internal.GoveeHygrometerHandler] - Unknown Exception occurred
java.util.concurrent.CancellationException: null
at org.openhab.binding.bluetooth.util.HeritableFuture.cancel(HeritableFuture.java:92) [bundleFile:?]
at org.openhab.binding.bluetooth.util.HeritableFuture.cancel(HeritableFuture.java:97) [bundleFile:?]
at org.openhab.binding.bluetooth.util.HeritableFuture.cancel(HeritableFuture.java:97) [bundleFile:?]
at org.openhab.binding.bluetooth.util.HeritableFuture.cancel(HeritableFuture.java:97) [bundleFile:?]
at org.openhab.binding.bluetooth.util.HeritableFuture.cancel(HeritableFuture.java:97) [bundleFile:?]
at org.openhab.binding.bluetooth.govee.internal.GoveeHygrometerHandler.dispose(GoveeHygrometerHandler.java:171) [bundleFile:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
10:39:44.438 [DEBUG] [govee.internal.GoveeHygrometerHandler] - Initializing Govee Hygrometer A4:C1:38:39:F9:B2
10:39:44.443 [DEBUG] [govee.internal.GoveeHygrometerHandler] - Identified Govee device A4:C1:38:39:F9:B2 model H5075
10:39:44.458 [DEBUG] [govee.internal.GoveeHygrometerHandler] - Initializing Govee Hygrometer A4:C1:38:39:F9:B2 settings
10:39:44.464 [DEBUG] [govee.internal.GoveeHygrometerHandler] - sending message: GetOrSetTemWarningCommand
10:39:55.752 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - waiting for connection
10:39:55.756 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - connection successful
10:39:55.760 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - discovering services
10:39:56.646 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Service discovery completed for ‘A4:C1:38:39:F9:B2’
10:39:56.646 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - service discovery successful
10:39:56.917 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Wrote 3304000000000000000000000000000000000037 to characteristic 494e5445-4c4c-495f-524f-434b535f2011 of device A4:C1:38:39:F9:B2
10:39:56.986 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Wrote AA010000000000000000000000000000000000AB to characteristic 494e5445-4c4c-495f-524f-434b535f2012 of device A4:C1:38:39:F9:B2
10:42:21.903 [DEBUG] [govee.internal.GoveeHygrometerHandler] - sending message: GetBatteryCommand
10:42:21.917 [DEBUG] [govee.internal.GoveeHygrometerHandler] - sending message: GetTemHumCommand
10:42:21.932 [DEBUG] [govee.internal.GoveeHygrometerHandler] - sending message: GetTemHumCommand
10:42:24.570 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - waiting for connection
10:42:24.576 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - connection successful
10:42:25.249 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Wrote AA080000000000000000000000000000000000A2 to characteristic 494e5445-4c4c-495f-524f-434b535f2011 of device A4:C1:38:39:F9:B2
10:42:25.443 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Wrote AA0A0000000000000000000000000000000000A0 to characteristic 494e5445-4c4c-495f-524f-434b535f2011 of device A4:C1:38:39:F9:B2
10:42:25.687 [DEBUG] [ee.internal.ConnectedBluetoothHandler] - Wrote AA0A0000000000000000000000000000000000A0 to characteristic 494e5445-4c4c-495f-524f-434b535f2011 of device A4:C1:38:39:F9:B2

Hi All,
but when you execute the “SCAN” (by the button), do you find “H5075” ?

I have found my Govee H5075 devices using scan in the bluetooth binding. However, it looks like they are only recognized as beacons, and do not automatically link to the Govee binding.
If you are not seeing them by using the scan function, try scanning multiple times consecutively. The scan interval seems to be shorter than the beacon’s transmission interval.

@cpmeister, thank you very much for your efforts and contribution.

Similar to @YeT’s results, I cannot get the binding to return any readings other than the RSSI from my H5075 units. I have tried both adding them manually using the .things and .items file, as well as using the web gui.

I have six H5075 units and I am willing to help debug. Just let me know how.

PS: Is there (or should there be) a related issue in the OpenHab GitHub project? I was not able to find one.