# \[solved\] Philips Hue and LIFX RGB-sync

**URL:** <https://discourse.nodered.org/t/solved-philips-hue-and-lifx-rgb-sync/21817>\
**Category:** General\
**Created:** [16 February 2020 19:34 UTC](https://discourse.nodered.org/t/solved-philips-hue-and-lifx-rgb-sync/21817 "2020-02-16T19:34:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy8810](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeremy8810/32/17182_2.png) [@jeremy8810](https://discourse.nodered.org/u/jeremy8810)\
**Post date:** [16 February 2020 19:34 UTC](https://discourse.nodered.org/t/solved-philips-hue-and-lifx-rgb-sync/21817/1 "2020-02-16T19:34:42Z")

</div>

Hi There,

I am a bit new to coding with the function-node. What I am trying to do:

I have Philips Hue lights and LIFX lights.

When I change the color of the Philips lights, I want to send this to the Lifx lights to change in the same colour.

The output of Philips is done by an array (if I'm right), like this:  
payload:  
0 : 255  
1 : 255  
2 : 255

I need to change this format to just be comma-seperated like:  
payload: 255,255,255

I made the following function-node:

```auto
var red = msg.payload[0]
var green = msg.payload[1]
var blue = msg.payload[2]

return [red, green, blue];

```

But it's still returning as:  
payload:  
0 : 255  
1 : 255  
2 : 255

How can I change this?

Please help me out, thanks!

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [16 February 2020 19:40 UTC](https://discourse.nodered.org/t/solved-philips-hue-and-lifx-rgb-sync/21817/2 "2020-02-16T19:40:44Z")

</div>

Try

```auto
msg.payload = red+","+green+","+blue

```

---

<div class="post-metadata">

**Author:** ![jeremy8810](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeremy8810/32/17182_2.png) [@jeremy8810](https://discourse.nodered.org/u/jeremy8810)\
**Post date:** [16 February 2020 19:47 UTC](https://discourse.nodered.org/t/solved-philips-hue-and-lifx-rgb-sync/21817/3 "2020-02-16T19:47:12Z")

</div>

Hi Zenofmud,

Thank you for the reply.

The following error is returning now:

 ![noderedv1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/0/e0b186d2277b9fd64ea85026c3c11afba8ad8807.png)

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [16 February 2020 19:49 UTC](https://discourse.nodered.org/t/solved-philips-hue-and-lifx-rgb-sync/21817/4 "2020-02-16T19:49:02Z")

</div>

[https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages)  
Take a look at that link, rather than returning the payload, return a message object.

---

<div class="post-metadata">

**Author:** ![jeremy8810](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeremy8810/32/17182_2.png) [@jeremy8810](https://discourse.nodered.org/u/jeremy8810)\
**Post date:** [16 February 2020 19:49 UTC](https://discourse.nodered.org/t/solved-philips-hue-and-lifx-rgb-sync/21817/5 "2020-02-16T19:49:11Z")

</div>

Nevermind,found it, had to remove the ".payload" in my return rule.

Thank you for helping me out!

Topic closed.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 March 2020 19:49 UTC](https://discourse.nodered.org/t/solved-philips-hue-and-lifx-rgb-sync/21817/6 "2020-03-01T19:49:14Z")

</div>

Closed on 1 March 2020 19:49 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
