Package 'huecontroller'

Title: Control Philips Hue lights using the R programming language
Description: Control Philips Hue lights using the R programming language
Authors: Giorgio Comai [aut, cre]
Maintainer: Giorgio Comai <[email protected]>
License: GPL-3
Version: 0.0.0.9005
Built: 2024-11-17 04:24:44 UTC
Source: https://github.com/giocomai/huecontroller

Help Index


Convert hex colour to

Description

Convert hex colour to

Usage

hue_convert_to_hue_sat(colour)

Arguments

colour

A colour name as listed by colours() or a hexadecimal colour string.

Value

A named list with two elements: hue and sat

Examples

hue_convert_to_hue_sat("red")
hue_convert_to_hue_sat("#E414FF")
if (interactive()) {
  hue_convert_to_hue_sat(colourpicker::colourPicker(numCols = 1))
}

Delete group

Description

Delete group

Usage

hue_delete_group(id)

Arguments

id

If numeric, numeric id of group. If character, name of group You can check id and names with hue_get_groups_names()

Value

Silently returns http response from the bridge, but mostly used for its side effects.


Delete light

Description

Delete light

Usage

hue_delete_light(id)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_lights_names()

Value

Silently returns http response from the bridge, but mostly used for its side effects.


Get state of given group

Description

Get state of given group

Usage

hue_get_group_lights(id)

Arguments

id

If numeric, numeric id of group. If character, name of group. You can check id and names with hue_get_groups_names()

Value

An integer vector with id of lights included in a group.


Get state of given group

Description

Get state of given group

Usage

hue_get_group_state(id)

Arguments

id

If numeric, numeric id of group. If character, name of group. You can check id and names with hue_get_groups_names()

Value

A list with details on the state and attribute of the given group


Get all details about groups

Description

Get all details about groups

Usage

hue_get_groups()

Value

A list


Get names of available groups

Description

Get names of available groups

Usage

hue_get_groups_names()

Get light state

Description

Get light state

Usage

hue_get_light_state(id)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_lights_names()


Get details about all lights

Description

Get details about all lights

Usage

hue_get_lights()

Value

A list with details about all lights


Get names of all available lights

Description

Get names of all available lights

Usage

hue_get_lights_names()

Server function for shiny app

Description

Server function for shiny app

Usage

hue_mod_group_card_server(id)

Arguments

id

Module id


UI function for shiny app

Description

UI function for shiny app

Usage

hue_mod_group_card_ui(
  id,
  group,
  onoff,
  brightness,
  temperature,
  min_temperature,
  max_temperature
)

Arguments

id

Module id

group

Group id


Server function for shiny app

Description

Server function for shiny app

Usage

hue_mod_light_card_server(id)

Arguments

id

Module id


UI function for shiny app

Description

UI function for shiny app

Usage

hue_mod_light_card_ui(
  id,
  light,
  onoff,
  brightness,
  temperature,
  min_temperature,
  max_temperature
)

Arguments

id

Module id

light

Light id


Check if given id is valid

Description

Check if given id is valid

Usage

hue_output_group_id(id)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_lights_names()

Value

Always return an integer corresponding to a given light.


Check if given id is valid

Description

Check if given id is valid

Usage

hue_output_id(id)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_lights_names()

Value

Always return an integer corresponding to a given light.


Set brightness of group

Description

Set brightness of group

Usage

hue_set_group_brightness(id, brightness, by = 10)

Arguments

id

If numeric, numeric id of group. If character, name of group. You can check id and names with hue_get_groups_names()

brightness

A numeric value, or one of either "brighter" (or "+") or "darker" (or "-"). The highest value is 254, the lowest 1.

by

Numeric, defaults to 10. Ignored if brightness is numeric. Otherwise determines the size of the increment/decrement.

Value

Silently returns http response from the bridge, but mostly used for its side effects.


Set colour of a group of lights with relevant capabilities

Description

N.B. Colour accuracy may not be perfect. See the official documentation for details, and consider using custom parameters with hue_set_group_state() if this function does not achieve what you expect. https://developers.meethue.com/develop/application-design-guidance/color-conversion-formulas-rgb-to-xy-and-back/

Usage

hue_set_group_colour(id, colour, transition_time = 0.4)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_groups_names()

colour

A colour name as listed by colours() or a hexadecimal colour string.

transition_time

Duration of the transition in seconds. Defaults to 0.4 seconds.

Examples

if (interactive()) {
  hue_set_group_colour(id = 11, colour = "green")
}

Change state of Hue groups

Description

Change state of Hue groups

Usage

hue_set_group_state(id, params)

Arguments

id

If numeric, numeric id of group. If character, name of group. You can check id and names with hue_get_groups_names()

params

A named list. For a full list of available parameters, check https://developers.meethue.com/develop/hue-api/groupds-api/


Set temperature of group

Description

Set temperature of group

Usage

hue_set_group_temperature(id, temperature, by = 10)

Arguments

id

If numeric, numeric id of group. If character, name of group. You can check id and names with hue_get_groups_names()

temperature

A numeric value, or one of either "warmer" (or "+") or "colder" (or "-"). The warmest value available is usually 500, the coldest 153.

by

Numeric, defaults to 10. Ignored if temperature is numeric. Otherwise determines the size of the increment/decrement.

Value

Silently returns http response from the bridge, but mostly used for its side effects.


Set brightness of light

Description

Set brightness of light

Usage

hue_set_light_brightness(id, brightness, by = 10)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_lights_names()

brightness

A numeric value, or one of either "brighter" (or "+") or "darker" (or "-"). The highest value is 254, the lowest 1.

by

Numeric, defaults to 10. Ignored if brightness is numeric. Otherwise determines the size of the increment/decrement.

Value

Silently returns http response from the bridge, but mostly used for its side effects.


Set colour of a Hue light with relevant capabilities

Description

N.B. Colour accuracy may not be perfect. See the official documentation for details, and consider using custom parameters with hue_set_light_state() if this function does not achieve what you expect. https://developers.meethue.com/develop/application-design-guidance/color-conversion-formulas-rgb-to-xy-and-back/

Usage

hue_set_light_colour(id, colour, transition_time = 0.4)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_lights_names()

colour

A colour name as listed by colours() or a hexadecimal colour string.

transition_time

Duration of the transition in seconds. Defaults to 0.4 seconds.

Examples

if (interactive()) {
  hue_set_light_colour(id = 11, colour = "blue")
}

Change state of Hue lights

Description

Change state of Hue lights

Usage

hue_set_light_state(id, params)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_lights_names()

params

A named list. For a full list of available parameters, check https://developers.meethue.com/develop/hue-api/lights-api/


Set temperature of light

Description

Set temperature of light

Usage

hue_set_light_temperature(id, temperature, by = 10)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_lights_names()

temperature

A numeric value, or one of either "warmer" (or "+") or "colder" (or "-"). The warmest value available is usually 500, the coldest 153.

by

Numeric, defaults to 10. Ignored if temperature is numeric. Otherwise determines the size of the increment/decrement.

Value

Silently returns http response from the bridge, but mostly used for its side effects.


Set IP and username to interact with the api

Description

Set IP and username to interact with the api

Usage

hue_settings(ip = NULL, username = NULL)

Arguments

ip

A character vector of length one. The IP of your hue bridge, e.g. "192.168.0.1"

username

A username generated to interact with the API. For details, https://developers.meethue.com/develop/get-started-2/


Interactive interface to control lights

Description

options Options to be passed to the shiny app. See ?shiny::shinyApp() for details.

Usage

hue_shiny_controller(options = list())

Turn off group

Description

Turn off group

Usage

hue_turn_group_off(id)

Arguments

id

If numeric, numeric id of group. If character, name of group. You can check id and names with hue_get_groups_names()

Value

Silently returns http response from the bridge, but mostly used for its side effects.


Turn on group

Description

Turn on group

Usage

hue_turn_group_on(id)

Arguments

id

If numeric, numeric id of group. If character, name of group. You can check id and names with hue_get_groups_names()

Value

Silently returns http response from the bridge, but mostly used for its side effects.


Turn off light

Description

Turn off light

Usage

hue_turn_light_off(id)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_lights_names()

Value

Silently returns http response from the bridge, but mostly used for its side effects.


Turn on light

Description

Turn on light

Usage

hue_turn_light_on(id)

Arguments

id

If numeric, numeric id of light. If character, name of light. You can check id and names with hue_get_lights_names()

Value

Silently returns http response from the bridge, but mostly used for its side effects.