Show icon on dashboard

4,276 views
Skip to first unread message

Colin Law

unread,
Sep 27, 2016, 3:36:11 AM9/27/16
to node...@googlegroups.com
I want to show an image on the dashboard that changes with the state
of an input (red/green led etc). Is there a way of doing that other
than using a template node?

Colin

Dave C-J

unread,
Sep 27, 2016, 3:44:11 AM9/27/16
to node...@googlegroups.com
Yes - use a text node and pass an fa-icon as html eg
[{"id":"ec83dff.d1e6c2","type":"inject","z":"3ee56046.c933c","name":"","topic":"press","payload":"<i class=\"fa fa-lightbulb-o fa-2x nr-dashboard-warning\"></i>","payloadType":"str","repeat":"","crontab":"","once":true,"x":130,"y":60,"wires":[["995494b.3a90268"]]},{"id":"995494b.3a90268","type":"ui_text","z":"3ee56046.c933c","group":"aa443cfa.462d4","order":1,"width":"1","height":"1","name":"default","label":"","format":"{{msg.payload}}","layout":"row-center","x":270,"y":60,"wires":[]},{"id":"aa443cfa.462d4","type":"ui_group","z":"3ee56046.c933c","name":"Second","tab":"513b7ff4.3de5d","order":2,"disp":true,"width":"5"},{"id":"513b7ff4.3de5d","type":"ui_tab","z":"3ee56046.c933c","name":"Home","icon":"link","order":1}]

Colin Law

unread,
Sep 27, 2016, 11:52:30 AM9/27/16
to node...@googlegroups.com
That's great Dave, thanks. I thought I had seen something like that
mentioned somewhere but could not find it. I see that I can also use
<img src=".."/> to point to images in the dir defined for httpStatic.

I saw a reference elsewhere that I can use Material icons, is there a
guide to how to do that, I could not find anything.

Thanks

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/CACXWFwLY5zbq5RD870a8mzg3Xba_-bEGXfTp-yUswNRiUKU_DQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Julian Knight

unread,
Sep 27, 2016, 12:12:19 PM9/27/16
to Node-RED
I think there is sometihng like that in the thread that announce 2.0.2

Colin Law

unread,
Sep 27, 2016, 12:37:54 PM9/27/16
to node...@googlegroups.com
Ah right, that is where I saw the ref to the fa-icons, I new I had
seen it somewhere. I don't see any ref to using the Material ones
though. I see in the Switch node one can use them, but I don't know
how to do it in a text node. Sorry if it is obvious I am still
suffering from information overload in node-red, there is a lot of
this great framework to take in.

Cheers

Colin
> https://groups.google.com/d/msgid/node-red/7f31b5a6-1957-4bce-a052-0fadcf63fbfd%40googlegroups.com.

Julian Knight

unread,
Sep 27, 2016, 4:04:04 PM9/27/16
to Node-RED
Sorry Colin, I tend to drop into the template node as the others rarely seem to quite fit what I want to do. My latest "switch" used the template node to deliver a colour changing button. I found that the actual switch node went bonkers whenever accessed from a mobile browser.

Dave C-J

unread,
Sep 27, 2016, 7:05:25 PM9/27/16
to node...@googlegroups.com

Julian do you have an example of it "going bonkers" ? That is the kind of bug we would like to fix.... If reported :-)

Julian Knight

unread,
Sep 28, 2016, 6:34:18 PM9/28/16
to Node-RED
Ah, well I've replaced it. But it was a set of 9 switch nodes. Fed from an MQTT input node and connected to an MQTT output node.

Once accessed from a mobile browser (mainly tried on iOS both iPad and iPhone), once one of the switches was activated it would start rapidly switching back and forth on its own. Clearly some kind of loop since the Pi was pretty well locked up after than and would have to be restarted completely.

Dave C-J

unread,
Sep 28, 2016, 6:54:45 PM9/28/16
to node...@googlegroups.com
ah. so the recent option to disable passthru of messages to prevent feedback may well already have cured it. it was doing what it was supposed to - but the time delays on the mobile connection allowed two (or more) messages to end up circling each other.

Nothing wrong with the node per se... 

Julian Knight

unread,
Sep 29, 2016, 1:46:45 AM9/29/16
to Node-RED
OK, might be worth mentioning that in the docs then as it certainly crashes a Pi running NR and Mosquitto quite consistently.

Using a set of template nodes each containing a button doesn't do that even though the rest of the wiring is the same.

Dave C-J

unread,
Sep 29, 2016, 3:25:16 AM9/29/16
to node...@googlegroups.com

If it still does it can you show us the flow so we can recreate ?

Julian Knight

unread,
Sep 29, 2016, 4:04:53 AM9/29/16
to Node-RED
I'll have a go when I get some time.
Reply all
Reply to author
Forward
0 new messages