# HueMagic - Multiple Values in the payload?

**URL:** <https://discourse.nodered.org/t/huemagic-multiple-values-in-the-payload/2644>\
**Category:** General\
**Created:** [28 August 2018 19:26 UTC](https://discourse.nodered.org/t/huemagic-multiple-values-in-the-payload/2644 "2018-08-28T19:26:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [28 August 2018 19:26 UTC](https://discourse.nodered.org/t/huemagic-multiple-values-in-the-payload/2644/1 "2018-08-28T19:26:59Z")

</div>

Hi,

Sorry if I’m missing something obvious, but looking at the instructions for hue magic ([https://flows.nodered.org/node/node-red-contrib-huemagic](https://flows.nodered.org/node/node-red-contrib-huemagic)) how do I add multiple values within a payload message ?

I can turn a hue light on/off , but how do I turn it on to 80% brightness ?

It seems to suggest I have to have two values in the payload, one to turn it on (boleoon) and the other to set the brightnesss (a number/int) ?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [28 August 2018 19:32 UTC](https://discourse.nodered.org/t/huemagic-multiple-values-in-the-payload/2644/2 "2018-08-28T19:32:39Z")

</div>

> [@nodecentral](#):
>
> It seems to suggest I have to have two values in the payload, one to turn it on (boleoon) and the other to set the brightnesss (a number/int) ?

yep - reading the docs I'd say you need to set msg.payload to a boollean true/false to switch on/off and you need to set msg.brightness to a number between 0 and 100 to set the brightness

it implies that once you've set the brightness - it will remember the value and use that the next time you switch off/on again

---

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [28 August 2018 19:41 UTC](https://discourse.nodered.org/t/huemagic-multiple-values-in-the-payload/2644/3 "2018-08-28T19:41:45Z")

</div>

Hi @cymplecy

Thanks for responding, Do you know how I do that within the same msg.payload , I can only seem pick one option (a Boolean, string or number etc.) per inject?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [28 August 2018 19:46 UTC](https://discourse.nodered.org/t/huemagic-multiple-values-in-the-payload/2644/4 "2018-08-28T19:46:46Z")

</div>

This would be one way - feed a number into the change node and get it to swap it into msg.brightness

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a6b4055716a452862d9c58460b95b63dfe1c757a.png)

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [28 August 2018 20:22 UTC](https://discourse.nodered.org/t/huemagic-multiple-values-in-the-payload/2644/5 "2018-08-28T20:22:14Z")

</div>

> [@nodecentral](#):
>
> Hi @cymplecy
> 
> Thanks for responding, Do you know how I do that within the same msg.payload , I can only seem pick one option (a Boolean, string or number etc.) per inject?

You can send an object (JSON), e.g.

`{"on":true,"brightness":40}`

---

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [28 August 2018 20:28 UTC](https://discourse.nodered.org/t/huemagic-multiple-values-in-the-payload/2644/6 "2018-08-28T20:28:21Z")

</div>

Thanks

@cflurin - How do i send an object?

I don’t have that as an option within in the payload drop down list, flow, global, string, number etc ?

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [28 August 2018 20:30 UTC](https://discourse.nodered.org/t/huemagic-multiple-values-in-the-payload/2644/7 "2018-08-28T20:30:54Z")

</div>

`{} JSON`

![hue](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c5b6111982134feaf95944b4d06687292b25f477.png)

---

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [28 August 2018 20:50 UTC](https://discourse.nodered.org/t/huemagic-multiple-values-in-the-payload/2644/8 "2018-08-28T20:50:43Z")

</div>

That works a treat . Many thanks !!
