# Govee Lighting Control

**URL:** <https://extensions.streamer.bot/t/govee-lighting-control/665>\
**Category:** Approved\
**Tags:** youtube, lighting-control, twitch\
**Created:** [December 28, 2023, 1:21am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665 "2023-12-28T01:21:52Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![mustached\_maniac](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/mustached_maniac/32/1227_2.png) [@mustached\_maniac](https://extensions.streamer.bot/u/mustached_maniac)\
**Post date:** [December 28, 2023, 1:21am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/1 "2023-12-28T01:21:52Z")

</div>

## Description

Control your [Supported Govee Lights](https://developer.govee.com/docs/support-product-model) directly from Streamer.bot without the need for Lumia or IFTTT. If you do not already have an API Key, follow the next step. If you do, skip to this [step](#Setting-it-Up).

## Video Tutorial

[![](https://extensions.streamer.bot/uploads/default/original/2X/4/4990ed61393d0d20f0a684a5a05badf98e5666e7.jpeg "FREE Govee Lights Control for Streaming Tutorial with Streamer.bot @GOVEE") ](https://www.youtube.com/watch?v=daSjZCqpMfM)

## Import Code

[Mustached\_Maniac Govee Lighting Control.sb](https://extensions.streamer.bot/uploads/short-url/jAeX3KMFZYRSQixYW1FUW3bUMu9.sb) (16.0 KB)

## Installation

### Obtaining your API Key

- From the Govee App, click “Settings”

 ![govee api key-1](https://extensions.streamer.bot/uploads/default/original/2X/8/85c168b814a2811c22c9ea4214032980a0df1bf0.png)

- Click on “Apply for API Key”

 ![govee api key-2](https://extensions.streamer.bot/uploads/default/original/2X/6/6333ad7f1f47f8dd5c78f97bf2d8979445be3ede.png)

- Fill out the information and you should receive an email (to the address logged into Govee) within a few minutes with your API Key.

 ![govee api key-3](https://extensions.streamer.bot/uploads/default/original/2X/b/ba58e009e2cf5bd86a1f91b45f1224e2004c5adb.png)

### Setting it Up

1. Create a new folder folder on your computer _(I named mine ‘Govee’)._

2. Right-Click the new folder and select “Copy as Path”.

 ![copy as path](https://extensions.streamer.bot/uploads/default/original/2X/d/db9ef0a2ace896db7c11a0389c23f0b04be9edd8.png)

1. In Streamer.bot click the `Import` button in the top menu. Drag the downloaded **.sb file** into the `Import String` field and click `Import`.

 ![sb import](https://extensions.streamer.bot/uploads/default/original/1X/054c3a1bafb02540f76da07f8b72568a01be54ec.png)

1. Under the `Govee-Setup` Action, paste the copied file path to the goveeFilePath global.

 ![govee file path](https://extensions.streamer.bot/uploads/default/original/2X/b/ba944d60080741dc1efd87aa1dda93809de47c3c.jpeg)

1. Now paste your API Key to the ‘goveeApiKey’ global.

 ![govee api update](https://extensions.streamer.bot/uploads/default/original/2X/2/2e81382667d0b056de3cac79d56e1abe318789e6.jpeg)

1. Either run the command by typing `!goveeInit` into your chat, or right click on the `Trigger` and click `Test Trigger`.

2. Verify that your devices all show up in your ‘Govee’ folder.

 ![govee devices](https://extensions.streamer.bot/uploads/default/original/2X/1/1bf3b3d0793d0ccac11b9565b23bd43a57f3b5e3.png)

1. Congratulations, you are now ready to begin controlling your Govee Lights!

## How to Use the Actions

- It is highly recommended to `Duplicate` the actions by `Right-Clicking` and giving them unique names for each of your Govee Devices. This will prevent having to change the _Device ID_ and _Model_ every time that you’d like to make changes.

 ![duplicate action](https://extensions.streamer.bot/uploads/default/original/2X/b/bdad931caa91627af9df28e2606fca06a1a2c60b.png)

- You can find the information for each device, like the _Device ID_, _Model_, and _Snapshot_ or _Scene_ Numbers within each respective .txt. document.

 ![device info](https://extensions.streamer.bot/uploads/default/original/2X/6/68971ebecb48bf85f447feedfbaf1f75f0a0d150.png)

- To change a particular light, go the `Action` that you’d like to execute and update the `%deviceId%` and `%model%` Arguments to their respective value from the text files.

 ![device info highlighted](https://extensions.streamer.bot/uploads/default/original/2X/4/461fb0b33621a0fcd6684b722254038c046562fa.png)  
 ![govee action update](https://extensions.streamer.bot/uploads/default/original/2X/c/ceddc817a63085a46b74547ac1dd21f497648104.jpeg)

- Once updated, ensure you click `Save` at the top of Streamer.bot and either type the command in your chat, or by `Right-Clicking` the `Trigger` and clicking `Test Trigger`.

## Available Controls

| Command | Controllable Feature | Description |
| --- | --- | --- |
| !govBrightness | Brightness | Adjust the ‘Brightness’ (value must be between 1-100). |
| !govColor | Color | Select a color from within Streamer.Bot to apply it. |
| !govColorTemp | Color Temperature | Adjust the ‘Color Temperature’ (value must be between 2000 and 9000). |
| !govPower | Power On/Off | Turn the selected devices ‘On’ or ‘Off’. |
| !govDScene | DIY Scene Change | Apply selected DIY Scene to your device. |
| !govPScene | Preloaded (Dynamic) Scenes | Apply one of the preloaded Dynamic Scenes to your device. |
| !govSnapshot | Snapshots | Apply Selected Snapshot to your device. |

### Brightness

1. Set your Device ID.
2. Set your Model Number.
3. Pick a value between 1 (dim) and 100 (brightest).

 ![govBrightness](https://extensions.streamer.bot/uploads/default/original/2X/e/ed525e0cd265de20b61854cffa679ea0364835fd.jpeg)

### Color

1. Set your Device ID.
2. Set your Model Number.
3. Pick a color from the Streamer.bot color selection.

 ![govColor](https://extensions.streamer.bot/uploads/default/original/2X/6/6c4446e2eeb1cee7a8772ee0bc00fc2c7c1a9e0e.jpeg)

### Color Temperature

1. Set your Device ID.
2. Set your Model Number.
3. Pick a value between 2-9000K.

 ![govTemp](https://extensions.streamer.bot/uploads/default/original/2X/2/2070f328ca8dbc477512595362b2c45c250314c4.jpeg)

### Power On/Off

1. Set your Device ID.
2. Set your Model Number.
3. Type either ‘On’ or ‘Off’ (it is _NOT_ case sensitive).

 ![govPower](https://extensions.streamer.bot/uploads/default/original/2X/2/2de5e5bd09f57970ad8f435daa560f41cfe31c24.jpeg)

### Set DIY Scene

1. Set your Device ID.
2. Set your Model Number.
3. Pick your scene number from the text file.

 ![govDIY](https://extensions.streamer.bot/uploads/default/original/2X/9/98c540280b3b4ff692fa106cfbd2c70ff92aad58.jpeg)

### Set Dynamic (Preloaded) Scene

1. Set your Device ID.
2. Set your Model Number.
3. Pick your scene number from the text file.

 ![govDynamic](https://extensions.streamer.bot/uploads/default/original/2X/f/f71b0ad7cd2c20cd5f4c8afc902518c30a3dc499.jpeg)

### Set Snapshot

1. Set your Device ID.
2. Set your Model Number.
3. Pick your Snapshot number from the text file.

 ![govSnapshot](https://extensions.streamer.bot/uploads/default/original/2X/7/7a15624a42baa2530759d5b4256f5a66d5824c3f.jpeg)

---

<div class="post-metadata">

**Author:** ![pwnyy](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/pwnyy/32/2970_2.png) [@pwnyy](https://extensions.streamer.bot/u/pwnyy)\
**Post date:** [January 30, 2024, 4:08pm UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/2 "2024-01-30T16:08:28Z")

</div>

There are some things that need adjustement in your code, I’ll try and see if I adjust it and send it your way or you try adjusting it yourself haha

But generally it’s not recommended to use “using (HttpClient thirdClient = new HttpClient())”, especially when you are making multiple api calls anyway.

This is a note straight from nate who reminded us about it:  
If you’re using `HttpClient()` in C# code, don’t new it up every time you need one, create a private class wide client, or static (this means you’ll need to keep the instance alive), and set your headers/etc as needed, and keep re-using it.  
new-ing it up is costly, and it’s likely not being disposing of it correctly. `HttpClient()` is a finite resource, and can be exhausted, because closures cause a `TIME_WAIT` in Windows, usually locked for about 240s before Windows frees it for use again

---

<div class="post-metadata">

**Author:** ![mustached\_maniac](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/mustached_maniac/32/1227_2.png) [@mustached\_maniac](https://extensions.streamer.bot/u/mustached_maniac)\
**Post date:** [February 1, 2024, 3:11am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/3 "2024-02-01T03:11:56Z")

</div>

Updated with new import code and download file! Single HttpRequest in the Setup action and the Govee Controls Action still only does a single request, it just calls all the methods separately in their own actions!

---

<div class="post-metadata">

**Author:** ![pwnyy](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/pwnyy/32/2970_2.png) [@pwnyy](https://extensions.streamer.bot/u/pwnyy)\
**Post date:** [February 2, 2024, 5:59am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/4 "2024-02-02T05:59:51Z")

</div>

[Govee\_Update.sb](https://extensions.streamer.bot/uploads/short-url/5fPjrbR4WlEOZskzww9tOAwXQE2.sb) (7.3 KB)

I’ve made some adjustments to the Govee Controls action, feel free to take a look at them and check if everything still works fine as I am unable to test the actual code.

The adjustments I made are basically what the same I had mentioned before with only using one HttpClient. Made some other slight adjustments to help with debugging at the very in case someone would try and use the actions without using the Govee-Setup action first. You’ll see a tiny explanation in the Govee Controls Code.

Since you only use the govee setup once the first time you don’t need to keep the instance active which I have set to the Govee Controls action.

Hope I didn’t break something lol

---

<div class="post-metadata">

**Author:** ![mustached\_maniac](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/mustached_maniac/32/1227_2.png) [@mustached\_maniac](https://extensions.streamer.bot/u/mustached_maniac)\
**Post date:** [February 3, 2024, 1:11am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/5 "2024-02-03T01:11:19Z")

</div>

Your edits didn’t break anything! Confirmed everything works as advertised on 3 different lights (2 different models as that’s all I have to test with). As long as the HTTP Request does in fact stay alive for the entire instance that SB is open, then I’d say it’s good to go! Updated the `Import` Code scroll box, as well as the downloadable file.

---

<div class="post-metadata">

**Author:** ![pwnyy](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/pwnyy/32/2970_2.png) [@pwnyy](https://extensions.streamer.bot/u/pwnyy)\
**Post date:** [February 3, 2024, 1:29am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/6 "2024-02-03T01:29:05Z")

</div>

aight, I guess if you confirmed that everything is working fine and dandy, I’d just suggest to putting the file directly at step 3 of the “Setting it up”, else people will have to go down to the post and download and then come up again.

Then at the very bottom of your post for some reason you have a summary set? The only thing as per the template you need at the bottom is the following:  
`<div data-theme-toc="true"> </div>`

After that I’ll let the others know and we’ll see to move it 🙂

---

<div class="post-metadata">

**Author:** ![mustached\_maniac](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/mustached_maniac/32/1227_2.png) [@mustached\_maniac](https://extensions.streamer.bot/u/mustached_maniac)\
**Post date:** [February 3, 2024, 2:07am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/7 "2024-02-03T02:07:16Z")

</div>

Updated! Looks like that div data theme was storing the changes? It’s gone now and has the correct TOC at the bottom lol

---

<div class="post-metadata">

**Author:** ![pwnyy](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/pwnyy/32/2970_2.png) [@pwnyy](https://extensions.streamer.bot/u/pwnyy)\
**Post date:** [February 3, 2024, 2:10am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/8 "2024-02-03T02:10:14Z")

</div>

You forgot to put the downloadable file underneath point 3. in [Govee Lighting Control](https://extensions.streamer.bot/t/govee-lighting-control/665#setting-it-up-4) so they can directly download it instead of jumping down at the bottom and having to scroll up again to continue their setup 😄

---

<div class="post-metadata">

**Author:** ![GoWMan](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/gowman/32/4_2.png) [@GoWMan](https://extensions.streamer.bot/u/GoWMan)\
**Post date:** [February 3, 2024, 8:32am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/9 "2024-02-03T08:32:47Z")

</div>

Also contributors is only needed if others worked on it. Since the post is owned by the creator we already know they were a contributor. 😉

---

<div class="post-metadata">

**Author:** ![mustached\_maniac](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/mustached_maniac/32/1227_2.png) [@mustached\_maniac](https://extensions.streamer.bot/u/mustached_maniac)\
**Post date:** [February 3, 2024, 8:01pm UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/10 "2024-02-03T20:01:33Z")

</div>

I think the hyperlink no worky? It’s supposed to be linked to itself but I noticed none of the internal links jump down to where they’re supposed to so maybe it’s another system limitation 🤔🤷🏻‍♂️

---

<div class="post-metadata">

**Author:** ![GoWMan](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/gowman/32/4_2.png) [@GoWMan](https://extensions.streamer.bot/u/GoWMan)\
**Post date:** [February 3, 2024, 10:39pm UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/11 "2024-02-03T22:39:20Z")

</div>

Not really a limitation of Discourse per se as the Table of Contents is a plugin for Discourse. Discourse just treats all links put in a post as an external link that opens in the same window I believe. I can look into the plugin and see if it could be suggested or altered in suck a way but as long as all submissions follow the template set forth it shouldn’t be an issue. Browsing standards of the documentation should be as such that when as user browses things from one doc page to the other the are all uniform enough that it’s second nature for them to look in the spot. The table of contents is just a helpful thing that was added to change Discourses post slider to an actual usable thing in documentation.

---

<div class="post-metadata">

**Author:** ![mustached\_maniac](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/mustached_maniac/32/1227_2.png) [@mustached\_maniac](https://extensions.streamer.bot/u/mustached_maniac)\
**Post date:** [February 4, 2024, 11:16pm UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/12 "2024-02-04T23:16:14Z")

</div>

That makes sense! I’ll edit it when I get to the PC…I just love hyperlinking things lmfao.

---

<div class="post-metadata">

**Author:** ![GoWMan](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/gowman/32/4_2.png) [@GoWMan](https://extensions.streamer.bot/u/GoWMan)\
**Post date:** [February 7, 2024, 1:14am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/13 "2024-02-07T01:14:18Z")

</div>

Like @pwnyy mention the import code should be moved to be in line with the rest of the docs but also should be a .sb file. Trying to purge the import codes from the site and only do files sense it’s cleaner and people can drag n drop them into SB.

---

<div class="post-metadata">

**Author:** ![mustached\_maniac](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/mustached_maniac/32/1227_2.png) [@mustached\_maniac](https://extensions.streamer.bot/u/mustached_maniac)\
**Post date:** [February 7, 2024, 12:09pm UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/14 "2024-02-07T12:09:07Z")

</div>

Deleted the import string all together. Recommend removing that part from the template if the intent is to have everybody using .sb files vice the import string method!

---

<div class="post-metadata">

**Author:** ![pwnyy](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/pwnyy/32/2970_2.png) [@pwnyy](https://extensions.streamer.bot/u/pwnyy)\
**Post date:** [February 8, 2024, 12:10am UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/15 "2024-02-08T00:10:09Z")

</div>

The import string was never part of the template, only the .sb file itself, you can check the versioning if you don’t believe it 😅. As the post is currently it’s good to go

---

<div class="post-metadata">

**Author:** ![mustached\_maniac](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/mustached_maniac/32/1227_2.png) [@mustached\_maniac](https://extensions.streamer.bot/u/mustached_maniac)\
**Post date:** [February 8, 2024, 3:12pm UTC](https://extensions.streamer.bot/t/govee-lighting-control/665/16 "2024-02-08T15:12:09Z")

</div>

WTF?! I did just check…apparently I’m delusional bahahahahahahahahha
