node-red-contrib-huemagic
Version:
Philips Hue node to control bridges, lights, groups, scenes, rules, taps, switches, buttons, motion sensors, temperature sensors and Lux sensors using Node-RED.
76 lines (48 loc) • 6.34 kB
HTML
<script type="text/markdown" data-help-name="hue-group">
The "Hue Group" node can control several lights behind a group on the bridge at the same time.
### Setup
Select the pre-configured Hue Bridge and hit the search button to find all available groups. If you already know the ID of a group, you can also enter it here manually. You can either assign a new name for the group internally or choose the predefined name. Optionally, you can also deactivate all automatic status messages for this node by clicking the setting "Skip events from node". The node will then no longer issue any updates. Alternatively, you can also choose whether the node's initialization message should not be suppressed when Node-RED is started. If you activate this setting, you will receive a status message for the currently selected group after each deployment.
If you do not select a group and use the node configuration in this way, the node works in the so-called "universal mode". In this mode, the node receives and outputs all status messages of the same type. You can also apply settings in universal mode to a specific group by transferring the corresponding group ID as a string in `msg.topic` together with your settings.
### Get status
Outputs the current status of the group as soon as a `msg.payload` object with the following content has been passed to the node. Alternatively, you can also press the button in the Node-RED interface without having to pass a message to the node beforehand.
: status (boolean): Returns the current status of the group
### Turn on / off (simple)
To quickly turn an entire group on or off in simple mode, pass an object with the following content to the node. Please note that the command will only be executed if the current status of the group does not match your desired status. This means that all lights have to be switched off before you can switch them on with the `true` command.
: payload (boolean): `true` switches the whole group on, `false` switches them off
### Group commands (extended)
In addition to simply switching it on and off, there are also many other options available for controlling the group. All nodes in HueMagic can be controlled with additive commands. This means that you can first pass one setting and then another setting in a later command without discarding the previous setting. Transfer the following parameters to an `msg.payload` object to make more extensive settings for the group:
: on (boolean): `true` switches the entire group on, `false` switches it off (please note the note above)
: toggle (boolean | any): Toggles between switching on and off, depending on the previous status of the group
: brightness (int | string): Percentage value of the light brightness (0-100) or a string with the value `auto` to automatically set the light brightness based on the current time
: brightnessLevel (int): Numerical value of the light brightness (0-254)
: color (string): `random` to set a random color or an English color name (e.g. `red`)
: hex (string): Color value in hexadecimal in the form of a string
: rgb (array [0,0,0]): Color value in RGB format in the form of an array
: xyColor (object {x [float], y [float]}): Color value in the XY color format in the form of an object
: image (string): Path of an image (local or on the web) to set the current color of the group to the average color of the image
: colorTemp (int | string): Value between 153 and 500 to set the color temperature of the group or the values `cold`, `normal`, `warm`, `hot` and `auto` - where `auto` is the color temperature based on the current time
: transitionTime (float): Transition time of the current setting in seconds. If `0` is passed, the group changes to the desired setting immediately. If you pass it to `3`, the group changes to the desired setting with a slight transition in the next 3 seconds
: colorloop (float): Plays a “colorloop” animation for the selected duration in seconds and then changes back to the group's original state
: alert (float): Plays an "alert" animation for the selected duration in seconds and then switches back to the original status of the group
### Status messages from the node
If a change in the group is detected, the following status message is returned from the node. Please note that the group only outputs status messages when either the last light is switched off or when the first light is switched on (if all were switched off beforehand).
In contrast to the "Hue Light" node, you have much less status information available here, as a group can contain many different device types with different values that cannot be combined.
#### Status object under `msg.payload`
: on (boolean): State of the group, where `true` stands for on and `false` for off
: updated (string): Time of the last update of the resource by HueMagic (ISO 8601)
#### Information about the group under `msg.info`
: id (string): Indicates the new ID of the group
: idV1 (string | boolean): Indicates the old ID of the group
: name (string): The currently set name of the group
: resources (object) : Contains all devices/resources behind the group
: type (string): The type of the group (always `group`)
#### Status changes under `msg.updated`
Lists individual parameters in the form of an object that have changed compared to the last state of the group. If no changes have been registered, this object is empty.
#### Last status of the light under `msg.lastState`
Contains the complete status object (see output values above) of the last status before the last change. If the last state of HueMagic has not yet been registered, it will output `false`.
#### Last command under `msg.command` (optional)
If the status of the node has changed via a certain command, the entire command that was executed is also output. Otherwise this object will not be output by the node.
### Examples from HueMagic
HueMagic provides some sample configurations for this node. To import a full featured example into your Node-RED interface, click on the Node-RED menu icon, then select "Import" and navigate to "Examples" in the sidebar of the popup. Then select the HueMagic folder and your desired node to import a sample flow.

</script>