Colour picker not controlling my RGBW strip

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 RGBW3
NR RGBW4

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

[{"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}]

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

I think you need to use the "Compact" option when you Export your flow.
export_compact

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

1 Like

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

1 Like

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

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

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.

Ooops. Yes.

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.

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"

[{"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}]

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

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