node-red-contrib-huemagic 4.0.2 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/examples/Hue Bridge.json +1 -1
- package/huemagic/hue-bridge-config.html +4 -4
- package/huemagic/hue-bridge-config.js +130 -127
- package/huemagic/hue-bridge.js +5 -5
- package/huemagic/hue-brightness.html +7 -7
- package/huemagic/hue-brightness.js +11 -5
- package/huemagic/hue-buttons.html +7 -7
- package/huemagic/hue-buttons.js +11 -5
- package/huemagic/hue-group.html +11 -11
- package/huemagic/hue-group.js +3 -3
- package/huemagic/hue-light.html +7 -7
- package/huemagic/hue-light.js +3 -3
- package/huemagic/hue-motion.html +7 -7
- package/huemagic/hue-motion.js +11 -5
- package/huemagic/hue-rules.html +5 -5
- package/huemagic/hue-rules.js +10 -4
- package/huemagic/hue-scene.html +5 -5
- package/huemagic/hue-scene.js +1 -1
- package/huemagic/hue-temperature.html +7 -7
- package/huemagic/hue-temperature.js +11 -5
- package/huemagic/locales/de/hue-bridge.json +1 -1
- package/huemagic/locales/en-US/hue-bridge.json +1 -1
- package/huemagic/locales/en-US/hue-buttons.html +1 -1
- package/huemagic/locales/en-US/hue-magic.html +2 -2
- package/huemagic/locales/en-US/hue-motion.html +1 -1
- package/huemagic/locales/en-US/hue-temperature.html +1 -1
- package/huemagic/utils/api.js +45 -45
- package/huemagic/utils/messages.js +124 -124
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ HueMagic provides several input and output nodes for Node-RED and is the most in
|
|
|
25
25
|
* Extensively documented in English & German
|
|
26
26
|
|
|
27
27
|
### Installation
|
|
28
|
-
HueMagic was written for **Node.js 14+** and **Node-RED v2.1+**. It supports the square-shaped Hue Bridge with the **
|
|
28
|
+
HueMagic was written for **Node.js 14+** and **Node-RED v2.1+**. It supports the square-shaped Hue Bridge with the **firmware 1948086000+** or higher. You can install HueMagic directly via the [Node-RED Palette Manager](https://nodered.org/docs/user-guide/editor/palette/manager) or manually using [npm / yarn](https://nodered.org/docs/user-guide/runtime/adding-nodes).
|
|
29
29
|
|
|
30
30
|
`npm install node-red-contrib-huemagic`
|
|
31
31
|
|
|
@@ -46,9 +46,9 @@ _Please make sure that you deactivate other Hue-related nodes in Node-RED and me
|
|
|
46
46
|
|
|
47
47
|
### Examples
|
|
48
48
|
|
|
49
|
-
HueMagic provides a large selection of full featured sample flows for all nodes. You can find these examples in the
|
|
49
|
+
HueMagic provides a large selection of full featured sample flows for all nodes. You can find these examples in the [examples folder on GitHub](https://github.com/Foddy/node-red-contrib-huemagic/tree/master/examples) or directly in Node-RED. 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.
|
|
50
50
|
|
|
51
|
-
<img alt="Instructions to import examples in Node-RED" src="https://user-images.githubusercontent.com/5302050/148696808-f730ad36-8d0b-4b5b-99b2-1917831f8916.gif" width="100%">
|
|
51
|
+
<a href="https://github.com/Foddy/node-red-contrib-huemagic/tree/master/examples"><img alt="Instructions to import examples in Node-RED" src="https://user-images.githubusercontent.com/5302050/148696808-f730ad36-8d0b-4b5b-99b2-1917831f8916.gif" width="100%"></a>
|
|
52
52
|
|
|
53
53
|
## Hue Bridge
|
|
54
54
|
The "Hue Bridge" node is a universal node that can output all settings of the bridge and status messages from other nodes.
|
|
@@ -186,11 +186,11 @@ Create an `array` with the respective animation steps in the form of an object a
|
|
|
186
186
|
|
|
187
187
|
If you have created your own animation that you would like to share with others, add it at `/huemagic/animations/XXX-youranimationname.json` and create a pull request. Take a look at [this directory](https://github.com/Foddy/node-red-contrib-huemagic/tree/master/huemagic/animations) for structure help.
|
|
188
188
|
|
|
189
|
-
### Example of
|
|
189
|
+
### Example of a custom animation
|
|
190
190
|
|
|
191
191
|
This example shows what a simple animation could look like. In the first step, the delay of 500 milliseconds is waited for. The color of the light is then slowly changed to red over a period of one second. As soon as the light has completely changed to red, the second step is carried out, which also has a delay of 500 milliseconds. Finally the color changes to blue.
|
|
192
192
|
|
|
193
|
-
If you have set the animation to
|
|
193
|
+
If you have set the animation to loop, this process is repeated indefinitely until you manually stop the animation or redeploy the node.
|
|
194
194
|
|
|
195
195
|
Pass the following object in `msg.payload` to play the example animation.
|
|
196
196
|
|
|
@@ -454,7 +454,7 @@ The "Hue Buttons" node receives switching events from input devices connected to
|
|
|
454
454
|
|
|
455
455
|
### Node-RED Setup Instructions
|
|
456
456
|
|
|
457
|
-
Select the pre-configured Hue Bridge and hit the search button to find all the available switches/buttons. If you already know the ID of the
|
|
457
|
+
Select the pre-configured Hue Bridge and hit the search button to find all the available switches/buttons. If you already know the ID of the switches/buttons, you can also enter it here manually. You can either assign a new name for the switches/buttons internally or keep the predefined name of the device. 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 output any switching events. 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 switches/buttons after each deployment.
|
|
458
458
|
|
|
459
459
|
If you do not select a switch/button 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.
|
|
460
460
|
|
|
@@ -532,7 +532,7 @@ If necessary, the sensor can be turned on and off remotely. If the sensor has be
|
|
|
532
532
|
|
|
533
533
|
|Property|Description|
|
|
534
534
|
|--|--|
|
|
535
|
-
| payload (boolean) | `true` turns the sensor on
|
|
535
|
+
| payload (boolean) | `true` turns the sensor on, `false` turns it off |
|
|
536
536
|
|
|
537
537
|
### Status messages from the node
|
|
538
538
|
|
|
@@ -615,7 +615,7 @@ As soon as the sensor has registered a temperature change, the following status
|
|
|
615
615
|
| 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 |
|
|
616
616
|
| celsius (float) | Indicates the current ambient temperature in °C (degrees Celsius) |
|
|
617
617
|
| fahrenheit (float) | Indicates the current ambient temperature in °F (degrees Fahrenheit) |
|
|
618
|
-
| temperatureIs (string) | Describes the current temperature with the values
|
|
618
|
+
| temperatureIs (string) | Describes the current temperature with the values `very cold`, `cold`, `slightly cold`, `comfortable`, `slightly warm`, `warm`, `hot` or `very hot` |
|
|
619
619
|
| deviceValue (float) | The original value of the temperature from the sensor |
|
|
620
620
|
| updated (string) | Time of the last update of the resource by HueMagic (ISO 8601) |
|
|
621
621
|
|
|
@@ -796,9 +796,9 @@ If the status of the node has changed via a certain command, the entire command
|
|
|
796
796
|
|
|
797
797
|
# Changelog
|
|
798
798
|
|
|
799
|
-
### v4.0.
|
|
799
|
+
### v4.0.3 (latest)
|
|
800
800
|
|
|
801
|
-
> **Attention!** HueMagic v4
|
|
801
|
+
> **Attention!** HueMagic v4+ has been almost completely rewritten under the hood and requires at least the (square-shaped) Philips Hue Bridge firmware 1948086000+ from November 1st, 2021 ([Upgrade instructions](https://www.lighting.philips.com/content/B2C/en_US/microsites/meethue/marketing-catalog/huewireless_ca/support/security-advisory/general/where-and-how-can-i-update-my-hue-system-with-the-latest-software.html)) and Node-RED v1+ ([Upgrade instructions](https://nodered.org/docs/getting-started/local#upgrading-node-red)). If you are upgrading from a previous HueMagic version to the v4, you will have to reconfigure (not completely rebuild) all nodes by clicking them and selecting the appropriate device from the list. This also applies to nodes / functions that are operated in universal mode, as the numeric identifiers of the latest Philips Hue API version have been replaced in UUIDs. The nodes "Hue Switch", "Hue Button" & "Hue Tap" have been replaced in v4 by the universal and uniform node "Hue Buttons", which works with all button / switch devices that are connected to the Hue Bridge (please note here also the new API in the documentation). The request and return objects of the individual nodes are largely compatible with older HueMagic versions - with the exception of the nodes "Hue Bridge", "Hue Buttons", "Hue Scene" & "Hue Group". These need to be adjusted in the v4. Make sure that you meet the minimum technical requirements and have a quiet minute for the migration before upgrading to the v4.
|
|
802
802
|
|
|
803
803
|
* HueMagic speaks now directly with the bridge without any submodules *(huejay dependency removed)*
|
|
804
804
|
* Migrated to the newest CLIP/v2 API version from the Philips Hue bridge
|
package/examples/Hue Bridge.json
CHANGED
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
// GET THE SENSORS
|
|
92
92
|
$.get('hue/bridges')
|
|
93
93
|
.done( function(data) {
|
|
94
|
-
var
|
|
95
|
-
if(
|
|
94
|
+
var allResources = JSON.parse(data);
|
|
95
|
+
if(allResources.length <= 0)
|
|
96
96
|
{
|
|
97
97
|
notification.close();
|
|
98
98
|
RED.notify(scope._("hue-bridge-config.config.none-found"), { type: "error" });
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
// SET OPTIONS
|
|
103
|
-
|
|
103
|
+
allResources.forEach(function(resource)
|
|
104
104
|
{
|
|
105
|
-
options[
|
|
105
|
+
options[resource.ip] = { value: resource.ip, label: resource.ip };
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
// SELECT CURRENT VALUE
|