PHPackages                             dutchie027/govee - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dutchie027/govee

ActiveLibrary[API Development](/categories/api)

dutchie027/govee
================

A simple PHP package for controlling Govee Wi-Fi systems via their API

v1.5.1(4y ago)12812[5 PRs](https://github.com/dutchie027/govee-api/pulls)MITPHP

Since Dec 10Pushed 3y ago2 watchersCompare

[ Source](https://github.com/dutchie027/govee-api)[ Packagist](https://packagist.org/packages/dutchie027/govee)[ RSS](/packages/dutchie027-govee/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (8)Dependencies (2)Versions (14)Used By (0)

Govee PHP API
=============

[](#govee-php-api)

[![Latest Stable Version](https://camo.githubusercontent.com/5c88974857fc97aa013482422cddd24f9bcc151b1047e6f452557fec60def30d/68747470733a2f2f706f7365722e707567782e6f72672f647574636869653032372f676f7665652f76)](//packagist.org/packages/dutchie027/govee)[![Total Downloads](https://camo.githubusercontent.com/91bdfe2ed5e554a793b5b1aa15e8592c736f8a3b8e05f9f78cd8af87a21cb7aa/68747470733a2f2f706f7365722e707567782e6f72672f647574636869653032372f676f7665652f646f776e6c6f616473)](//packagist.org/packages/dutchie027/govee)[![License](https://camo.githubusercontent.com/b281d02dd22cdef1bc7d9e91b15b585f4aa9be2e2fde27e0b8acbf284a5a4818/68747470733a2f2f706f7365722e707567782e6f72672f647574636869653032372f676f7665652f6c6963656e7365)](//packagist.org/packages/dutchie027/govee)[![CodeFactor](https://camo.githubusercontent.com/ee7de76f9cc43559feab870bc900d66e8e7af916af8eb72e72fe25bcd0249f9c/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f647574636869653032372f676f7665652d6170692f6261646765)](https://www.codefactor.io/repository/github/dutchie027/govee-api)

A simple PHP package that allows you to control [Govee Smart Lights](https://www.govee.com/) using their [API](https://govee-public.s3.amazonaws.com/developer-docs/GoveeAPIReference.pdf).

Requirements
------------

[](#requirements)

- PHP &gt;7.2

Installation
------------

[](#installation)

You can install the package using the [Composer](https://getcomposer.org/) package manager. You can install it by running this command in your project root:

```
composer require dutchie027/govee
```

Basic Usage
-----------

[](#basic-usage)

### Instantiate the client

[](#instantiate-the-client)

To use any of the Govee API functions, you first need a connection reference. The connection refrence can then be fed to either the Lights library or the Plugs library, or even both if you have both Govee Lights and Plugs.

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$govee = new dutchie027\govee\Connect("GOVEE-API-KEY");

// Instantiate without defaults, this allows you to change things
// like log location, directory, the tag and possible future settings.
$settings = [
  'log_dir' => '/tmp',
  'log_name' => 'govee-api',
  'log_tag' => 'mylights',
  'log_level' => 'error'
];

$govee = new dutchie027\govee\Connect("GOVEE-API-KEY", $settings);
```

#### Settings

[](#settings)

The default settings are fine, however you might want to override the defaults or use your own.**NOTE: All settings are optional and you don't need to provide any**.

FieldTypeDescriptionDefault Value`log_dir`stringThe directory where the log file is stored[sys\_get\_temp\_dir()](https://www.php.net/manual/en/function.sys-get-temp-dir.php)`log_name`stringThe name of the log file that is created in `log_dir`. If you don't put .log at the end, it will append it6 random characters + [time()](https://www.php.net/manual/en/function.time.php) + .log`log_tag`stringIf you share this log file with other applications, this is the tag used in the log filegovee`log_level`stringThe level of logging the application will do. This must be either `debug`, `info`, `notice`, `warning`, `critical` or `error`. If it is not one of those values it will fail to the default`warning`Connect (Core) Functions
------------------------

[](#connect-core-functions)

### Get Device Count

[](#get-device-count)

```
print $govee->getDeviceCount();
```

### Get An Array of All Devices

[](#get-an-array-of-all-devices)

```
$array = $govee->getDeviceList();
```

#### Example Return Array

[](#example-return-array)

```
Array
(
    [0] => Array
        (
            [device] => 46:F1:CC:F6:FC:65:FF:AA
            [model] => H6159
            [deviceName] => Office-Color
            [controllable] => 1
            [retrievable] => 1
            [supportCmds] => Array
                (
                    [0] => turn
                    [1] => brightness
                    [2] => color
                    [3] => colorTem
                )

        )

)
```

### Get An Array of All Callable MAC Addresses

[](#get-an-array-of-all-callable-mac-addresses)

```
$macArray = $govee->getDeviceMACArray();
```

#### MAC Return Array

[](#mac-return-array)

```
Array
(
    [0] => A9:E9:0A:04:AD:CD:12:34
    [1] => FA:8F:50:B2:AD:A7:00:12
    [2] => E0:94:41:AC:62:13:56:78
)
```

### Get An Array of All Device Names

[](#get-an-array-of-all-device-names)

```
$nameArray = $govee->getDeviceNameArray();
```

#### Device Name Return Array

[](#device-name-return-array)

```
Array
(
    [0] => My-Living-Room
    [1] => Hallway
    [2] => Fire-House
)
```

### Get the location of the log file

[](#get-the-location-of-the-log-file)

```
print $govee->getLogLocation();
```

#### Example Return String

[](#example-return-string)

```
/tmp/2Zo46b.1607566740.log
```

Lights Functions
----------------

[](#lights-functions)

### Controlling Lights

[](#controlling-lights)

To control lights, you first need to make a connection and then reference the connection

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$govee = new dutchie027\govee\Connect("GOVEE-API-KEY");
```

Once you've got a reference to the lights, it will preload all of the MAC Address(es) and name(s) of the devices.

#### Turning A Light ON

[](#turning-a-light-on)

To turn a light on, simply feed it the MAC address or the name of the light.

```
$govee->lights()->turnOn("AC:14:A3:D5:E6:C4:3D:AE");

or

$govee->lights()->turnOn("Office-Wall");
```

#### Turning A Light OFF

[](#turning-a-light-off)

Like turning a light on, to turn a light off, simply feed the MAC address or the name of the light.

```
$govee->lights()->turnOff("AC:14:A3:D5:E6:C4:3D:AE");

or

$govee->lights()->turnOff("Office-Wall");
```

#### Adjusting BRIGHTNESS of A Light

[](#adjusting-brightness-of-a-light)

To adjust the brigthness, simply give the name or MAC and the brightness, an INT between 0 and 100.

```
$govee->lights()->setBrightness("AC:14:A3:D5:E6:C4:3D:AE", 75);

or

$govee->lights()->setBrightness("Office-Wall", 75);
```

#### Changing the COLOR of A Light

[](#changing-the-color-of-a-light)

To adjust the color, simply give the name or MAC and the brightness and then feed the R, G, B colors you'd like the device to set itself to. *NOTE* the values for Red, Green and Blue must be between 0 and 255.

```
$govee->lights()->setColor("AC:14:A3:D5:E6:C4:3D:AE", 255, 255, 0);

or

$govee->lights()->setBrightness("Office-Wall", 255, 0, 0);
```

#### Changing the TEMPERATURE of A Light

[](#changing-the-temperature-of-a-light)

To adjust the temperature, simply give the name or MAC and the name and then feed the temperature. *NOTE* Temperature must be an INT between 2000 and 9000.

```
$govee->lights()->setTemp("AC:14:A3:D5:E6:C4:3D:AE", 5000);

or

$govee->lights()->setTemp("Office-Wall", 5000);
```

#### Get the STATE of A Light

[](#get-the-state-of-a-light)

To get all of the details about a light, simply feed getDeviceState the name or the MAC address. You'll get a JSON return you can then either read or feed to `json_decode` and turn in to an array to use/read.

```
$govee->lights()->getDeviceState("AC:14:A3:D5:E6:C4:3D:AE");

or

$govee->lights()->getDeviceState("Office-Wall");
```

```
{
  "data": {
    "device": "AC:14:A3:D5:E6:C4:3D:AE",
    "model": "Office-Wall",
    "properties": [
      {
        "online": true
      },
      {
        "powerState": "on"
      },
      {
        "brightness": 100
      },
      {
        "color": {
          "r": 255,
          "b": 0,
          "g": 255
        }
      }
    ]
  }
}
```

Plugs Functions
---------------

[](#plugs-functions)

### Turn On A Plug

[](#turn-on-a-plug)

```
$govee->plugs()->turnOn("AC:14:A3:D5:E6:C4:3D:AE");

or

$govee->plugs()->turnOn("Office-Wall");
```

### Turn Off A Plug

[](#turn-off-a-plug)

```
$govee->plugs()->turnOff("AC:14:A3:D5:E6:C4:3D:AE");

or

$govee->plugs()->turnOff("Office-Wall");
```

Contributing
------------

[](#contributing)

If you're having problems, spot a bug, or have a feature suggestion, [file an issue](https://github.com/dutchie027/govee-api/issues). If you want, feel free to fork the package and make a pull request. This is a work in progresss as I get more info and the Govee API grows.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 62.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~74 days

Recently: every ~127 days

Total

8

Last Release

1462d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6424f66fa0ca243cf585d30e65d4dbecb0272ecee4397df15b5d9a6fab448c6b?d=identicon)[dutchie027](/maintainers/dutchie027)

---

Top Contributors

[![dutchie027](https://avatars.githubusercontent.com/u/6707999?v=4)](https://github.com/dutchie027 "dutchie027 (49 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (29 commits)")

---

Tags

apigoveelightsphpphphome automationlightsplugsgovee

### Embed Badge

![Health badge](/badges/dutchie027-govee/health.svg)

```
[![Health](https://phpackages.com/badges/dutchie027-govee/health.svg)](https://phpackages.com/packages/dutchie027-govee)
```

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[cantie/app-store-connect-api

A PHP client library for accessing App Store Connect APIs

2831.4k](/packages/cantie-app-store-connect-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
