LED Status Indicators

Hi All, hoping i could get some assistance.
i have a 2 channel node that sends 0 when ok and 1 when closed.
i want to display a LED status light.
Green for 0
Red for 1
i have changed 1 to True and 0 to False
i have tried using the Contrib-UI LED but i cant get the LED to change color from grey.
What am i missing?

I don't know the ui-led well enough but I would guess it wants a msg.payload of just the values you need, so just true or false

Just one thing:

Looking at what you are sending:

value ??!!

You want payload.

That may help.


this is what i have.
i still cant get it to change color





I'm sure that is the problem.

From the node's Info tab

The msg.payload value is looked up in the Color for Values table and the first matching entry's color lights up the LED. If not matching value is found the LED reverts back to it's invalid, off state and turns gray and unlit.

so if you have
you need to send boolean true (for green) or false (for red) in msg.payload.

If you had
and wanted the led yellow you would have to have msg.payload = 2

i still get grey

so what is in msg.payload? (hint I'm not asking about msg.payload.value)

i had to split the string, it comes in as a large series.

the A01:0000 is off
0001 is on

(Big hint/give away)


There are a few ways to do this specific thing.
I've hinted at one, but......

function node.

msg.payload = msg.payload.value;
return msg;

use a change node.
and move msg.payload.value to msg.payload

Lets make it simple, to turn the led RED you need set msg.payload to 1.
to turn it green you need to set msg.payload to 0

Put an inject in your flow and set msg.payload to a numeric 1. Connect that to the LED node, deplay and press the inject button. What happens?

I'm anxious.


We are all wanting to know.

Have you got it worked out?