Skip to content
ggodart edited this page Jan 5, 2021 · 2 revisions

Philips_Hue

See original

SYNOPSIS

Support for the Philips Hue devices

DESCRIPTION

This module adds support for Philips Hue lights to MisterHouse. More info on the hardware can be found here: https://www.philips-hue.com/en-gb

Items.mht

Add the Hue gateway and Hue devices in items.mht like this:

# PHILIPS_HUE, <ipaddress_bridge>:<api_key>:<lamp_id>, kitchen_light, hue_gateway, Lights
PHILIPS_HUE, 192.168.1.106:mytestusername:1, hue_1, Living

Then in your code do something like:

   # Switch on the light if it is getting dark
   if (<condition_that_needs_to_be_met>) {
     $kitchen_light>set('on');
   }

To control the brightness and the color of the lamp, use the ->bri(xx) and the ->ct_k(xx) or ->hs(xx,yy) functions.

E.g. to put the light in full brightness blue:

$light->hs(46920,255); $light->bri(255);

Setup

This module communicates with the Hue lights through the bridge device. You need to detect the IP address of the bridge and you need to setup an API key to be able to access the bridge from MisterHouse. Detect the IP address of your bridge with the hue-discover.pl script that comes with Device::Hue. Follow the instructions presented in that script to setup an API key.

INHERITS

Generic_Item

METHODS

Method Description
set Sets the state of the Hue light. Passing arguments on or off sets the light on or off. Note that on restores the previous light state, both the color and the brightness.
effect Program an effect. This depends on what effects are supported by the firmware of the lamp. Currently this command takes as parameters:
colorloop - Enable the color looping through all colors the lamp supports. Kids love it :-)
none - Disable the active effect
bri Control the brightness of a lamp in percentage. Supports values between 0 (off) and 100 (maximum) brightness. Note that value '0' does turn the lamp off.
ct_k Sets the color temperature in Kelvin. For 2012 lamps the value should be between 2000 K and 6500 K
hs Sets the hue/saturation values to determine the color of a lamp. The hue value is a wrapping value between 0 and 65535. Both 0 and 65535 are red, 25500 is green and 46920 is blue. For the saturation of the light, 255 is the most saturated (colored) and 0 is the least saturated (white).
hsb Combined hue, saturation, brightness command. For supported values, see the respective functions above.

DEPENDENCIES:

This code depends on the Perl module Device::Hue. This module is published on CPAN.

Philips_Lux

SYNOPSIS

Support for the Philips Lux devices

DESCRIPTION

This module inherits from Philips_Hue and disables the features that are not available on a Lux light. Basically this means everything that has to do with color settings.

INHERITS

Philips_Hue

AUTHOR

Lieven Hollevoet [email protected]

Clone this wiki locally