The pallet list

I am not sure if I am right, but when I go to Manage pallet, I can see what I have installed and then I can search for things…

I seem to remember that I could go to that list and see a complete list of what is available.
Or am I wrong?

I shall see if I can can find a web version of this list in the mean time.

I am looking for a node to make what I can best describe as an LED to indicate a condition.
Nothing too fancy. Colour may be nice, and size. The closest I have is the “SWITCH” on the dashboard. But it doesn’t quite look the same as an LED or light (if you are old school).

Hi

On the Manage Palette view there are two tabs - Nodes lists what you have installed. Install lets you search the nodes that are available.

The online version of the available nodes is https://flows.nodered.org.

However - node-red-dashboard does not support 3rd-party widgets; by which I mean there are no extra nodes you can install to add extra widgets to your dashboard. To do custom widgets you have to use the ui_template node with the appropriate html/css.

You will find on flows.nodered.org example flows people have shared - if you search there, you may find example dashboards and you can see how they have been created using the ui_template node.

1 Like

Thanks.

I am scrolling through a huge list of stuff at… the site you mentioned.

It makes it difficult to search, but I guess that is all part of the fun.

Use the search box at the top to narrow down the list. Untick the ‘nodes’ box if you are looking for dashboard examples.

The search isn’t very smart, but will do basic keyword filtering.

Hi Trying to learn,

Check out this article…

http://node-red.blogspot.com/2017/12/how-to-display-led-in-node-red-dashboard.html

1 Like

Thanks much.

It just goes to show how you have to keep an open mind on how to do things.

I’m not sure I would have got there without that help.

On that - not wanting to seem ungrateful - is there a way I can make a “macro” so if I want an “LED” on the dashboard, rather than having to get that code (as little as it is) can I make my own node so it is only one thing in the flow?

As it is now (at time of posting) two nodes needed to be put in the flow.

Trying to learn,

Actually you get it done with just the text dashboard node as long as your flow manages to deliver the correct data (color) inside msg.payload, like on below flow (just an example).

[{"id":"7a9e12d2.b175cc","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"99d34e2e.c8784","type":"inject","z":"7a9e12d2.b175cc","name":"","topic":"","payload":"lime","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":221,"y":268,"wires":[["63b99929.c57038"]]},{"id":"63b99929.c57038","type":"ui_text","z":"7a9e12d2.b175cc","group":"5a51405f.04d11","order":3,"width":"3","height":"1","name":"","label":"LED","format":"<font color={{msg.payload}} ><i class=\"fa fa-circle\" style=\"font-size:24px;\"></i></font>","layout":"row-left","x":416.00000762939453,"y":286.00000381469727,"wires":[]},{"id":"3c166ca0.189214","type":"inject","z":"7a9e12d2.b175cc","name":"","topic":"","payload":"red","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":221,"y":308,"wires":[["63b99929.c57038"]]},{"id":"5a51405f.04d11","type":"ui_group","z":"","name":"LED Testing","tab":"d2de201f.cc973","disp":true,"width":"4"},{"id":"d2de201f.cc973","type":"ui_tab","name":"Tab","icon":"dashboard","order":0}]

Again, thanks.

Working on/with it now.

Hi again Andrei.

DON’T WORRY.

Found the problem.

In one of your LEDs you have msg.payload and the other it was msg.colour.

I used the wrong LED and was sending msg.payload and not msg.colour.

Sorry.

Sorry to bother you with this, but I am kind of stuck in understanding why I can’t get something working with the LED idea you showed me.

I have THREE types of replies and so I want the LED to be different colours for the three replies.
(Well, FOUR actually if you want to include the “OFF” condition too.)

I have made a NODE to get the messages and make them “nicer for me”.
Code:

var result_ = msg.payload;
if (result_ == '{"code":0}')
{
    //
    node.status({fill:"green",shape:"dot",text:"Good"});
    msg.payload = "Command successful."
}
if (result_.indexOf('code":1') !== -1)
{
    //
    node.status({fill:"yellow",shape:"dot",text:"Oops"});
    msg.payload = "Oops";
}

if (result_.indexOf('code":127') !== -1)
{
    node.status({fill:"red",shape:"dot",text:"Fail"});
    msg.payload = "Command fail.";
}
return msg;

The msg.payload can be:
“Command successful”
“Oops”
“Command fail”
and finally " "

So I have made another NODE and this is what I have.
Thing is it ALWAYS sends out blue and I don’t get why.

I understand the IF( ) parts, but I am not sure if/why I would need an ELSE in there also.
Other than to speed up flow.

This is the code I have written in the node:

if (msg.payload = " ")
{
    msg.payload = "blue";
}
if (msg.payload == "Command successful")
{
    msg.payload = "lime";
}
if (msg.payload == "Oops")
{
    msg.payload = "yellow";
}
return msg;

What I may do is edit the first NODE and make it have two outputs.
One as is and the second for the LED.

But until I get the code right, it doesn’t really matter.

does not do what you think it does. In javascript = is an assignment, == (or ===) is a comparator. So you are setting msg.payload to " " which it then tests and is true - so is blue.

1 Like

Again I must agree.

Alas I am sitting here (yeah, excuse) bashing away and am getting the syntax of: Arduino, Javascript, NR stuff, Android, Tasker, and a few other things all mixed up.

AND making stupid mistakes.

I usually catch the == in the if (blah =… part, because the program spits an error at me.
Sometimes it could be just a mis-typed thing when I am explaining things.

But if from code, well, it is a bit surprising because of what I just said.

But the bigger problem was that I wasn’t setting the topic (or something) in the message and so it was being skipped.

Once that was set, it all started to fall into place.

Thanks again for the ongoing help.
(and the others.)