Govee Integration V2

Hi. I found this integration a few days ago. I'm struggling with it a bit though.
I'm trying to control my 2 Lyra lamps, H6072. I don't really know how, but there's a diySceneOptions : {3981221=mood}. When I activate this on the device page, I get a scene on my Lyra that's close to a scene I created, but all the colors are just a bit off, too cold.

Also, how do I call up scenes and effects, or use the segmented color RGB in rule machine?

Note, I've not been able to get the Govee app to show LAN control for both my Lyra's.

The Lyra lamps are certainly able to be controlled via LAN API. Sometimes the option can take up to 15 seconds or so to appear under the settings menu. Also make sure you are on the same wifi network with the device. You may also need to turn off Bluetooth on your phone as some have reported that. I don't think that should be needed, but it can't hurt to try if it isn't appearing.

When your devices are using the cloud API they should retrieve the number codes for the Snapshots/DIYScenes/Scenes when setup. If they are going through the Govee Cloud API and since it isn't local there is nothing my Govee Integration is doing to control the scene. It is all stored in Govee's Cloud. We are just pulling the reference number and then sending that number back to the API to trigger it. Does it look off when you just trigger it from the Govee Home App.

The associated number should be next to the Scenes value in the State Section. Just find the number associated with the scene name you want and enter that value for setEffect. That will trigger your scene/effect. Here is an example of my state values for the Govee Nightlight.

This is a bit more complicated. You will want to pass the values needed by the command. It requires the segments values in a [x,y,z] format and the number of possible segments isn't exactly clear based on expirience. You may need to experiment, but start with 0 for the first segment and work your way up to find the max segment. The color value I will need to look into. Simply put there is allot of conversion between the entry on the device page and what is actually sent to Govee. I am not sure how to put in the value for the color pick in RM. It is a color map. Let me see what I can figure out.

So in rule machine you would need to use the option to do a custom action on a actuator. It would be the command Segmented Color RGB. Then you would need to pass two values. The first one is the list of segments in braces so an example would be something like

[0,3,6] 

The second value would be the map value of the color it would be something like

[hue:0, level:100, saturation:0]

Once those are entered it should work. It is kind of a pain to do in RM, but i don't know of a better way to do it.

Wow, thank you so much for your reply, this will help a lot!

I have tried all the tricks to get the lan control to show in the app, but it just won't.

I also found my DIY 'mood'. It's based on a scene I created, but I couldn't get the colors right. But with the segmented RGB in RM I'm positive I can recreate it. I will try the day after tomorrow. Sleep now, work tomorrow morning.

1 Like

I tried as you suggested but unfortunately it doesn't work.
I input both as strings, but when I activate it, I get this message:

I also tried adding spaces after the comma's but no luck.

I am confused about the V2 integration, specifically for the Air Purifier driver. (I am sure this isn't the last time I am befuddled LOL)

With V1, there were mode numbers you could use in Rule Machine, and you would use "Actuator" with an integer value that corresponded with what speed you wanted. I.E. using the below values, I enter number 2 to get medium in Rule Machine.



With V2, things seem to be a lot more complicated. I also can't get Rule Machine to turn the device on using the only Actuator command that makes any sense, Working Mode. (see screenshot below)



Entering values 1 through 6 in the number don't seem to do anything, or is the wrong command. I also tried using the names in the table below, like "gearMode, value=1" and even "name=gearMode, value=1". None of which seem to do anything.




I am not sure what I am doing wrong here? The device works from the device page itself, the integration works fine.

It just seems like going from this:


image


to this more complex way below threw a monkey wrench into the works, at least as far as Rule Machine is concerned.


image

A bit changed with the new commands in the new api vs the old one. That is what triggered the situtation you are talking about.

The new API uses working Mode for several thing across many devices. Because of how that was implemented and my initial desire to try to present things as close to the API calls as possible working mode often has things that apply to one mode but not others in the command.

It has crossed my mind a few times to create more commands in hubitat that call the same api endpoint to effectively take some of the guess work out . I just always get hung up with device specific stuff.

If drivers in hubitat could have the commands be more dynamic i could present only valid options and commands for users. That limitation has led to allot of my decisions for a few commands on many devices.

Part of the issue is the API supports over 150 devices. I try to keep the drivers as generic as i can so to minimize the devices drivers folks need to download.

@mavrrick58

I have an issue with the conversion. I have 2 -6172 light strips. I followed the directions to convert by adding the hashtags and then getting the new devices under the device manager. They are present.

Here is the issue. My #1 strip shows up as a device to select in my rules but the #2 strip does not. I deleted the #2 strip and had the govee app find it again, which it did, but it's not showing up as a device to select in the rules.

Both devices work from the device page as lan devices.

Any ideas?

That is really strange. By chance did it get added back with a different name then what it was set in Hubitat.

I hade a few were i had renamed then once they were created on hubitat originally. Then when i added them back i forgot i changed the name. Had a hell of a time until i realized that.

1 Like

Yep. That's it. It's an old man error

Ok i goofed up with what i provided you.

No braces and no space in between. The color variable.

So the second variable should look like this

hue:0,level:100,saturation:0

The order of the variables shouldn't matter just no spaces or braces.

It works flawlessly now, thank you!

@mavrrick58

Is anyone else having issues with effects?

I have a couple 6172 strips that have been working perfectly. I updated to 2.3.9 this morning and also updated the govee V2 integration this morning. I'm on the very latest of both.

Effects are not working on either strip. I can turn them on and off and set color but nothing happens when setting effects from within RM or the device page.

I also just noticed my devices are not longer children of the device manager. I'm restoring a backup to see what happens.

@mavrrick58

Restoring from last night's backup has fixed it. My strips are once again children of the device manager and are displaying effects.

Will be curious to see if anyone else runs into any issues

That is really strang that they were pulled out from below the Govee Device Manager. I tested 2.3.9 from early on and have not seen any issues with the integration. I saw a few issues, but not with Govee.

I will keep an eye out to this thread incase anyone else has issues.

1 Like

I thought it odd too. Thankfully, with HE you can restore a backup. It was also strange that everything worked except effects. The only thing I can think of is database corruption but not sure when that would have happened. The hub is on a battery backup

1 Like

I've just updated to the newest version of the app and I've run into a bit of problem. I noticed that my DIY scenes were not working, so I checked the app's state variables and that looked ok so I refresh my device's scene awareness and noticed I got an error in the log. I've tried several refreshes of the device list, device updates, etc. with no luck. I even cleared the DIY scene information but the child device is just not connecting with the parent.

I am a bit confused - is Govee Integration Local or Cloud or both?
Specifically I am looking for the Smart Kettle but ony with 100% local integration, no clouds.

@OldChicagoPete

I will take a look and see what i can find.

@vitaliy_kh

Some Govee Light devices have a LAN API and can be 100% local.

There are also some recent devices that support Matter that i believe are local. A couple of new Govee Life devices are getting Matter. The new tower fan is an example. I think more devices are coming with Matter support.

Almost everything that has wifi supports the Cloud API and LAN API is fairly common on most new light devices, but not guarenteed.

The integration works with both the LAN and Cloud API based on if the decice supports it. It defaults to Cloud API by default once you add a API Key to the Integration. Then if the device supports you you change a setting for the device in hubitat and enter the IP address.

To more simply answer your question I do not think they have a kettle that is Lan API enabled.

Thank you very much for the quick response and explanation. What I don't want at all - is anything cloud-based, everything must be 100% local. I will wait and see if Govee will make (or update existing) Matter-enabled Kettle.
As of today my dumb Kettle is automated for On/Off functions but in addition I would like to add "keep warm" function. I can do this by sticking a temp sensor to the Kettle but my wife don't want this.