salt.proxy.philips_hue

Philips HUE lamps module for proxy.

New in version 2015.8.3.

First create a new user on the Hue bridge by following the Meet hue instructions.

To configure the proxy minion:

proxy:
  proxytype: philips_hue
  host: [hostname or ip]
  user: [username]
class salt.proxy.philips_hue.Const

Constants for the lamp operations.

COLOR_BLUE = {'hue': 46920, 'sat': 254}
COLOR_DAYLIGHT = {'xy': [0.3806, 0.3576]}
COLOR_GREEN = {'hue': 25500, 'sat': 254}
COLOR_ORANGE = {'hue': 12000, 'sat': 254}
COLOR_PINK = {'xy': [0.3688, 0.2095]}
COLOR_PURPLE = {'xy': [0.3787, 0.1724]}
COLOR_RED = {'hue': 0, 'sat': 254}
COLOR_WHITE = {'xy': [0.3227, 0.329]}
COLOR_YELLOW = {'xy': [0.4432, 0.5154]}
LAMP_OFF = {'on': False, 'transitiontime': 0}
LAMP_ON = {'on': True, 'transitiontime': 0}
salt.proxy.philips_hue.call_alert(*args, **kwargs)

Lamp alert

Options:

  • id: Specifies a device ID. Can be a comma-separated values. All, if omitted.

  • on: Turns on or off an alert. Default is True.

CLI Example:

salt '*' hue.alert
salt '*' hue.alert id=1
salt '*' hue.alert id=1,2,3 on=false

Blink a lamp. If lamp is ON, then blink ON-OFF-ON, otherwise OFF-ON-OFF.

Options:

  • id: Specifies a device ID. Can be a comma-separated values. All, if omitted.

  • pause: Time in seconds. Can be less than 1, i.e. 0.7, 0.5 sec.

CLI Example:

salt '*' hue.blink id=1
salt '*' hue.blink id=1,2,3
salt.proxy.philips_hue.call_brightness(*args, **kwargs)

Set an effect to the lamp.

Arguments:

  • value: 0~255 brightness of the lamp.

Options:

  • id: Specifies a device ID. Can be a comma-separated values. All, if omitted.

  • transition: Transition 0~200. Default 0.

CLI Example:

salt '*' hue.brightness value=100
salt '*' hue.brightness id=1 value=150
salt '*' hue.brightness id=1,2,3 value=255
salt.proxy.philips_hue.call_color(*args, **kwargs)

Set a color to the lamp.

Options:

  • id: Specifies a device ID. Can be a comma-separated values. All, if omitted.

  • color: Fixed color. Values are: red, green, blue, orange, pink, white,

    yellow, daylight, purple. Default white.

  • transition: Transition 0~200.

Advanced:

CLI Example:

salt '*' hue.color
salt '*' hue.color id=1
salt '*' hue.color id=1,2,3 oolor=red transition=30
salt '*' hue.color id=1 gamut=0.3,0.5
salt.proxy.philips_hue.call_effect(*args, **kwargs)

Set an effect to the lamp.

Options:

  • id: Specifies a device ID. Can be a comma-separated values. All, if omitted.

  • type: Type of the effect. Possible values are "none" or "colorloop". Default "none".

CLI Example:

salt '*' hue.effect
salt '*' hue.effect id=1
salt '*' hue.effect id=1,2,3 type=colorloop
salt.proxy.philips_hue.call_lights(*args, **kwargs)

Get info about all available lamps.

Options:

  • id: Specifies a device ID. Can be a comma-separated values. All, if omitted.

CLI Example:

salt '*' hue.lights
salt '*' hue.lights id=1
salt '*' hue.lights id=1,2,3
salt.proxy.philips_hue.call_ping(*args, **kwargs)

Ping the lamps by issuing a short inversion blink to all available devices.

CLI Example:

salt '*' hue.ping
salt.proxy.philips_hue.call_rename(*args, **kwargs)

Rename a device.

Options:

  • id: Specifies a device ID. Only one device at a time.

  • title: Title of the device.

CLI Example:

salt '*' hue.rename id=1 title='WC for cats'
salt.proxy.philips_hue.call_status(*args, **kwargs)

Return the status of the lamps.

Options:

  • id: Specifies a device ID. Can be a comma-separated values. All, if omitted.

CLI Example:

salt '*' hue.status
salt '*' hue.status id=1
salt '*' hue.status id=1,2,3
salt.proxy.philips_hue.call_switch(*args, **kwargs)

Switch lamp ON/OFF.

If no particular state is passed, then lamp will be switched to the opposite state.

Options:

  • id: Specifies a device ID. Can be a comma-separated values. All, if omitted.

  • on: True or False. Inverted current, if omitted

CLI Example:

salt '*' hue.switch
salt '*' hue.switch id=1
salt '*' hue.switch id=1,2,3 on=True
salt.proxy.philips_hue.call_temperature(*args, **kwargs)

Set the mired color temperature. More: http://en.wikipedia.org/wiki/Mired

Arguments:

  • value: 150~500.

Options:

  • id: Specifies a device ID. Can be a comma-separated values. All, if omitted.

CLI Example:

salt '*' hue.temperature value=150
salt '*' hue.temperature value=150 id=1
salt '*' hue.temperature value=150 id=1,2,3
salt.proxy.philips_hue.init(cnf)

Initialize the module.

salt.proxy.philips_hue.ping(*args, **kw)

Ping the lamps.

salt.proxy.philips_hue.shutdown(opts, *args, **kw)

Shuts down the service.