Govee Immersion LED Strip Driver - Govee Cloud API

Yo! I wrote this driver for use with my Govee Immersion LED strip. I couldn't find any other Hubitat Govee drivers. So I thought I'd leave this here for people to use. I don't see why it wouldn't work with any other Wifi Govee LED strips. But I don't have any to test with so ymmv. @mavrrick58 has been keeping a list of devices that work with this driver, Check it out.

This uses the Govee provided cloud API. As far as I know there isn't anything local available. Also the API isn't super great. You only get basic bulb control, no changing to music or movie mode or whatever. If they update their API, I'll try to add support to the driver. But, I'm a bad coder so please feel free to use any of this to make a better driver if you want.

To use this you need 3 things:
First you need to get an API key from Govee. You can request one in their app, under the about us section.

Then you need a device mac address and model number for the driver. For some reason the device address Govee uses isn't necessarily the same as the actual address. So an easy way to get it is to query their server using your API key.
Under Windows, from a command prompt run:

curl --location --request GET "https://developer-api.govee.com/v1/devices" --header "Govee-API-Key: xxxxxxxxxxxxx"

Replace the xxxxxxx with your real API key of course.

You'll get a response from the server listing device and model

Now just grab my driver code from here, and add it to Hubitat.
Hubitat/Govee_Immersion_LED_Strip.groovy at master · Obi2000/Hubitat (github.com)

Add a new virtual device, change it's driver type to Govee Immersion, and fill in your API Key, device address, and model.

Then you should be good to go.

Update: If you are having problems getting your device address. I added a way for the driver to automatically detect it. See this post for details.

21 Likes

AWESOME!!! Works with my model H6163 perfectly!

You beat me to this by a day. I got my driver working today. Something to keep in mind is that not all devices support all functions. I have H6104 and it doesn't seem to like the status lookup.

This is what I got with the driver.

dev:2372021-01-06 11:33:27.907 pm errorcallURL() <<<<<<<<<<<<<<<< ERROR <<<<<<<<<<<<<<<<

dev:2372021-01-06 11:33:27.903 pm errorgroovyx.net.http.HttpResponseException: Bad Request

dev:2372021-01-06 11:33:27.900 pm errorError: e.statusCode 400

dev:2372021-01-06 11:33:27.896 pm errorcallURL() >>>>>>>>>>>>>>>> ERROR >>>>>>>>>>>>>>>>

It looks like the driver doesn't like the H6104. You may want to do some kind of device look up when the driver first loads to see if the device is retrievable. I know the H6104 isn't after manually submitting it, and testing some of the calls. I think that is what failed for me.

My driver isn't doing a get status since my device didn't support the function. I haven't gotten color fully working though.

If you want to compare or if others want to try both it is at
https://raw.githubusercontent.com/Mavrrick/Hubitat-by-Mavrrick/main/govee_driver.groovy

With this driver you can just click refresh on the virtual device and it will do a device lookup. Then look at the hubitat logs and it will show you the device info. You still need the API-Key, Model and serial number configured to actually get anything to happen on the API.

1 Like

I was looking at the API Doc and just wanted to post this for folks. The list of devices supported are below. This is 33 different devices. The interesting thing is that this means this driver will do more then just support RGB Strip lights. It will also support thier smartplugs, lamps, and even a wall switch if it is sold. I can't seem to find it anywhere other then their app. What we don't know for sure is how well each device is supported.

Govee Device Device type Device Name On/Off RGB ColorTemp Status Updates Alternate Set Level Needed
H5001 Light Switch Smart Light Switch No No
H5081 Smart Plug Smart Plug Yes No No
H6002 Unknown Unknown
H6003 Light Bulb Wi-Fi RGBWW LED Bulb Yes Yes Yes
H6050 Table Lamp Wifi Table Lamp
H6052 Table Lamp Aura Table Lamp Yes Yes Yes
H6054 Light Bar Flow Pro Light Bar Yes Yes Yes
H6083 Unknown Unknown
H6085 LED Bulb Wi-Fi Warm White LED Bulb
H6086 LED Bulb WI-FI RGB LED Bulb
H6089 LED Bulb WI-FI RGB LED Bulb
H6104 Led Strip RGBIC for TV with Alexa Yes Yes No** No No
H6109 Led Strip 2*5m Multicolor with Alexa
H6110 Led Strip 2*5m Multicolor with Alexa Yes Yes Yes
H6117 Led Strip 2*5m RGBIC with Alexa Yes Yes
H6135 Unknown Unknown
H6137 Unknown Unknown
H6141 Led Strip 5m Smart Multicolor Strip Light Yes Yes Yes
H6142 Led Strip 2*5m Smart MultiColor Strip Light Yes Yes Yes
H6143 Led Strip 5m RGBIC Strip Light
H6144 Led Strip 2*5 RGBIC Strip Light
H6148 Led Strip 3m Color & White ambiance with Alexa
H6159 Led Strip 5m Multicolor with Alexa Yes Yes Yes Yes
H6160 Led Strip 5m Multicolor with Alexa Yes Yes No
H6163 Led Strip 5m RGBIC with Alexa Yes Yes Yes
H6182 Led Strip Wi-Fi MultiColor TV Strip Light Yes Yes Yes
H6188 Led Strip 2m Color & White Ambiance with Alexa Yes Yes Yes
H6195 Led Strip 2*10m Smart Multicolor Strip Light Yes Yes Yes
H6199 Led Strip Immersion TV Strip Light Yes Yes Yes Yes No
H7005 Unknown Unknown
H7014 Smart Plug Smart Plug No No
H7021 Unknown Unknown
H7022 Led String Wifi MultiColor String Light
No**- Color Temp reported as supported, but not functional

I did make changes to your driver. May shelf mine. I like your flow, though mine works almost completely I like the structure of yours allot better. I reactivated your section that does the device lookup and added it to the update section so it will list that when updated. I then also added a switch so it won't do the get status so that devices are not retrievable don't cause errors.

2 Likes

Something I have noticed today is I can't for the life of me get the H6104 to change color temp. I have noticed now that it is only avaliable when i connect to the strip with bluetooth. It seems like the bluetooth interface and the wifi interfaces on some devices may have different abilities.

I have take the driver and created a driver for just plugs/switches as well.

Good idea! I went ahead and added a check for retrievability when you save your device ID to the driver. And if your device doesn't support it the call to the server wont be made.

I tried looking into the CT problem on the H6104 and it looks like other people are having trouble changing it using the API also. I guess it just doesn't support it for now.

I think the clue to what is happening here is a limitation of the device. What I have noticed is that when I use my phone to connect to the strip the options are different depending on if my phone is using Bluetooth vs just wifi. When it appears to be connected with wifi it seems to be seen only as a wifi strip. I just have on/off and RGB color settings. Once my phone connects with Bluetooth I can then set modes, scenes, and the color temp for white light.

I wonder what the new H6199 is like in this reguards. With all of my recent research in the API I have found it looks like Govee just released several new strips under the Immersion branding. The H6104 uses a dreamcolor strip.

@Obi2000

So I emailed Govee's API Support the other day and the response I got was intresting, but not unexpected. Simply put I asked 3 things.

  1. Why can't the H6104 do a get status since their API doc says it can.
  2. Why doesn't Color Temp work.
  3. Will the expand the usage of the API to support more features like setting Movie mode or custom routines.

The response simply was as followed.

  1. It can't as it doesn't support it for retrieve device status so it won't work.
  2. Please set using color and brightness
  3. They would forward the information to development to be evaluated.

So nothing to unexpected there, but it does raise the question of reliability of their documentation for their devices. I mean heck the API even returns that the H6104 supports setting Color temp, but they just responded with it doesn't.

Tested this with my H6141 strip and it appears to work well, thanks for the hard work!

I'll see how it works long term - I've had my strip added through Homebridge so far and using Node-RED, but I've been having to run the commands through a repeat node because it's been setting colour but not brightness, or the brightness but not the colour. Hopefully, this works out more consistent :slight_smile:

just tested with my 6159 and work well !! thx for the work

was wondering if there was a way to put it into a tile on the dashboard????

I dont see why you couldn't put on the dashboard like any other color bulb.

Can you check all of the functions. Like changing color and color temp. Can you also tell me if the bulb shows retrievable. I will update the above table.

on/off, color change, color temp all works pretty good

State Variables

  • hasRetrievable : true guess it mean it s retrievable!!!

when i go to my dash board then add tile govee led strip does not appear in the device list...???

Make sure the dashboard has permissions to the device.

I've read that some Govee devices expect a brightness range of 0-254, instead of the default 0-100. If you notice that setting your device to 100% in Hubitat is much dimmer than 100% using the app, this is likely the reason.

I added a new option Alternate Brightness Range, for people to use if this is the case. I think the API still returns brightness values from 0-100% when you request status in both cases though. But if not I can do the same adjustment on the status data as well.

Ah, that's too bad. I hope eventually you get a firmware update that adds the color temperature at least. Glad you asked about the API, maybe if enough people ask about it they will improve it. I know I'd love to be able to change modes.

On your dashboard which template are you using for your light strips? I chose Color Bulb but color control didn't work. I see people have color temp working so I don't know if they are directly accessing the device page or if they are using a different template.

Actually color is workihg now.

Where can i see that???

Go to the Apps section, Then Hubitat Dashboard and click your Dashboard. In the settings there is either an option to include all devices, or a list where you select which devices can be used.
Dashboard '

I'm still running update 2.2.2.129 so the picture might be slightly different, but you get the idea.

@Obi2000

Thanks alot srry for the noob question!!!
And thx for your work on the govee immersion!!!!

First, I want to thank @Obi2000 for his/her work on this driver.

And second, I'm stuck and need help. I am a newbie, however I've been reading a LOT, have successfully implemented other drivers and user applications, gotten those configured, set up automations, etc. I haven't actually written anything myself, so I don't know how to troubleshoot the errors I'm getting.

I have two different Govee led strips. I have the H6159, which I can see is working successfully with the driver in this thread. However, I can't get mine to work correctly. I am also working with the H6141 led strip, and that, too, is returning an error.

The H6159 is returning [error]groovyx.net.http.ResponseParseException: Bad Request
[error]Error: e.statusCode 400

The H6141 is returning the same errors. And I just saw an additional one ava.lang.NullPointerException: Cannot get property 'retrievable' on null object on line 210 (updated).

I have my user API key, I know my model numbers, and I have confirmed my mac addresses. The mac addresses are added into the device with the colons (not sure if that matters), and the model number, while required, I assume is really just "telling" me what it is and I could probably put anything in there, but again not sure. I've got each entered with the H6159, and H6141 respectively.

I can turn on and off in the browser, but it doesn't actually "do" anything to the lighting. The status changes as expected online, but it's not actually working.

I know I'm not doing a very good job of describing this, mostly because I don't even know what part could be wrong on my end.

Any help would be appreciated.