frudawski

huelamps

The huelamps function lists all available Philips HUE lamps and their status connected to a specific HUE bridge. If no bridge connection was established before, the function will call the huenew function to create a HUE bridge connection.

Note 1: 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.

Note 2: For use with Octave, the dataframe package is required:

Install package:

pkg install -forge dataframe

Load package:

pkg load dataframe

By adding the load command to the .octaverc file, octave will load the toolbox automatically at startup.

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

Usage:

T = huelamps(nr,bridge,mode)

Where:

ParameterDescription
TReturns a table of available Philips HUE lamps and their status.
nrSpecifies which lamp numbers are listed, default: all.
bridgeSpecifies the bridge number, more than one bridge can be connected, default: 1.
modeSpecifies the operation mode:
‘secure’ = establishes a secure https connection (default)
‘allow-insecure’ = allow insecure http connection, not recommended.

Examples

List all HUE lamps of the standard bridge:

huelamps

Exemplary result:

ans = dataframe with 6 rows and 10 columns
_1 lamp_id                         name                    type         group group_id      on brightness    CCT      x      y
Nr  double                         char                    char          char   double logical     double double double double
 1       3            Hue color bedroom    Extended color light       Bedroom        2       0        137   2915 0.4452 0.4068
 2       4            Hue color kitchen    Extended color light       Kitchen        1       1        254   3165 0.4261 0.4010
 3      16               Hue color bath    Extended color light          Bath        5       0        127   2732 0.4575 0.4099
 4      23            Bathroom_mirror_1 Color temperature light          Bath        5       0        127   2732    NaN    NaN
 5      24            Bathroom_mirror_2 Color temperature light          Bath        5       0        127   2732    NaN    NaN
 6      29     Hue Smart plug christmas     On/Off plug-in unit   Living room        4       0        NaN    NaN    NaN    NaN

List status of HUE lamps 1 and 2 only:

huelamps([1 2])

Exemplary result:

ans = dataframe with 2 rows and 10 columns
_1 lamp_id              name                 type        group group_id      on brightness    CCT      x      y
Nr  double              char                 char         char   double logical     double double double double
 1       3 Hue color bedroom Extended color light      Bedroom        2       0        137   2915 0.4452 0.4068
 2       4 Hue color kitchen Extended color light      Kitchen        1       1        254   3165 0.4261 0.4010

List all HUE lamps of the second connected HUE bridge and allow insecure http connection:

huelamps([],2,'allow-insecure')

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.