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 |
Convert hex colour to
hue_convert_to_hue_sat(colour)
hue_convert_to_hue_sat(colour)
colour |
A colour name as listed by |
A named list with two elements: hue
and sat
hue_convert_to_hue_sat("red") hue_convert_to_hue_sat("#E414FF") if (interactive()) { hue_convert_to_hue_sat(colourpicker::colourPicker(numCols = 1)) }
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
hue_delete_group(id)
hue_delete_group(id)
id |
If numeric, numeric id of group. If character, name of group You can check id and names with |
Silently returns http response from the bridge, but mostly used for its side effects.
Delete light
hue_delete_light(id)
hue_delete_light(id)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
Silently returns http response from the bridge, but mostly used for its side effects.
Get state of given group
hue_get_group_lights(id)
hue_get_group_lights(id)
id |
If numeric, numeric id of group. If character, name of group. You can check id and names with |
An integer vector with id of lights included in a group.
Get state of given group
hue_get_group_state(id)
hue_get_group_state(id)
id |
If numeric, numeric id of group. If character, name of group. You can check id and names with |
A list with details on the state and attribute of the given group
Get all details about groups
hue_get_groups()
hue_get_groups()
A list
Get names of available groups
hue_get_groups_names()
hue_get_groups_names()
Get light state
hue_get_light_state(id)
hue_get_light_state(id)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
Get details about all lights
hue_get_lights()
hue_get_lights()
A list with details about all lights
Get names of all available lights
hue_get_lights_names()
hue_get_lights_names()
Server function for shiny app
hue_mod_group_card_server(id)
hue_mod_group_card_server(id)
id |
Module id |
UI function for shiny app
hue_mod_group_card_ui( id, group, onoff, brightness, temperature, min_temperature, max_temperature )
hue_mod_group_card_ui( id, group, onoff, brightness, temperature, min_temperature, max_temperature )
id |
Module id |
group |
Group id |
Server function for shiny app
hue_mod_light_card_server(id)
hue_mod_light_card_server(id)
id |
Module id |
UI function for shiny app
hue_mod_light_card_ui( id, light, onoff, brightness, temperature, min_temperature, max_temperature )
hue_mod_light_card_ui( id, light, onoff, brightness, temperature, min_temperature, max_temperature )
id |
Module id |
light |
Light id |
Check if given id is valid
hue_output_group_id(id)
hue_output_group_id(id)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
Always return an integer corresponding to a given light.
Check if given id is valid
hue_output_id(id)
hue_output_id(id)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
Always return an integer corresponding to a given light.
Set brightness of group
hue_set_group_brightness(id, brightness, by = 10)
hue_set_group_brightness(id, brightness, by = 10)
id |
If numeric, numeric id of group. If character, name of group. You can check id and names with |
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. |
Silently returns http response from the bridge, but mostly used for its side effects.
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/
hue_set_group_colour(id, colour, transition_time = 0.4)
hue_set_group_colour(id, colour, transition_time = 0.4)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
colour |
A colour name as listed by |
transition_time |
Duration of the transition in seconds. Defaults to 0.4 seconds. |
if (interactive()) { hue_set_group_colour(id = 11, colour = "green") }
if (interactive()) { hue_set_group_colour(id = 11, colour = "green") }
Change state of Hue groups
hue_set_group_state(id, params)
hue_set_group_state(id, params)
id |
If numeric, numeric id of group. If character, name of group. You can check id and names with |
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
hue_set_group_temperature(id, temperature, by = 10)
hue_set_group_temperature(id, temperature, by = 10)
id |
If numeric, numeric id of group. If character, name of group. You can check id and names with |
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. |
Silently returns http response from the bridge, but mostly used for its side effects.
Set brightness of light
hue_set_light_brightness(id, brightness, by = 10)
hue_set_light_brightness(id, brightness, by = 10)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
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. |
Silently returns http response from the bridge, but mostly used for its side effects.
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/
hue_set_light_colour(id, colour, transition_time = 0.4)
hue_set_light_colour(id, colour, transition_time = 0.4)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
colour |
A colour name as listed by |
transition_time |
Duration of the transition in seconds. Defaults to 0.4 seconds. |
if (interactive()) { hue_set_light_colour(id = 11, colour = "blue") }
if (interactive()) { hue_set_light_colour(id = 11, colour = "blue") }
Change state of Hue lights
hue_set_light_state(id, params)
hue_set_light_state(id, params)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
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
hue_set_light_temperature(id, temperature, by = 10)
hue_set_light_temperature(id, temperature, by = 10)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
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. |
Silently returns http response from the bridge, but mostly used for its side effects.
Set IP and username to interact with the api
hue_settings(ip = NULL, username = NULL)
hue_settings(ip = NULL, username = NULL)
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/ |
options Options to be passed to the shiny app. See ?shiny::shinyApp()
for details.
hue_shiny_controller(options = list())
hue_shiny_controller(options = list())
Turn off group
hue_turn_group_off(id)
hue_turn_group_off(id)
id |
If numeric, numeric id of group. If character, name of group. You can check id and names with |
Silently returns http response from the bridge, but mostly used for its side effects.
Turn on group
hue_turn_group_on(id)
hue_turn_group_on(id)
id |
If numeric, numeric id of group. If character, name of group. You can check id and names with |
Silently returns http response from the bridge, but mostly used for its side effects.
Turn off light
hue_turn_light_off(id)
hue_turn_light_off(id)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
Silently returns http response from the bridge, but mostly used for its side effects.
Turn on light
hue_turn_light_on(id)
hue_turn_light_on(id)
id |
If numeric, numeric id of light. If character, name of light. You can check id and names with |
Silently returns http response from the bridge, but mostly used for its side effects.