Rob's Node-Red Template and Example Flow Thread!

Doesn’t look like the repository’s maintainer is interested anymore… shame. I went ahead and manually updated (using nano) messages.js as described here to fix the Hue groups node, and updated messages.js and api.js as described here to fix the broken Hue light node. Total hack, and I hope these fixes persist if and when a new release is pushed out. If not, I’ll add them back (assuming Philips doesn’t tweak their API and invalidate the fixes).

FYI, for node-red 3, the files are located in the following folder on your Core:
/home/oh-la/data/node-red/node_modules/node-red-contrib-huemagic/huemagic/utils

I did the same now and it kind of works. However sometimes the nodes become unresponsive and the command does not trigger. Is there any better integration? Nearly all my lights are Hue and its a big part of my automation.

If you can guarantee they’ll never be powered off, and you don’t need hue features, you could always pair them directly to core

The built in home assistant auto picked up my hue lights and I’ve seen no issues controlling them there.

The home assistant integration can then be exposed to node-red.

1 Like

It would be a workaround, but why not … Can you elaborate how?
Thanks!

I would start by following the get started instructions for home assistant in the docs. Remembering oh-la needs to be the first user.

From there home assistant already saw the hue lights on the network settings up was about as simple as pushing the button on the bridge.

For the home assistant nodes @RRodman posted a nice example for getting it setup. Let me see if I can find the post.

1 Like

OK - Can post some screens of my settings - But seems like you found the issue/workaround.
I havent addded any new lamps in a bit, so maybe ill face the same issue if/when i do - Guess i can count myself lucky it work for me - at the moment!!
Anyway, hope these help!:

[{"id":"4da9121cb6df2639","type":"change","z":"4650fd536792fcf5","name":"CT-6500k, 25%","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"on\":true, \"brightness\":25, \"colorTemp\":153}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":420,"wires":[["2a650eecbfafda7a"]]},{"id":"1fa4683ee61887bc","type":"hubitat device","z":"4650fd536792fcf5","deviceLabel":"Olivia Sleep Time","name":"","server":"26c9a23e.36f4ce","deviceId":"833","attribute":"switch","sendEvent":true,"x":410,"y":420,"wires":[["958c22d9e45e4b20"]]},{"id":"958c22d9e45e4b20","type":"switch","z":"4650fd536792fcf5","name":"off/on","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":420,"wires":[["91076f91a5d14cbb"],["4da9121cb6df2639"]]},{"id":"2a650eecbfafda7a","type":"hue-light","z":"4650fd536792fcf5","name":"Bathroom","bridge":"7dcda340.c6ab4c","lightid":"8be8bac6-3a9f-4394-9ced-abc2f840cfa2","colornamer":true,"skipevents":false,"initevents":false,"x":900,"y":420,"wires":[[]]},{"id":"26c9a23e.36f4ce","type":"hubitat config","name":"Hubitat","usetls":false,"host":"192.168.20.11","port":"80","appId":"545","nodeRedServer":"http://192.168.20.10:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false,"colorEnabled":false,"color":"#000000"},{"id":"7dcda340.c6ab4c","type":"hue-bridge","name":"Philips hue","bridge":"192.168.20.12","key":"eJKwVfdJ1cgCdCvTV0blnPBKeFuk6Jv4qa1r0lF7","worker":"1","disableupdates":false}]
1 Like

FYI, it’s good practice to sanitize your posts of any API keys, even if they’re only valid inside your network

1 Like

I forgot at time of posting, so i just rolled with it!
But yes, good advice in general!

2 Likes

Yah, I can’t roll with that. Edited out your keys.

1 Like

I fail to see the problem since part of the key was cropped. It would impossible for all but the most determined bad actor to make use of what was visible. Even then it could not be used without access to @bdydrp’s internal net.

Of course it’s best to not show any kind of security key, token, password in the first place but let’s keep things in perspective.

It’s better to set the standard for future posts. So others don’t think it’s OK.

2 Likes

Can anyone share an example for how to properly turn on a Hue scene using contrib-home-assistant-websocket? I have the package installed and connected to HA… everything works well on that front. Just can’t seem to figure out how to fire off my scenes correctly. For example, in my family room I have a 6-bulb group. I have a scene that turns off three of them and dims the other 3. When I use the huemagic node to enable the scene it works, but when I do it with HA websockets nodes it turns on all 6 and dims them all. Would like to ditch huemagic, since it doesn’t appear to be well-supported. Can post more helpful details later tonight - currently not at home and am describing the issue from memory. Hopefully someone has a tip that’ll help!

1 Like

There is a better way, there is a new integration using v2 of the Hue API.

It’s excellent. I’ve been using it this week, and it bypasses all but one of the dependancies that we rely upon with the old Hue node (huemagic). It’s so much faster, no errors (once I removed the old instance).

Details here: GitHub - andesse/HUE-CLIP-API.Node-RED-Flows: Node-Red Flow to communicate with HUE CLIP API V2

My Hue lights are just brilliant now. Working on changing over my motion sensors today.

6 Likes

Thanks @Mike. Does this still require the Hue bridge?

Yes. I suspect most integrations require the hue bridge. Otherwise, it’s through zigbee2mqtt, which is fine, but loose the hue app. Some hue bulbs now are also bluetooth.

1 Like

Can I confirm pre-requisites? Standard NR version (v2.2.3) that comes with Core + the Yadomi module install (via palette)? I tried the non v2 version and was having issues needing me to remove the Yadomi module manually and restarting NR.

I’m on Node Red 3.0.2 But, nothing more than what you suggest.

I’m wondering then if the Yadomi module is only compatible with the latest NR?

I used it with Node-red 2.x and it worked fine :slight_smile: