Markus Sadler
Markus Sadler

Reputation: 5

Insert msg.payload into LIFX Node as a value

I want to control the brightness of my LIFX bulb by injecting the value of a slider on my NodeRed Dashboard into the node-red-contrib-lifx-api node. I managed to control the light if I am using fixed values but somehow it won't take the msg.payload parameter. Also, no error message is shown on the debug stream.

my flow looks like this:

Screenshot

Is {{msg.payload}} the right syntax to use in this field? the double brackets {{ are working on my other nodes so I am using them here too.

Upvotes: 0

Views: 305

Answers (1)

hardillb
hardillb

Reputation: 59668

Nodes need to be explicitly built to support pulling values in from the input message. Most of them do not use mustache ({{}}) syntax, the preferred way to do it if supported is to leave that value empty in the config dialogue (if you set a value it should not be overriden by an incoming message) and where the values come from in msg should be documented in the info side bar.

Looking at the src for the node it looks like it will take the brightness from msg.brightness so you probably want to use a change node to move the value from msg.payload to msg.brightness before the set-state node.

Upvotes: 0

Related Questions