Goal

Now that we managed to light up and switch off our bulb in the first Hue tutorial, we can go further.

At the end of this tutorial, you will be able to change our bulb light color, transition time and intensity.

Configuration

To create the flow, we will begin with the last one, from the first Hue tutorial :

Change the bulb intensity

In this flow, we add an intensity node:

This node sets the intensity of the flow. The default allows a value between 0 and 100, but the Hue can go til 255. This can be set in the node parameters:

In this dialog, just change the Maximum to 255.

Then, you can edit the value in the first tab:

You get the following flow:

Import/clipboard the following into Node-RED (and don’t forget to click on the Deploy button):

[{"id":"fc05d8e2.51b6a8","type":"go","name":"Switch On","x":208,"y":434,"z":"14402721.c52091","wires":[["f189361b.132da8"]]},{"id":"f189361b.132da8","type":"Open","x":388,"y":434,"z":"14402721.c52091","wires":[["3ca0b3cb.b11f7c"]]},{"id":"3ca0b3cb.b11f7c","type":"intensity","property":"intensity","name":"","min":0,"max":"255","val":"84","x":380.5,"y":514,"z":"14402721.c52091","wires":[["4411a267.7e359c"]]},{"id":"4411a267.7e359c","type":"Hue Set","deviceid":"6","serverid":"001788fffe101263","name":"","x":564,"y":554,"z":"14402721.c52091","wires":[[],[]]}]

Change the bulb color

Drag’n drop a color node from the palette:

To configure to color node, double click on the node and pick with your mouse the color you like in the colored circle. You can even then rename your node with the color you choosed :

When all the configuration is done, click on the Deploy button again.

Add a transition time

To change the transition time, we use the intensity node again, but we need to change the parameter of the flow from “intensity” to “transition time”:

you can now change the value in the first tab:

Here is a typical flow:

Import/clipboard the following into Node-RED (and don’t forget to click on the Deploy button):

[{"id":"eed40a2b.274778","type":"go","name":"Switch On","x":96.5,"y":60,"z":"14402721.c52091","wires":[["c4187919.de9168"]]},{"id":"c4187919.de9168","type":"Open","x":250,"y":60,"z":"14402721.c52091","wires":[["6cfad0fc.af1878"]]},{"id":"6cfad0fc.af1878","type":"color","property":"color","color":"#33ff00","name":"","x":230,"y":120,"z":"14402721.c52091","wires":[["f2a0abb.00907d8"]]},{"id":"f2a0abb.00907d8","type":"intensity","property":"intensity","name":"","min":0,"max":"255","val":"255","x":250.5,"y":160,"z":"14402721.c52091","wires":[["e5814055.dc3578"]]},{"id":"9485a1de.1eb3f8","type":"Hue Set","deviceid":"","serverid":"","name":"","x":442,"y":211,"z":"14402721.c52091","wires":[["7ef6a379.b9578c"],["7ef6a379.b9578c"]]},{"id":"b53f1d32.7ddef8","type":"go","name":"Switch Off","x":107.5,"y":271,"z":"14402721.c52091","wires":[["59042d80.28860c"]]},{"id":"e5814055.dc3578","type":"intensity","property":"transitiontime","name":"","min":0,"max":"100","val":"20","x":262.5,"y":200,"z":"14402721.c52091","wires":[["9485a1de.1eb3f8"]]},{"id":"59042d80.28860c","type":"Close","x":261.5,"y":271,"z":"14402721.c52091","wires":[["e5814055.dc3578"]]},{"id":"7ef6a379.b9578c","type":"display","active":true,"x":586.5,"y":211,"z":"14402721.c52091","wires":[]}]

Usage

Now, by clicking on the go node, you can dynamically change your Hue bulb color.

You can also adjust the brightness and the transition time by sliding the values in the intensity nodes configuration bars.

As in the first example, the last go node turns the light off.

You are now done with Hue flows on theThingBox !

You can even make a more complex flow, that makes the color change by clicking on the different go nodes :

Credits

Adapted work of node-red-contrib-hue from urbiworx.de based on Peter Murray hue lib.

Back to top