PHPackages                             sgry/svnhue - 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. sgry/svnhue

ActiveLibrary

sgry/svnhue
===========

Control your Philips Hue lights with PHP

56[1 issues](https://github.com/sgry/svnhue/issues)PHP

Since Mar 11Pushed 13y ago1 watchersCompare

[ Source](https://github.com/sgry/svnhue)[ Packagist](https://packagist.org/packages/sgry/svnhue)[ RSS](/packages/sgry-svnhue/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

svnhue
======

[](#svnhue)

PHP OOP Classes for Philips Hue

Example usage:

```
/*******************************************************************************
* How to send commands to the bridge:
*******************************************************************************/

// Create Hue Object
$Ls_Host = '192.168.1.23';
$Ls_AuthKey = '194253fd922301d88d816cd6731ae28b';
$Lo_Hue = new \sgry\svnhue\Hue($Ls_Host, $Ls_AuthKey);

// Create HueState object
$Lo_HueState = new \sgry\svnhue\HueState();

// Set Color
// Only 1 colormode is possible per HueState object
$Lo_HueState->setColor('name', 'white');
$Lo_HueState->setColor('hue', array(200, 127)); // Array: hue, sat
$Lo_HueState->setColor('ct', 400); // Int: ct
$Lo_HueState->setColor('xy', array(0.143, 0.451)); // Array: x, y

// Set On/Off state
$Lo_HueState->setOn(true);

// Set Brightness
$Lo_HueState->setBrightness(200);

// Set Alert
$Lo_HueState->setAlert('select'); // select or lselect

// Set Transitiontime
$Lo_HueState->setTransitiontime(20);

// Inject HueState into Hue object
$Lo_Hue->setState($Lo_HueState);

// Create HueSchedule object
$Ldt_DateTime = new \DateTime();
$Ldt_DateTime->add(new DateInterval('P1D')); // Add 1 Day
$Lo_HueSchedule = new \sgry\svnhue\HueSchedule('Name', 'Description', $Ldt_DateTime);

// Inject HueSchedule into Hue object
$Lo_Hue->setSchedule($Lo_HueSchedule);

// Set target lights or groups
// Only 1 targetmode is possible per Hue object, either lights or groups
$Lo_Hue->setLights(array(1,3,4)); // Lights 1, 3 and 4
$Lo_Hue->setGroups(array(1,2)); // Groups 1 and 2

// Send it to the bridge!
$Lo_Hue->submitToBridge();

/*******************************************************************************
* How to read from the bridge:
*******************************************************************************/

// Create Hue Object
$Ls_Host = '192.168.1.23';
$Ls_AuthKey = '194253fd922301d88d816cd6731ae28b';
$Lo_Hue = new \sgry\svnhue\Hue($Ls_Host, $Ls_AuthKey);

// Set the light or the group you want to read out
// Only 1 targetmode is possible per Hue object, either lights or groups
// Only 1 light or group is possible at a time
$Lo_Hue->setLights(array(1)); // Light 1
$Lo_Hue->setGroups(array(1)); // Group 1

// Read
$Lo_Hue->readStateFromBridge();

// Get HueState object
$Lo_HueState = $Lo_Hue->getState();

/*******************************************************************************
* How to create or delete groups:
*******************************************************************************/

// Create Hue Object
$Ls_Host = '192.168.1.23';
$Ls_AuthKey = '194253fd922301d88d816cd6731ae28b';
$Lo_Hue = new \sgry\svnhue\Hue($Ls_Host, $Ls_AuthKey);

// Set the lights you want to add to the new group
$Lo_Hue->setLights(array(1,2));

// Create the group
// You may have to reboot your bridge for the groups to become active
$Lo_Hue->createGroup('GroupName');

// Set the groups you want to delete
$Lo_Hue->setGroups(array(1,2));

// Delete the group
// You may have to reboot your bridge for the groups to become active
$Lo_Hue->deleteGroups();

/*******************************************************************************
* How to register your App on the Bridge:
*******************************************************************************/

// Create Hue Object
$Ls_Host = '192.168.1.23';
$Ls_AuthKey = '194253fd922301d88d816cd6731ae28b'; // Choose your AuthKey
$Lo_Hue = new \sgry\svnhue\Hue($Ls_Host, $Ls_AuthKey);

// Register
$Lo_Hue->registerApp('Name of your App');

/*******************************************************************************
* Misc:
*******************************************************************************/
/*
  All functions return bool true on success.
  You can check if something went wrong with the method $Lo_Hue->getErrors()

*/
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0d8b1db5b75592041bd2f5c037d2c212d44287962f7ac29af4c6578a8d79080?d=identicon)[sgry](/maintainers/sgry)

---

Top Contributors

[![sgry](https://avatars.githubusercontent.com/u/3677613?v=4)](https://github.com/sgry "sgry (18 commits)")[![filp](https://avatars.githubusercontent.com/u/382538?v=4)](https://github.com/filp "filp (1 commits)")[![ReactiveRaven](https://avatars.githubusercontent.com/u/1376403?v=4)](https://github.com/ReactiveRaven "ReactiveRaven (1 commits)")

### Embed Badge

![Health badge](/badges/sgry-svnhue/health.svg)

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

PHPackages © 2026

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