If you have Home assistant running with node-red and you have philips hue stuff in your house; you may think it can react slow sometimes. We can fix this very easily by installing the node-red hue magic package.
Installing node-red hue magic
To install hue magic you need to go to your node-red dashboard. head to the hamburger menu and press manage palette.
from there press the install tab, type hue, search for hue magic and press install
After you installed the hue magic palette you will see the nodes at your left hand (when you scroll down) they will look something like:
Using hue magic
Using hue magic is fairy easy. To start you need to add the hue bridge node
After you added the bridge to your flow double click to edit.
After you pressed the pen (2.) the following will pop-up
Be close to your bridge because we need to press it soon. But first press the magnifying glass (1.) select your bridge then press the person (2.). You’ll need to press the button on your hue bridge. After that your bridge is added.
I like to use my hue switch to turn on my shelly smart switch. within home assistant you can make it easy to switch, but it has this delay on it. That isn’t the case with Hue magic. To use your switch do the following.
Add a hue switch node to your flow and edit it.
Since you’ve added your bridge it will be filled automatically (I removed mine). select your switch and press done.
Next you want to use the button, but you don’t know the actions it sends when you press a button. Add a debug node to your flow and double click it.
Select all three check boxes and press done.
Press the button on your hue switch and the values will show below your node.
Open debug menu (hamburger top right corner > view > show sidebar), press the object arrow to expand. Copy path
Add a regular switch node and edit it.
Paste the path you copied in the property field. Add multiple values for turn on, off and brightness if you like. Be sure to match it from the “Name:” value, otherwise it won’t work.
Now you need to add the call service node to add actions to your switch and you’re done.
Hue motion sensor
The hue motion sensor works kind of the same as the switch for the adding part. You need to add the hue motion node to your flow and edit it.
Select your sensor like you did with the switch and press done.
Now add your actions in the flow and it will work when motion is detected.
Above sample flow I use will work even without the light level in between. You only need to add the output of motion sensor to the input of turn on (lamp aan in my sample).
This concludes this tutorial. it’s really easy to achieve this once you know the steps. you can now start creating more difficult flows and go nuts with it. For example using presence detection, which you can find more about here. These are the most common use cases I have. If you’d like to have more samples or an extended tutorial on this let me know down in the comments.