PHPackages                             phlak/lifx-client - 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. phlak/lifx-client

ActiveLibrary[API Development](/categories/api)

phlak/lifx-client
=================

PHP client library for the LIFX API (v1)

3.0.0(5y ago)97.2k3[2 PRs](https://github.com/PHLAK/lifx-client/pulls)MITPHPPHP &gt;=7.1

Since Feb 23Pushed 4y ago2 watchersCompare

[ Source](https://github.com/PHLAK/lifx-client)[ Packagist](https://packagist.org/packages/phlak/lifx-client)[ Fund](https://paypal.me/ChrisKankiewicz)[ GitHub Sponsors](https://github.com/PHLAK)[ RSS](/packages/phlak-lifx-client/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (6)Versions (11)Used By (0)

 [![LIFX Client](lifx-php.png)](lifx-php.png)

 [![Join our Community](https://camo.githubusercontent.com/073a08ec4c3c801a8e24c53184d95a6562d74582854cb46320bcd76ef48ea543/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4a6f696e5f7468652d436f6d6d756e6974792d3762313666662e7376673f7374796c653d666f722d7468652d6261646765)](https://spectrum.chat/phlaknet) [![Become a Sponsor](https://camo.githubusercontent.com/00da07edf5fbff7528a4743d85563603f9284f02680e0ab1e73652e680878548/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4265636f6d655f612d53706f6e736f722d6363343139352e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/users/PHLAK/sponsorship) [![One-time Donation](https://camo.githubusercontent.com/e9b5aa71ffdb17943c10c6d6b4a3132b66a938495331e488ecbdad1f3c078879/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d616b655f612d446f6e6174696f6e2d3030366262362e7376673f7374796c653d666f722d7468652d6261646765)](https://paypal.me/ChrisKankiewicz)
 [![Latest Stable Version](https://camo.githubusercontent.com/bf805cb67ea865cadf416bc92c76224957682ef59b2a719c849f62ab377ed5b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f50484c414b2f6c6966782d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/PHLAK/lifx-client) [![Total Downloads](https://camo.githubusercontent.com/c16aaeeb5deb88dee60fe239e4fb649910e7ceb5fccf381b3d9748e463339005/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f50484c414b2f6c6966782d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/PHLAK/lifx-client) [![License](https://camo.githubusercontent.com/0f49a3aa6bb303a4a3a88f4274e9c3f8fb5745279f7475008701506ec7cc50a3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f50484c414b2f6c6966782d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://github.com/PHLAK/lifx-client/blob/master/LICENSE) [![Build Status](https://camo.githubusercontent.com/7ea18f6fd1ba11028b111dd429d14ef3dc4c48fdd37da8149fc44a971f559849/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f50484c414b2f6c6966782d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/PHLAK/lifx-client) [![StyleCI](https://camo.githubusercontent.com/04b5f07d6f799d11a7339916c0e6dd1e0295f5972e0e376eebe981a9137f5f50/68747470733a2f2f7374796c6563692e696f2f7265706f732f38323935383635352f736869656c643f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://styleci.io/repos/82958655)

 PHP client library for the LIFX API (v1) -- by, [Chris Kankiewicz](https://www.ChrisKankiewicz.com) ([@PHLAK](https://twitter.com/PHLAK))

---

Introduction
------------

[](#introduction)

LIFX Client is a LIFX API client library for PHP built with GuzzleHttp.

Refer to the full [LIFX API documentation](https://api.developer.lifx.com)for more information about each method and it's available parameters.

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

[](#requirements)

- [PHP](https://php.net) &gt;= 7.1

Install with Composer
---------------------

[](#install-with-composer)

```
composer require phlak/lifx-client
```

Initializing the Client
-----------------------

[](#initializing-the-client)

First, import LIFX:

```
use PHLAK\LIFX;
```

Then instantiate the class with your LIFX OAuth 2 access token. You can generate an access token from your [account settings](https://cloud.lifx.com/settings)page:

```
$lifx = new LIFX\Client('YOUR_APP_TOKEN');
```

Usage
-----

[](#usage)

List one or more lights via a selector:

```
$lifx->listLights($selector = 'all');
```

Set the state of one or more lights via a selector:

```
$lifx->setState($selector, array $params);
```

Set multiple states across multiple selectors:

```
$lifx->setStates(array $states, array $defaults = []);
```

Toggle the power of one or more lights via a selector:

```
$lifx->togglePower($selector, $duration = 1);
```

Cause one or more lights to breathe via a selector:

```
$lifx->breatheEffect($selector, $color, array $params = []);
```

Cause one or more lights to pulse via a selector:

```
$lifx->pulseEffect($selector, $color, array $params = []);
```

Make the light(s) cycle to the next or previous state in a list of states:

```
$lifx->cycle($selector, array $states, array $params = []);
```

Get a list of available scenes:

```
$lifx->listScenes();
```

Activate a scene:

```
$lifx->activateScene($sceneUuid, $duration = 1.0);
```

Validate a color string:

```
$lifx->validateColor($string);
```

Handling Exceptions
-------------------

[](#handling-exceptions)

```
use GuzzleHttp\Exception\ClientException;

try {
    $lifx->togglePower('id:123456789abcd');
} catch (ClientException $exception) {
    // Handle this exception here...
}
```

See the [GuzzleHttp exceptions](http://docs.guzzlephp.org/en/latest/quickstart.html#exceptions)documentation for more details.

Changelog
---------

[](#changelog)

A list of changes can be found on the [GitHub Releases](https://github.com/PHLAK/lifx-client/releases) page.

Troubleshooting
---------------

[](#troubleshooting)

For general help and support join our \[Spectrum Community\](or reach out on [Twitter](https://twitter.com/PHLAK).

Please report bugs to the [GitHub Issue Tracker](https://github.com/PHLAK/lifx-client/issues).

Copyright
---------

[](#copyright)

This project is licensed under the [MIT License](https://github.com/PHLAK/lifx-client/blob/master/LICENSE).

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 97.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 ~267 days

Recently: every ~333 days

Total

6

Last Release

2075d ago

Major Versions

0.1.1 → 1.0.02017-02-27

1.1.0 → 2.0.02019-05-03

2.0.0 → 3.0.02020-10-23

PHP version history (3 changes)0.1.0PHP &gt;=5.4

1.1.0PHP &gt;=5.6

3.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/53531?v=4)[Chris Kankiewicz](/maintainers/PHLAK)[@PHLAK](https://github.com/PHLAK)

---

Top Contributors

[![PHLAK](https://avatars.githubusercontent.com/u/53531?v=4)](https://github.com/PHLAK "PHLAK (45 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

---

Tags

apiguzzlehttphome-automationlifxlifx-apiphp

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phlak-lifx-client/health.svg)

```
[![Health](https://phpackages.com/badges/phlak-lifx-client/health.svg)](https://phpackages.com/packages/phlak-lifx-client)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.3M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1942.4k4](/packages/aimeos-prisma)

PHPackages © 2026

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