Govee Integration V2

Hi @mavrrick58

Thank you for making that change. However, I recently updated to the latest version, but unfortunately, the fix didn't work, even though the changes are taking effect, as evidenced by the lights being on. In fact, I believe some of the other current states are not updating correctly now also.

Some examples:

Please let me know if you need anything else.

Cheers
David

Can you perform a repair to the integration to make sure it has the latest code. It should of been updated, but I am questing it when looking at that image.

If you want to check the code before hand. Go the developer section of Hubitat, select the library tab to display the library packages and then select the package labeled "Govee_Cloud_API". That will display the code. If you scroll down to line 126 you should see the following.

                    sendEvent(name: "switch", value: "on")

That is the line that will set the switch state to on when you submit the Snapshot command.

I just checked the github repo and this line is there.

The reason some of those values are present is because I don't change all of them on every action. Only the relevant ones based on what is being done are modified. I am trying to minimize the load on the hub for effects that have no relation to the current action. If you want to know what values are relevant at a given time the ColorMode value provides some insite into that. That could be update to zero our or add n/a for each value when not relevant, but that is potentially allot of additional events for the hub to handle just to zero out those values.

Can you claify a few things so I know for sure I am looking at the right pieces of code. What are the drivers involved with the given devices and are they using LAN API at all. Snapshots are always a cloud item, but the other options could be impacted depending on where the state is coming from.

Hi @mavrrick58,

In answer to your questions:

As per HPM, this is the version I had before running the repair:

  • Govee Integration v2
    • Govee Integration v2 v2.1.10 (app)
    • Govee Manual LAN API Device v2.1.1 (driver)
    • Govee v2 Color Lights 2 Driver v2.1.2 (driver)
    • Govee v2 Color Lights 3 Driver v2.1.2 (driver)
    • Govee v2 Color Lights 4 Dreamview Sync v2.1.2 (driver)
    • Govee v2 Color Lights 4 Driver v2.1.2 (driver)
    • Govee v2 Color Lights Dreamview Sync v2.1.3 (driver)
    • Govee v2 Color Lights Driver v2.1.2 (driver)
    • Govee v2 Device Manager v2.1.2 (driver)
    • Govee v2 White Light Driver v2.1.0 (driver)

I looked at "Govee_Cloud_API" on line 126, and it does indeed say sendEvent(name: "switch", value: "on").

After running the repair:

  • Govee Integration v2 Donate
    • Govee Integration v2 v2.1.10 (app)
    • Govee Manual LAN API Device v2.1.1 (driver)
    • Govee v2 Color Lights 2 Driver v2.1.2 (driver)
    • Govee v2 Color Lights 3 Driver v2.1.2 (driver)
    • Govee v2 Color Lights 4 Dreamview Sync v2.1.2 (driver)
    • Govee v2 Color Lights 4 Driver v2.1.2 (driver)
    • Govee v2 Color Lights Dreamview Sync v2.1.3 (driver)
    • Govee v2 Color Lights Driver v2.1.2 (driver)
    • Govee v2 Device Manager v2.1.2 (driver)
    • Govee v2 White Light Driver v2.1.0 (driver)

I verified "Govee_Cloud_API" on line 126, and it still says sendEvent(name: "switch", value: "on").

Maybe my eyes are playing tricks on me but they look the same to me?

The drivers for each device are as follows:

  • Device Model: H619A
    • Label: Under Bed Lights
    • Name: Govee v2 Color Lights 3 Driver
  • Device Model: H70A1
    • Label: Deck Rail Lights
    • Name: Govee v2 Color Lights 3 Driver
  • Device Model: H70A1
    • Label: Deck Skirt Lights
    • Name: Govee v2 Color Lights 3 Driver

In the Govee Integration V2 app, under Manual Setup for LAN API Only Devices, nothing is listed. Currently, I have ‘Enable Local LAN control’ set to OFF.

So, I am a bit confused. Before running the repair, it wasn't working correctly, but now it is. I’m at a loss as to why this is the case. Again, I don't see any change in versions.

In any case, thank you for your help and all the information you provided.

Cheers,
David

1 Like

@mavrrick58 I just brought an Govee H7126 Smart Air Purifier will it work with the app? Thanks

That is very strange. By chance did you have the device open the whole time instead of reloading the device page after the update. If you had that line of code prior to the repair you had the latest code loaded. It is almost like for some reason it didn't reload the code after the update was performed the first time. very strange.

I would expect the H7126 to work as it is on the Govee Developer API supported devices list

No, I just read your email, updated, opened Hubitat and tested everything. I'll let you know if I encounter any other issues. Thanks for the great work!

1 Like

@mavrrick58 I just install the Air Purifier and it I'm not having any luck getting it to work. Here is what I'm have? Alos after the update my Floor lamp quit working?

image

That image looks like you tried to setup the Air Purifier as a LAN only device. Govee Life Appliance devices require the Cloud API and do not have any Lan API functionality.

By chance did you setup the Floor Lamp the same way as a Maunual LAN API device?

With that being observed do you have your API key for your account? If not go into the Govee Home App and request it. You will normally get a email with your API Key within just a few min. Once you get it open up the Govee Integration App and add your key in the space for it and save it. Then open the App again and enter the menu option for Standard device setup and add your devices again. This will install then under the Govee V2 Device Manager. If you still want to use Lan API for your floor lamp scroll down and enable the option for LAN Control and click Save. Then enter the IP and Save again.

As to what happened with your floor lamp. My guess is you set it up as a Manual Lan Api device. That driver needs a little TLC and I started to work on it today. So hopefully I will release the updated Manual Lan API driver soon. I am tweaking it to use the Standardized code base so it will have many of the code improvements the other devices already have. The only item i can think that would be broke now though are scenes with that driver.

That said you really should only use the Manual LAN API driver as a last resort if your device can not be added any other way. That is why i suggested adding it again with the Standard setup above. If you have a reason to not do that let me know so i can see if there is a better way to meet your ask.

If my assumptions are above are wrong please turn on debug logging and capture the failure and send it to me for review. I will look through it and see what i can come up with.

The Home Assistant integration for Govee only finds the same 2 devices with no option for manual addition so must be something with device.

I haven't mentioned before but the Ground Lights have an option that others do not; Device Safety. Not understanding what that was I flipped it on when I first added the lights to Govee app but it flipped it back off almost immediately.

Yea. I have had a few devices i got at launch time that i needed to add manually. The Govee Xmas strng lights were a example of that and are the reason the Manual Lan Add Option even exists. They work with the integration now, but didn't when they were first launched.

The Device saftey toggle as i understand it is to prevent someone from connecting to your device that isn't you. Kind of like a way to lock the device down to prevent a drive by control.

@mavrrick58 Thanks for the info I could not see either device last time and that why I set it up as an Lan option. I have when back and reinstall but only one come up?


I see both on this page but then I go to the device page and look at the component and only one show up?

and the floor lamp is working ok. I when back to the app and it still show both the lamp and the air purifier, but it only makes one component in the device? which is the floor lamp.

Based on those images it looks like the Govee integration did retrieve the data from Govee. That is shown by the device being available to select in that drop down option. If it didn't appear as a component child device then it had a problem creating the device on Hubitat.

Can you please turn on debug logging in the app and then try to add the device again. Open a second windows with hubitat and go to the logging page. Leave that window running while opening the Govee App again. Scroll down and turn on debug logging and click on save. This will generate diag data for me to fix the app. Once that is done go back into the govee app, click on the button for the "Standard Device Setup", make sure both devices are selected, Click on next, save, done until you close the app. Go back to your live logging window and select the Govee Integration v2 from the list of apps/devices and collect the logs and PM me the details so i can see what happened.

@mavrrick58 If I reading the log correctly it missing a driver for the air purifier? Thanks for your help.

app:652024-06-26 06:04:18.224 PMinfogoveeDevAdd() Govee devices integrated

app:652024-06-26 06:04:18.221 PMinfogoveeDevAdd(): You selected a device that needs driver "Govee v2 Air Purifier Driver". Please load it

app:652024-06-26 06:04:18.218 PMdebuggoveeDevAdd(): LR Smart Air Purifier is a new DNI. Passing to driver setup if selected.

app:652024-06-26 06:04:18.215 PMdebuggoveeDevAdd(): Device ID matches child DNI. Living Room Floor Lamp already installed

app:652024-06-26 06:04:18.212 PMinfogoveeDevAdd() DEVICE INFORMATION

app:652024-06-26 06:04:18.209 PMinfogoveeDevAdd() [LR Smart Air Purifier] are selcted to be integrated

app:652024-06-26 06:04:18.204 PMdebuggoveeDevAdd() Childred DNI [Govee_v2_Device_Manager, Govee_15:77:CE:E9:2A:8B:FF:CF] MQTT device DNI null

app:652024-06-26 06:04:18.199 PMdebuggoveeDevAdd() drivers detected are [Govee Manual LAN API Device, Govee v2 Color Lights 2 Driver, Govee v2 Color Lights 3 Driver, Govee v2 Color Lights 4 Dreamview Sync, Govee v2 Color Lights 4 Driver, Govee v2 Color Lights Dreamview Sync, Govee v2 Color Lights Driver, Govee v2 Device Manager, Govee v2 White Light Driver, Govee v2 White Lights with CT Driver]

app:652024-06-26 06:04:18.137 PMdebuggetDriverList(): Attempting to obtain Driver List

app:652024-06-26 06:04:18.134 PMinfoinitialize() Govee Light/Switch/Plugs to add [LR Smart Air Purifier].

app:652024-06-26 06:04:18.131 PMdebuginitialize() Found child devices [Govee v2 Device Manager, Living Room Floor Lamp]

app:652024-06-26 06:04:18.118 PMdebugUpdated with settings: [goveeGroup:Default, goveePassword:!SPRing444, APIKey:
goveeEmail:leeonestop@aol.com, configLoggingLevelIDE:4, goveeDev:[LR Smart Air Purifier, Living Room Floor Lamp]]

app:652024-06-26 06:04:06.972 PMdebug deviceSelect() [Living Room Floor Lamp:Living Room Floor Lamp, LR Smart Air Purifier:LR Smart Air Purifier]

app:652024-06-26 06:04:06.969 PMdebugdeviceSelect() LR Smart Air Purifier found

app:652024-06-26 06:04:06.964 PMdebugdeviceSelect() Living Room Floor Lamp found

app:652024-06-26 06:04:06.962 PMdebugdeviceSelect() DEVICE INFORMATION

app:652024-06-26 06:04:06.505 PMdebugappButtonHandler() DEVICE INFORMATION

app:652024-06-26 06:04:06.501 PMdebugdeviceSelect() More then 30 min have passed since last refresh. Retrieving device data from Govee API

app:652024-06-26 06:03:41.105 PMinfoinitialize() Govee Light/Switch/Plugs to add .

1 Like

Hi Mavrrick

Finally had time to update my install and I'm having an issue with my DIY scenes.

I did the upgrade, checked that all libraries/apps had been updated and even removed the leftover LAN scene library code. Standard scenes work fine, but DIYs threw an error "NoSuchFileException: GoveeLanDIYScenes.json on line 1877 (method sceneLoad)".

I tried going into the app and clicking Device Refresh and then Scene Load in the device, but still got the error. I then did a repair via HPM which completed successfully but still no luck. I could try to clear out the DIYs and manually add them back, but I thought I'd give you a heads up first to see if you wanted me to test anything else first.

I'm an idiot. I never thought to just backup the DIYs to a file and then restore. I did that and I'm back in business. Sorry for the false alarm!

Thanks I am almost ready to release a new update. Let me see if i can figure something out for this. It is being caused by that file not being present. I need to add something to account for that.

I just release Govee Integration v2.1.11 for use. The changes are below

  1. A new page was added to the UI so you can see the process of the device installs. This page will show you what is being installed, what is ignored as it was already installed, and what needs drivers. This was largely driven by the need for a easier way to highlight when a driver was not present when creating a device as shown by @leeonestop. This new page will occur now when you click next after you make your device selection. An example of it is below

  2. The "Manual LAN API" Driver has gotten some love and been completely revamped.
    a. It now uses the standardized code and will receive updates along with the others when that code is modified.
    b. It received the same LAN Scene treatment as all other devices so Scenes should be functional with it again.
    c. With the new scene lan options, you can now specify your source file for Scenes.
    d. Scene Load Command was added to the driver.

  3. Fixed a bug were new devices wouldn't properly load Lan scenes because they were not assigned their device type at the correct time

  4. Modified the DIY Scene load process to prevent failures when the DIY Scene file is not yet created. Thank you to @OldChicagoPete for bring it up.

Enjoy and as usual let me know asap if you have any problems.

1 Like

Seeing the following error when trying to add the permanent outdoor lights pro:

Device Permanent Lights Pro was selected for install but driver "Govee v2 Color Lights Dreamview Sync is not installed". Please correct and try again

When you installed the integration did you install that driver as well. That message is to tell you that you need to install the missing driver and then try again

If you installed the integration with HPM to update the install. First go into HPM and use the "Modify" option to update the Govee Integration install and add the requested driver. Once the driver is added you shoild be able to complete the setup of the device.

1 Like

@mavrrick58 I updated the app and this is the message that I'm getting I have restarted app and redid each component individually still having no luck. Thanks