frudawski

hueset

The hueset function allows it to alter the state of Philips HUE devices. Use the huelamps function to see which device has which parameter available.

Note: All hue function use curl commands to communicate with the HUE bridge. Please make sure it is installed. Curl is available for all major operating systems.

See also: huenew, huecon, huelamps, huesearch, hueadd, huename

Usage:

s = hueset(device,mode,'parameter',value)

Where:

ParameterDescription
sReturns a response struct, which indicates if the request was successful or not.
deviceSpecifies which HUE device is to be altered:
scalars refer to single devices
string or chars refer to device groups. Group 0 includes all devices.
modeSpecifies if the device is to be turned ‘on’, ‘off’ or ‘toggle’.
'parameter'
&
value
(optional)
Allows to change additional parameters if supported by the device, use huelamps to see all available options for each device:
'bri' sets the brightness parameter, scalar: 0-254.
'ct' sets the colour temperature, scalar: 2000-6500 K.
'xy' sets the chromatic coordinates as in CIE 1931 x,y chromaticity within the
'connection' : 'secure' (default) or 'allow-insecure'
possible range (depends on version), 1×2 vector. The ‘xy’ parameter overwrites the ‘ct’ setting if both settings are specified.

Examples

Switch device 6 on with full brightness and x = 0.3 and y = 0.4:

s = hueset(6,'on','bri',254,'xy',[0.3 0.4])

Result:

s =

  1x3 struct array containing the fields:

    success

Switch device 6 and 7 on, dimmed to 50% and ct = 3000 K:

s = hueset([6 7],'on','bri',127,'ct',3000)

Result:

s =

{
  [1,1] =

    1x3 struct array containing the fields:

      success

  [1,2] =

    1x3 struct array containing the fields:

      success
}

Switch all devices (group 0) off:

hueset('0','off')

Result:

s =

  scalar structure containing the fields:

    success =

      scalar structure containing the fields:

        /groups/0/action/on = 0

Switch group 4 off and set brightness to 50% for when it is turned on next time:

s = hueset('4','off','bri',127)

Result:

s =

  1x2 struct array containing the fields:

    success

Set group 4 and 7 on with 10% brightness:

hueset({'4','7'},'on','bri',25)

Result:

s = 
{
  [1,1] =

    1x2 struct array containing the fields:

      success

  [1,2] =

    1x2 struct array containing the fields:

      success

}

Reference

Signify Netherlands B.V.: Philips HUE API version 1. High Tech Campus 48, Eindhoven; Netherlands, 2014.

Leave a comment

* I accept the use of cookies as well as the terms in the privacy policy. I accept that data provided by me is processed and saved. I know and accept that comments may be saved and published after review.