Govee Immersion LED Strip Driver - Govee Cloud API

@fegriffith

This means something being passed in the call to the Govee API is not valid.

Did you run

Compare the device mac information with what you put in.

I think the second error you mentioned is simply a result of the first call failing..

The model number is important as it is used in the call to the Govee API to identify your device. That has to be correct and if not correct will generate the error you provided.

@mavrrick58 it was actually your driver code that made me aware that the mac addresses I got (one from the "hotspot through the phone method, the other in the app itself) were wrong. The messages thrown from your driver showed me that my mac addresses were not correct.

So I just ran the cmd prompt, and I have confirmed I have the correct mac addresses (which I had corrected when I saw them in your driver to begin with), and confirmed I'm using the correct model numbers.

I'm still getting errors.

I have now since started over with the H6141 device, and managed to add it, and I also have it set up as a tile in one of my dashboards, working as expected.

The H6159 is still eluding me.

@fegriffith

That still looks like the values you put in for the configuration are wrong in some way. Check and make sure you don't have any blank spaces around the values.

Looking at those errors it looks like the driver failed when it initially tried to setup the device for the first time. It looks up to see if it is retrievable. Then it looks like you tried to do something and that is what caused the bad request. Again these are parm issues.

1 Like

@mavrrick58 thank you very much for your responsiveness! I don't know why, but I had to remove it more than once, and add it again more than once...and ultimately I probably should have walked away and given it a rest. BUT, perseverance pays off. LOL. I finally have both sets of lights being recognized properly by Hubitat.

I am back. So I have some information to share, and another series of questions. I think there is some kind of issue with the driver from @Obi2000, but don't know enough about what I'm looking at to try to fix it. @mavrrick58 I am tagging you as well because 1) you were very helpful before, and 2) you have also worked with writing a driver, and might have some ideas of what I can try.

H6148 work the same as H6141. They recognize On/Off, RGB and ColorTemp (but their color temp is way better reproduction due to the white led). All options associated with "color bulb" work in the dashboard (color, temp, brightness). As a side, Hey Google also works in changing the colors with the proper wording (soft light instead of warm light, but others work as expected).

When grouping H6141 OR H6148, all options EXCEPT brightness work in the dashboard (and as a side note, Hey Google as well). I am seeing some errors in the logs that I don't understand. I feel like I'm so close (isn't that always the case). Google confirms it is changing the brightness, but then just doesn't. The slider goes up and down in the dashboard, but there is no adjustment made to the lights. This is only with the group. Individually, they do everything as expected. But grouped, they do everything EXCEPT brightness.

This is the error I am seeing, and I'm hoping it makes sense to someone else.

[dev:221] 2021-01-30 11:29:48.922 am [info] Upper Cabinets [G] level was set to 51%

[dev:217] 2021-01-30 11:29:48.918 am [error] groovy.lang.MissingMethodException: No signature of method: user_driver_Obi2000_Govee_Immersion_LED_Strip_550.setLevel() is applicable for argument types: (java.lang.Integer, java.lang.Integer) values: [51, 1]
Possible solutions: setLevel(java.lang.Object) (setLevel)

I'm happy to provide any additional information, just please be specific in what you need and if it isn't obvious, how I get it.

I'm also happy to try to do any kind of testing with the lights that I have, again, knowing you'd have to be pretty specific as I'm pretty much a newbie who has done a TON of reading and am willing to learn, but don't exactly know what I'm doing. I mean, I've got 4 sets of lights in here now, working...and even managed to figure out how to splice some of them together...but yeah, just enough knowledge here to be dangerous. I have the H6141, H6159 and H6148.

ETA: It seems that the group does in fact change the brightness, however the delay is many seconds...at least 25. I was walking away before it would implement the change. I still think there's an issue here with this delay and error message that I just don't understand, but maybe that will add more information that is helpful.

When you setup the group action do you specify the duration. The govee api and as a result the driver doesn't support using duration as part of the setlevel command. It looks like that error is including a duration value for the parms passed.

I set up a group, and there is no entry in the duration field, in the group, or in either of the individual lights.

ETA I've noticed when using the dashboard to change brightness, I have to close the tile out to the main dashboard before it even tries to make the change.

I just confirmed this is relates to the duration value. When submitting the command from the device itself you have more control of what is actually passed to the driver. Unfortunately when you add apps into the mix like what does the groups on Hubitat it can include parma you dont intend to. Perhaps the driver can be updated to ignore the duration value if passed.

1 Like

O.k., that is beyond my ability for sure. Hopefully @obi2000 sees this and is willing to look into it.

I was just looking at your original driver, and I see you actually have something that indicates duration=0 in the SetLevel area.
But I don't know what all this means.

def setLevel(BigDecimal lev,BigDecimal duration=0) {
def goveeUrl = "https://developer-api.govee.com/v1/devices/control"
def headers = [:]
headers.put("Govee-API-Key", authorization)
headers.put("Content-Type", deviceContent)
def body = [:]
body.put("device", deviceID)
body.put("model", deviceModel)
def gvCmd = [:]
gvCmd.put("name", "brightness")
gvCmd.put("value", lev)
body.put("cmd",gvCmd)
if (logEnable) log.debug "Sending on put request to [${goveeUrl}] to turn on device"
if (logEnable) log.debug "JSON String to Govee : ${body}"
try {
httpPutJson([uri: goveeUrl, headers: headers, body: body]) { resp ->
if (resp.success) {
sendEvent(name: "Level", value: lev, isStateChange: true)
}
if (logEnable)
if (resp.data) log.debug "${resp.data}"
}
} catch (Exception e) {
log.warn "Call to off failed: ${e.message}"
}

I don't know if it actually DOES make the duration 0, but if I had to guess I'd say that was part of the intent for this piece.

I added a small fix to ignore the duration value if it is sent. Sorry I didn't get to this till now, been pretty sick today. Go ahead and try downloading the latest version @fegriffith

@obi2000 this fixed the issues I was seeing and I thank you SO much. I just noticed the issue earlier today so I certainly can't ask for a better response than what you provided. THANK YOU.

On a personal note, please take care of yourself and get better.

I really appreciate your contribution of this driver, and that you are supporting it "on demand" today. Thank you very much. If you need anyone to test anything for you on the strips I have, I'm happy to try to help.

Related to the product choices.
New Hubitat owner. Would like to add a bunch of LED strips.

So looking at the Govee product line, they seemed to be self contained systems with their own remotes. I dont understand how that connects to hubitat. Do all the govee products support zwave? Or is it only the wifi products?

I am going to buy one of the strips that folks here say they were successful with but would like to understand the integration point!

ty for the help, and for this driver!

EDIT: I just noticed this "Govee provided cloud API"... so the govee strip connects out to the cloud, and we are controlling by sending messages to the cloud API?

That is exactly right. This driver just sends commands to the cloud API and that in turn tells the strip what to do. This means though this driver integrates the strips and it does work. Some stuff not not function 100% if that API doesn't support it. The real advantage Govee has is price. I need to update the table above as some folks also have the API added to Home Assistant and thete table is more complete right now.

There are a few Zigbee and one Zwave strip if you dont mind paying a little bit more for more complete integration. I have a zigbee controller and switch from Giderwel and it works great as well. Inovelli has a really nice zwave option the launced in the last few months. It is also an addressable strip which ia nice.

The big reason to go Govee will be cost. If you dont mind spending more then the other options may be nice. I have been very impressed with Giderwel.

The other thing is sometimes Govee supports something that isnt exactly obvious or available with the others. I have the Govee Immersion TV Light strip with the camera and that is really nice and the only similar product is from Philips hue and is a few hundred bucks. Govee has two of them make sure you get the newer one.

Thank you for the reply!

yes the price seems awesome, and the reviews/support seem very good.
I want to upgrade my backyard lighting. Want lights around the pool, back of house, shed etc. Was looking at "Pixels" which is just way overkill in cost (the Holiday individual adressable stuff).

really loving hubitat (cross over from wink) so the govee products seem like a great match for me (cost with color). I dont need the individually adressable pixels. Although seems they have a new controllable segment line

I'll wait to see the update list before buying today... or i'll look up at they other site

thanks!

EDIT: I am looking at your other suggestions also

@vp4hire to answer your earlier question about whether all Govee products support zwave, or only the wifi products, if it doesn't say wifi, or google/amazon compatible, it is Bluetooth only.

I have 3 different types of Govee in my home now. The first strip was H6159 RGB wifi and I didn't really know what I was doing (still don't). That is on my television and I only use it for an ambient light feature. I'm very happy with it.

Next came the H6141 RGB wifi. I put those on my upper kitchen cabinets to replace what the previous owner had done. They had a string of Christmas lights just spread out across the top, plugged into an outlet that was powered via a switch on the wall at the counter top. So that was an improvement from what it was.

I then decided to do the lower cabinets as well. I successfully installed, with splicing no less, another set of H6141 under the cabinets. And I will tell you, I do regret that decision mainly because they just don't have a good enough white for a kitchen counter space. For me. Down the rabbit hole I went, and now I've got a set of H6148 installed. I'm pretty happy with those.

In the end, I'm thinking I should have gone more the way that @mavrrick58 is suggesting. Overall it's been a learning experience for me as a newbie.

I think one point that still confuses me is trying to understand why I might want to have Zigbee over Zwave. I'm getting the impression that if I have a good mesh network, Zigbee might be more responsive.

If I have one piece of advice about Govee...keep in mind that their strips are all RGB (no real white), or RGB IC, which they say theirs can't be cut/spliced. I was just happy I figured out how to cut/splice with regular 4-pin RGB so I wasn't going to mess with RGB IC. If you want a strip that also has better whites, then you will need the RGBWW, and those only come in 9.8 feet (for the newer version). I have successfully cut/spliced this (they are 6-pin) to go around my microwave, but I do keep reading these are not intended to be chained due to power issues. So for each set, you are supposed to provide its own power supply rather than splicing two together to come up with 20 feet. And it took me a few tries to successfully splice them back together. I am unsure how white the whites are on RGB IC as I haven't tried any of those yet.

Honestly it all depends on what you are doing. I can't suggest enough the Govee H6199 Immersion TV Kit. The next closest thing is the Phillips Hue TV kit which costs way to much for addressable TV ambient lights. That kit is addressable and works fantastic. if your TV is the right size for it. 55" is just a tad on the small size if your TV is nearly bezel-less. I have now tried 4 strips and only kept 2. I also had the Govee H6104 which was their Dreamcolor based TV kit. It missed a few key things and there is no reason to get that with the H6199 out at all.

One big point i would say with Govee is make sure the the strip you get is returnable. That means that Hubitat knows the state of the strip if you change it from some other means. I believe the driver checks the strips current stat every so often so it knows if it is turned on or off.

There are advanced features that you can do with bluetooth you can't do from hubitat or wifi either so keep that in mind. The H6104 is a good example of that. It really could just control color and brightness through wifi. Allot of the functionality is lost unless you connect with bluetooth. The H6199 enables pretty much everything remotely. I would suggest getting the Immersion version of the Govee strips if at all possible.

The other two options I tried were related to Giderwell. The key thing with them is they basically sell you a strip and the zigbee controller created by Gledpato. Both of the strips i tried were RGBWW and work great. Basically i got the shorter one first and then went to the bigger one once I found that my potential use place was different and needed the longer strip.

I am fery impressed with the Ginderwell strip. It is bright lights up my pantry fantastic. Because is it is Zigbee and uses the generic RGBW LED Strip driver it works fully with Hubitat. Color seem to be great with it as well, but i don't really use them as much.

One thing to point out about the Zigbee controller is that it gives you the ability to actually run 2 strips from it if you have a good enough powersupply. It also has the ability to use a 12v or 24v power supply with the correct strips and can use a barrel connector or direct wire connector if you have low voltage DC power already run to a location.

The reason you will hear alot of LED strip places length limits is because voltage drops over a distance which is a problem with DC power. So you run the risk of having dimmer LED's once you get past a certain distance in the strip. This is why you have things like the Gledpato controller saying instead of running 32ft of LED strips you connect 2 16ft strips to one controller. Have the two strips attached to the one controller prevents the voltage loss over the distance.

I like the Inovelli idea. I haven't gotten one yet, but am considering it. If nothing else but then to try it out. I love the idea that they are addressable and somehow that is allowed to work from Hubitat as I understand it. It may be a great option for addressable LED's if that is how you want to go. I also suspect the flexibility with the module design of it also will allow for better reliability, but of course that is a unknown at this point

I am also considering buy just a gledpato controller just for my undercabinent lights so i can remove and redeploy my smartplug that is currently running it. They run on 12v so i should be able to simply splice the controller into the power source and now they are zigbee controlled :).

Zwave vs Zigbee is a whole different dicussion, Generally speaking though they both accomplish the same thing, and as long as you have enough always on router devices in the network both are pretty reliable

I updated the table above with support for the API confirmed by the Home Assistance folks with their integration. The API is the same so it should be valid for us as well.

NOOB here to using any custom driver or wifi device like this.

But wanted to get my Govee bias lighting working with everything else.

I got my API, and installed the custom driver. Then added a virtual device, typed in my API and device model and what I "thought" was the correct MAC address.

But no luck at all.

Thinking I have the wrong MAC address, and no idea how to get the correct one (I am on a MAC, so not sure if that makes this more difficult).

Here is the log I keep seeing when trying to turn the device on from the device page.

Any help would be awesome!

Second attempt log:

Can you use the curl command. If so can you submit this above command and just substitute your API Key in the string.

I keep attempting this in terminal, but keeps saying
Miss API Keycurl: (6) Could not resolve host: Govee-API-Key

This is all very new and foreign to me, I've never even used Terminal on here before!