Control your Philips Hue lights from your Laravel code 💡

Dennis Smink
1 min readFeb 27, 2019

--

Recently I created a package to manage my Philips Hue lights with. I wanted an easy way to signal my lights in my office when something special happens. Things that are special for example could be:

  • New user sign up
  • New paid order
  • New support ticket
  • New newsletter subscription
  • … etc

Here’s a link to the package:

I’m still doing work on it, but the basics are implemented and fully working.

You can switch lights on and off per ID, but also in a complete group.

Syntax is as easy as this:

(new HueClient)->lights()->on(1)

Some example commands:

$hue = new HueClient();

$hue->groups()->all();
$hue->lights()->all();
$hue->lights()->get(1);
$hue->lights()->on(1);
$hue->lights()->off(1);
$hue->lights()->customState(1, [
"hue" => 25500,
"bri" =>200,
"alert" => 'select'
]);

You can do whatever you want!

--

--