Simple LED indicator on dashboard


This is definitely a noob question, I’ve only been using Node-RED (and Dashboard) for a couple of days.

This may be as simple as I don’t know the right words to search.

I want to display a “blob” (round, rectangular…) on my dashboard to indicate On/Off, Stop/Go, etc. based on a value.

But, I don’t see anything like it in the dashboard palette and I’ve not found any “how to” help on the web.

I’m happy to go read and experiment, so, pointers are welcome.

“Hey you missed this obvious…” is also welcome. :wink:


Here is one pointer for you :slight_smile:


Thanks, I read that one before I posted. That is above my 2 day experience level.
They discuss/display code that they obviously know where to put it and make it do stuff.

If that code is what it takes, then I need something that tells me what to do with the code they show.


Sharing of examples or why not entire solutions stands on import-export of flow JSON.


Since you are only two days in then I suggest you start by getting experience with the stuff that is easy to do. In this case rather than displaying an LED indication you could use a Text node to show On/Off. This may not look quite as you would like it but functionally I would have thought it was just as good. Once you have mastered the basic principles then you can move on to more sophisticated stuff. When learning any skill it is better to start with the basics.


Thanks for the pointers. After staring at the forum posts suggested by hotNipi I realized it was really just html put in the right place that they were showing.

Just for future readers, the following in a template node will produce round LED like display:

.led-green { margin: 0 auto; width: 24px; height: 24px; background-color: #ABFF00; border-radius: 50%; {

Changing "red" in the

tag will set the desired color. Replacing "red" with "{{msg.payload}}" and then passing "red", "green", etc. as the payload will set the color.
Setting the inbound msg payload to "



I think the forum software hosed your cut and paste. Certainly has for me in the past. Try clicking </> button for "preformatted text" and then paste it in.

I am interested in what you have done.

I created "led like" indicators in the Dashboard by using (abusing) switch buttons and changing the colors and icon picture based on the switch state. Seemed pretty round-about and ugly way to do such a simple thing, but it works fine. I admit it looks perhaps "cooler" than a simple round colored circle LED on a cellphone web-page when using the Dasboard UI I made.

I've practically no html experience so your example might actually get me to first base if I could actually see it.


Well, in a past life a did a reasonable amount of html...but, not saying this is "good" html, just working for me. :wink:
Apparently this forum attempts to interpret pasted html...and the preformatted </> breaks as soon as it hits a new tag or blank line. :frowning:

Grr...won't let me upload them because I'm a new user. WTF.

So, replace all the [ with < and ] with> in this:

.led-green {
margin: 0 auto;
width: 24px;
height: 24px;
background-color: #ABFF00;
border-radius: 50%;
[td][div class="led-green" style="background-color:{{msg.payload}}"][/div][/td]


If you put a line containing three backtick characters on the line before the html and another such line after it then it will be passed through unchanged, eg

<style>can safely be put here</style>
<div>and other html too</div>


Now that's intuitively obvious...not. At least not to me. :face_with_raised_eyebrow:

.led-green {
margin: 0 auto;
width: 24px;
height: 24px;
background-color: #ABFF00;
border-radius: 50%;
<td><div class="led-green" style="background-color:{{msg.payload}}"></div></td>



Hey, I found that example useful! Thanks for posting. :+1:


I copied your code and installed on my dashboard and it is perfect.