# Colour picker not controlling my RGBW strip

**URL:** https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664
**Category:** Dashboard
**Created:** [15 November 2022 18:18 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664 "2022-11-15T18:18:19Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)
#### Post date: [15 November 2022 18:18 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/1 "2022-11-15T18:18:19Z")

</div>

I use the colour picker, it sends a hex code. In a function node, I convert that to a value. I believe that is what my RGBW strip requires (debug node 7). As I could not get the function node to send it as payload.value (it gives an error cannot convert to object) I tried using a change node to set payload.value to payload. The same error "Cannot set property of non-object type: payload.value"  
(I have the same problem when I try to use sliders to control the strip)  
I copied the path from debug 7 with the value (in this case 1151), and its payload.value  
What am I missing ? Going round in circles for ages and cant work it out

 ![NR RGBW](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/6/e6722466d910b17a8ee8e29b2ff37b4f53e23d3c.png)  
 ![NR RGBW2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/0/40c7215561379db642d6e91d3b58076a8ebee034.png)  
 ![NR RGBW3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1c52f30b9e5deeed4e2128106a9ff2d38901b7aa.png)  
 ![NR RGBW4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c73a6e7f98f0b4c3e1184e12e9856b044eddf5da.png)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [15 November 2022 18:38 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/2 "2022-11-15T18:38:12Z")

</div>

looks like an issue in the change node, or possible the function node, please export your flow.

---

<div class="post-metadata">

### Author: ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)
#### Post date: [15 November 2022 19:02 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/3 "2022-11-15T19:02:19Z")

</div>

```auto
[{"id":"f89bfeb9950d287a","type":"tab","label":"Flow 3","disabled":false,"info":"","env":[]},{"id":"ba7ee113f22dd2a5","type":"ui_colour_picker","z":"f89bfeb9950d287a","name":"","label":"","group":"9656770e6129dfa3","format":"hex","outformat":"object","showSwatch":true,"showPicker":true,"showValue":true,"showHue":false,"showAlpha":false,"showLightness":true,"square":"false","dynOutput":"false","order":9,"width":0,"height":0,"passthru":true,"topic":"","topicType":"str","className":"","x":190,"y":140,"wires":[["5657f2344b9d03d8"]]},{"id":"f1745573b17c70f8","type":"hs-device","z":"f89bfeb9950d287a","name":"Custom RGB Stairs","device":"3523","server":"e2626888dadf1c4f","feature":"3536","reportonstartup":true,"x":890,"y":140,"wires":[["0b974227e8de9d0e"]]},{"id":"5657f2344b9d03d8","type":"function","z":"f89bfeb9950d287a","name":"function 1","func":"msg.payload = parseInt(msg.payload,16);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":140,"wires":[["6a021d529f5e3f0d"]]},{"id":"6a021d529f5e3f0d","type":"change","z":"f89bfeb9950d287a","name":"","rules":[{"t":"set","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":140,"wires":[["f1745573b17c70f8","2bdd4ae4b803f8bc"]]},{"id":"0b974227e8de9d0e","type":"debug","z":"f89bfeb9950d287a","name":"debug 7","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":960,"y":220,"wires":[]},{"id":"2bdd4ae4b803f8bc","type":"debug","z":"f89bfeb9950d287a","name":"debug 8","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":760,"y":240,"wires":[]},{"id":"9656770e6129dfa3","type":"ui_group","name":"Default","tab":"1fef7b435affdeb3","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"e2626888dadf1c4f","type":"hs-server","name":"new HS4","host":"192.168.0.7","port":"81"},{"id":"1fef7b435affdeb3","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)
#### Post date: [15 November 2022 19:03 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/4 "2022-11-15T19:03:11Z")

</div>

I tried getting it into 1 line, it says single line but it isnt. I used the `

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [15 November 2022 19:17 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/5 "2022-11-15T19:17:45Z")

</div>

I think you need to use the "Compact" option when you Export your flow.  
 ![export_compact](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/1/11f9f504674335269a3d8a03e5d55e39343a3d24.png)

---

<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: [15 November 2022 19:19 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/6 "2022-11-15T19:19:10Z")

</div>

You need three back tics on a line before your code and again on a line after your code (I've changed it so you can edit your post and see what I did)  
To get the flow to come out in one line, when exporting

 ![Screen Shot 2022-11-15 at 2.15.53 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/e/bef299b3eb915c8e811748ab1d94523140ddc508.png)

---

<div class="post-metadata">

### Author: ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)
#### Post date: [15 November 2022 19:25 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/7 "2022-11-15T19:25:06Z")

</div>

Got it. But I dont have these ticks on my keyboard, I copied and pasted them (UK keyboard)

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [15 November 2022 19:26 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/8 "2022-11-15T19:26:37Z")

</div>

Well, whatever you have done - you have achieved the correct result.

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [15 November 2022 19:36 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/9 "2022-11-15T19:36:56Z")

</div>

If you're in the UK, I bet you do have the 'back tick' character on your keyboard (under the Escape key).

 ![back_tick](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/ae116e8a4e0171052a10f3298960102db23cc1b7.jpeg)

---

<div class="post-metadata">

### Author: ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)
#### Post date: [15 November 2022 19:38 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/10 "2022-11-15T19:38:10Z")

</div>

Back to my issue. I have done more testing. In my system (Homeseer) the RGBW strip has 5 devices. A custom rgb, red, green, blue and white. Looking at the debug from their nodes, the all have numerical vales in payload.value  
If I use a inject node to send a payload.value to one of the red green or blue, that works. They dim to the correct value. the custom rgb, it shows a numerical value in the debug too, but if I send it via a inject node, nothing happens.

---

<div class="post-metadata">

### Author: ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)
#### Post date: [15 November 2022 19:38 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/11 "2022-11-15T19:38:31Z")

</div>

Ooops. Yes.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [15 November 2022 19:46 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/12 "2022-11-15T19:46:36Z")

</div>

Looks like you are trying to set an object property to a number, try move instead in change node.  
Move `msg.` `payload`  
to `msg.` `payload.value`

What format are you trying to send to the HA node? As you get a hex string from the colour picker, then parse it to turn it to a decimal number, seems strange.

I doubt the function node is required.

---

<div class="post-metadata">

### Author: ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)
#### Post date: [15 November 2022 19:58 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/13 "2022-11-15T19:58:24Z")

</div>

I have done some more testing with a inject node. I am not sure what the custom rgb node wants. If I send a numerical value nothing happens. If I send hex, I get a unexpected response.  
If I set the custom rgb via Homeseer, it shows a numerical value in payload.value, but if I try to set it to that value, it doesnt work. Does not make sense. I need to find out what to send to it on the Homeseer forum.

In the meantime, I can try to get the sliders for rgbw working. The slider sends a message, payload 87  
Now, I thought it would be easy to get that into payload.value, but it isnt. Same error as I had before, "Cannot set property of non-object type: payload.value"

```auto
[{"id":"7adcb119df4355d4","type":"ui_slider","z":"b06e29ef0f91c806","name":"Plinth Red","label":"Plinth Red","tooltip":"","group":"b4b62be764575cb8","order":5,"width":0,"height":0,"passthru":true,"outs":"all","topic":"","topicType":"str","min":0,"max":"255","step":1,"className":"red-slider big-thumb","x":530,"y":220,"wires":[["4a5e23e43245466b"]]},{"id":"4a5e23e43245466b","type":"change","z":"b06e29ef0f91c806","name":"","rules":[{"t":"set","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":100,"wires":[["3f11b29e8ba005cd","d52d0081e8c0e4ff"]]},{"id":"b4b62be764575cb8","type":"ui_group","name":"Kitchen","tab":"32db7b0dc4c9ea67","order":2,"disp":true,"width":5,"collapse":false,"className":""},{"id":"32db7b0dc4c9ea67","type":"ui_tab","name":"Lights","icon":"mi-wb_incandescent","order":4,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)
#### Post date: [16 November 2022 00:10 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/14 "2022-11-16T00:10:06Z")

</div>

A change node which moves the value and adds topic control has done it.

---

<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: [16 December 2022 00:10 UTC](https://discourse.nodered.org/t/colour-picker-not-controlling-my-rgbw-strip/70664/15 "2022-12-16T00:10:13Z")

</div>

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