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.
67 lines (43 loc) • 4.97 kB
HTML
<script type="text/markdown" data-help-name="hue-temperature">
The "Hue Temperature" node can call up and report the current ambient temperature from a suitable sensor on the bridge.
### Setup
Select the pre-configured Hue Bridge and click the search button to find all the available sensors. If you already know the ID of the sensor, you can also enter it here manually. You can either assign a new name for the sensor internally or choose the predefined name of the sensor. 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 device 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 sensor after each deployment.
If you do not select a sensor 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 sensor by transferring the corresponding sensor ID as a string in `msg.topic` together with your settings.
### Get status
Outputs the current status of the sensor as soon as a `msg.payload` object with the following content has been transferred 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 sensor
### Switch the sensor on / off
If necessary, the sensor can be switched on and off remotely. If the sensor has been switched off, it no longer registers any temperature changes and accordingly no longer outputs them. To do this, pass an object with the following content:
: payload (boolean): `true` switches the sensor on, `false` switches it off
### Status messages from the node
As soon as the sensor has registered a temperature change, the following status message is returned by the node:
#### Status object under `msg.payload`
: active (boolean): Indicates whether the sensor is switched on or off
: reachable (boolean | string): `true` if the sensor is connected to the bridge, `unknown` if the connection status deviates
: connectionStatus (string): The current connection status with the bridge in the form of a string. Can contain `connected`, `disconnected`, `connectivity_issue` or `unidirectional_incoming` as a value
: celsius (float): Indicates the current ambient temperature in °C (degrees Celsius)
: fahrenheit (float): Indicates the current ambient temperature in °F (degrees Fahrenheit)
: temperatureIs (string): Describes the current temperature with the values `very cold`, `cold`, `slightly cold`, `comfortable`, `slightly warm`, `warm`, `hot` or `very hot`
: deviceValue (float): The original value of the temperature from the sensor
: updated (string): Time of the last update of the resource by HueMagic (ISO 8601)
#### Information about the sensor under `msg.info`
: id (string): Indicates the new ID of the sensor
: idV1 (string | boolean): Indicates the old ID of the sensor
: uniqueId (string): The unique ID of the sensor
: deviceId (string): The unique ID of the device
: name (string): The currently set name of the sensor
: type (string): The type of the sensor (always `temperature`)
: softwareVersion (string): The current firmware of the sensor
: battery (float): The current battery level of the sensor
: batteryState (string): The current status of the battery level. Can contain `normal`, `low` or `critical` as a value
: model (object): Contains the model information of the sensor under `id`, `manufacturer`, `name`, `type` and `certified`
#### Status changes under `msg.updated`
Lists individual parameters in the form of an object that have changed compared to the last state of the sensor. If no changes have been registered, this object is empty.
#### Last status of the sensor under `msg.lastState`
Contains the complete status object (see output values above) of the last status before the last registered 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>