# LED Status Indicators

**URL:** <https://discourse.nodered.org/t/led-status-indicators/15249>\
**Category:** General\
**Created:** [7 September 2019 21:33 UTC](https://discourse.nodered.org/t/led-status-indicators/15249 "2019-09-07T21:33:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaynel2006](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@shaynel2006](https://discourse.nodered.org/u/shaynel2006)\
**Post date:** [7 September 2019 21:33 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/1 "2019-09-07T21:33:34Z")

</div>

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?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d28eaed73e3f6ff5e10db8baae0f3fe29f749232.png)

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 September 2019 21:49 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/2 "2019-09-07T21:49:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 September 2019 21:57 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/3 "2019-09-07T21:57:14Z")

</div>

Just one thing:

Looking at what you are sending:

`value` ??!!

You want `payload`.

That may help.

---

<div class="post-metadata">

**Author:** ![shaynel2006](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@shaynel2006](https://discourse.nodered.org/u/shaynel2006)\
**Post date:** [7 September 2019 22:20 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/4 "2019-09-07T22:20:58Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 September 2019 22:21 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/5 "2019-09-07T22:21:59Z")

</div>

Ah!

`.msg.payload.value`

No.

`msg.payload`

I'm sure that is the problem.

---

<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:** [7 September 2019 22:35 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/6 "2019-09-07T22:35:10Z")

</div>

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  
 ![05%20PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/ea69d8026538a619150bd3ff76e9a451843ee291.png)  
you need to send boolean `true` (for green) or `false` (for red) in msg.payload.

If you had  
 ![16%20PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f66314cbc1ff2009c93043aff40854390ce89109.png)  
and wanted the led `yellow` you would have to have msg.payload = 2

---

<div class="post-metadata">

**Author:** ![shaynel2006](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@shaynel2006](https://discourse.nodered.org/u/shaynel2006)\
**Post date:** [7 September 2019 22:36 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/7 "2019-09-07T22:36:56Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d27dbf8c07370e3524bc15526c713e6b32d8f7ba.png)  
i still get grey

---

<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:** [7 September 2019 22:41 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/8 "2019-09-07T22:41:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shaynel2006](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@shaynel2006](https://discourse.nodered.org/u/shaynel2006)\
**Post date:** [7 September 2019 22:47 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/9 "2019-09-07T22:47:17Z")

</div>

i had to split the string, it comes in as a large series.  
:#STA:001120,111;L:381;TM:190907174600;A01:0.000;A02:00000;A03:00000;A04:00001;A05:00000;A06:00000;A07:0.000;A08:00000;H01:0.000;H02:00000;H03:00000;H04:00000;H05:00000;H06:00000;H07:0.000;H08:00000;B01:0.000;B02:3.610;B03:3.660;B04:3.640;B05:0.000;B06:3.660;B07:0.000;B08:0.000;K01:03000000;K02:00000400;K03:00000400;K04:00100400;K05:00000400;K06:00000400;K07:03000000;K08:00000400;DF;#

---

<div class="post-metadata">

**Author:** ![shaynel2006](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@shaynel2006](https://discourse.nodered.org/u/shaynel2006)\
**Post date:** [7 September 2019 22:47 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/10 "2019-09-07T22:47:59Z")

</div>

the A01:0000 is off  
0001 is on

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 September 2019 22:49 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/11 "2019-09-07T22:49:49Z")

</div>

(Big hint/give away)

@shaynel2006

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

`function` node.

```auto
msg.payload = msg.payload.value;
return msg;

```

Or:  
use a `change` node.  
and `move` `msg.payload.value` to `msg.payload`

---

<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:** [7 September 2019 23:00 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/12 "2019-09-07T23:00:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [8 September 2019 09:38 UTC](https://discourse.nodered.org/t/led-status-indicators/15249/13 "2019-09-08T09:38:46Z")

</div>

I'm anxious.

C'mon.

We are all wanting to know.

Have you got it worked out?
