# Show ping status (on or off) as Red or Green Lamp on Dashboard

**URL:** <https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407>\
**Category:** Dashboard\
**Created:** [21 March 2020 12:23 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407 "2020-03-21T12:23:29Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![knieshe1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knieshe1/32/17635_2.png) [@knieshe1](https://discourse.nodered.org/u/knieshe1)\
**Post date:** [21 March 2020 12:23 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/1 "2020-03-21T12:23:29Z")

</div>

I check my diverse servers by the pingtime!  
I will show the status

---

<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:** [21 March 2020 12:26 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/2 "2020-03-21T12:26:55Z")

</div>

I'm confused. Are you making a statement or asking for help?

If you are asking for help, what have you tried so far?

---

<div class="post-metadata">

**Author:** ![knieshe1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knieshe1/32/17635_2.png) [@knieshe1](https://discourse.nodered.org/u/knieshe1)\
**Post date:** [21 March 2020 12:32 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/3 "2020-03-21T12:32:04Z")

</div>

I want to show the pingstatus as red or green lamp or bottem  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b9187e5b650d782e584d95930af25db42f25fc6.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 March 2020 12:56 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/4 "2020-03-21T12:56:34Z")

</div>

First you need to decide what constitutes red and green. Then you can use a button or switch with appropriate CSS styles that change the colour according to your decision.

---

<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:** [21 March 2020 13:28 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/5 "2020-03-21T13:28:25Z")

</div>

> [@zenofmud](#):
>
> what have you tried so far?

what have you tried so far? all you have done so far is show a graph. Do you want a ui-led on the dashboard along with that graph or someting else? You have to give more information to get any help.

---

<div class="post-metadata">

**Author:** ![knieshe1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knieshe1/32/17635_2.png) [@knieshe1](https://discourse.nodered.org/u/knieshe1)\
**Post date:** [21 March 2020 13:43 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/6 "2020-03-21T13:43:52Z")

</div>

First of all!  
Sorry about my english.  
Could you please send my a little exemple?

My input are values of ping [0,24 and so on)this must show a green button and value (0 = zerro) must show a red button.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 March 2020 14:18 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/7 "2020-03-21T14:18:15Z")

</div>

Start by installing node-red-node-ping and feed that into a debug node to see if you can get that bit going.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 March 2020 15:54 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/8 "2020-03-21T15:54:00Z")

</div>

> [@knieshe1](#):
>
> My input are values of ping [0,24 and so on)this must show a green button and value (0 = zerro) must show a red button.

Really, don't you mean the other way around? You need to think about what the data actually means. You will never get a zero ping. Think about what happens when something doesn't respond to a ping?

While you are doing that, I strongly recommend reading up about what a ping actually does and what the results actually mean. A ping only hits the hardware, it doesn't mean that anything other than the network card itself is actually working.

---

<div class="post-metadata">

**Author:** ![chucksteele](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@chucksteele](https://discourse.nodered.org/u/chucksteele)\
**Post date:** [21 March 2020 19:33 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/9 "2020-03-21T19:33:29Z")

</div>

I used the 'Ping' Node and the ui-LED node. Maybe mine is too simple, but if the ping is successful, a '1' the ui-led displays a green color; if the ping is unsuccessful, a '0', the ui-led displays a red color.  
As TotallyInformation states, it only reflects the state of the network card. My simpleton philosophy is if the card is up, then the device is up...(maybe not working correctly, but its not powered off. As the devices are remote, saves me a walk)

---

<div class="post-metadata">

**Author:** ![knieshe1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knieshe1/32/17635_2.png) [@knieshe1](https://discourse.nodered.org/u/knieshe1)\
**Post date:** [21 March 2020 20:04 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/10 "2020-03-21T20:04:45Z")

</div>

Hi chucksteele,  
thank you for the answer,  
Could you please send me a little exemple as FLOW  
Thanks  
Heinz

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 March 2020 21:38 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/11 "2020-03-21T21:38:35Z")

</div>

> [@knieshe1](#):
>
> Could you please send me a little exemple as FLOW

As I suggested, start with the ping node and get that working. This is a very simple requirement and perfect for learning the basics, but to learn you must try things yourself. Then if it does not work come back and say what is not working or what you do not understand.

---

<div class="post-metadata">

**Author:** ![knieshe1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knieshe1/32/17635_2.png) [@knieshe1](https://discourse.nodered.org/u/knieshe1)\
**Post date:** [21 March 2020 22:10 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/12 "2020-03-21T22:10:03Z")

</div>

🆗 I understand.  
With the ping node I got values and this is for me not possible change to boolan. How can I do this?

---

<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:** [21 March 2020 23:11 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/13 "2020-03-21T23:11:05Z")

</div>

Hi.

Yes, if you install the `advanced ping`node it will be a lot easier.

Not wanting to muddy the waters - make it more confusing than it already is - I have a similar thing I do.

This flow pings my IP addresses.

I have cut it back a bit, but I think it will do what you want.

You will have to edit the two nodes as marked.

The first is for your IP addresses to ping and the second is to _route_ the replies to their respective outputs.

```auto
[{"id":"925b0f39.d9c58","type":"function","z":"8abed8bb.324b88","name":"check list","func":"var checks = [\n {'topic':'Blacksheep', 'addr':\"192.168.0.1\"},\n {'topic':'Relay Board1', 'addr':\"192.168.0.21\"},\n {'topic':'W.I.B', 'addr':\"192.168.0.34\"},\n {'topic':'MusicPi', 'addr': \"192.168.0.82\"}, \n {'topic':'BedPi', 'addr': \"192.168.0.83\"}, \n {'topic':'PiFace', 'addr': \"192.168.0.86\"},\n {'topic':'EyeSpyPi', 'addr': \"192.168.0.89\"},\n {'topic':'CameraPi', 'addr': \"192.168.0.91\"},\n {'topic':'PortaPi', 'addr': \"192.168.0.92\"},\n {'topic':'TelePi', 'addr': \"192.168.0.93\"},\n {'topic':'BeefPi', 'addr': \"192.168.0.94\"},\n {'topic':'TimePi', 'addr': \"192.168.0.99\"},\n {'topic':'SG NAS', 'addr': \"192.168.0.200\"},\n {'topic':'Thecus', 'addr': \"192.168.0.201\"},\n {'topci':'Nas-T-Nuc', 'addr': \"192.168.0.202\"},\n {'topic':'Beyonwiz', 'addr':\"192.168.0.211\"},\n {'topic':'TIVX', 'addr':\"192.168.0.212\"},\n {'topic':'Lab', 'addr':\"192.168.0.221\"},\n {'topic':'1801 Router', 'addr':\"192.168.0.222\"},\n {'topic':'LinkSys', 'addr':\"192.168.0.250\"},\n {'topic':'Printer', 'addr': \"192.168.0.253\"},\n {'topic':'Gateway', 'addr': \"192.168.0.254\"},\n {'topic':'UpLink', 'addr': \"61.9.194.49\"},\n// {'topic':'(E) WiFi WAP1','addr': \"192.168.1.1\"},\n {'topic':'Network', 'addr': \"192.168.1.2\"},\n {'topic':'Network', 'addr': \"192.168.1.3\"},\n {'topic':'Network', 'addr': \"192.168.1.4\"},\n {'topic':'Network', 'addr': \"192.168.1.5\"},\n {'topic':'Network', 'addr': \"192.168.1.6\"},\n {'topic':'Network', 'addr': \"192.168.1.7\"},\n {'topic':'Network', 'addr': \"192.168.1.8\"},\n {'topic':'Network', 'addr': \"192.168.1.9\"},\n {'topic':'Network', 'addr': \"192.168.1.10\"},\n {'topic':'Network', 'addr': \"192.168.1.11\"},\n {'topic':'Network', 'addr': \"192.168.1.12\"},\n {'topic':'Network', 'addr': \"192.168.1.13\"},\n {'topic':'Network', 'addr': \"192.168.1.14\"},\n];\n\nfor ( var i in checks ) {\n node.send({\n \"topic\" : checks[i].topic,\n \"host\" : checks[i].addr,\n });\n}","outputs":1,"noerr":0,"x":440,"y":290,"wires":[["64175af8.b2b964"]]},{"id":"64175af8.b2b964","type":"adv ping","z":"8abed8bb.324b88","name":"","host":"","x":600,"y":290,"wires":[["73214018.c120d8"]]},{"id":"73214018.c120d8","type":"function","z":"8abed8bb.324b88","name":"msg","func":"if (msg.payload===false){\n //if its false the its off-line\n msg.payload=msg.topic+\" Off-line\";\n}else{\n //If its not false then it must be true / on-line\n msg.payload=msg.topic+\" On-line\";\n} \nreturn msg;\n\n","outputs":1,"noerr":0,"x":750,"y":290,"wires":[["f47cea2f.d6b21"]]},{"id":"f47cea2f.d6b21","type":"switch","z":"8abed8bb.324b88","name":"IP switch","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"192.168.0.82","vt":"str"},{"t":"cont","v":"192.168.0.83","vt":"str"},{"t":"cont","v":"192.168.0.86","vt":"str"},{"t":"cont","v":"192.168.0.89","vt":"str"},{"t":"cont","v":"192.168.0.91","vt":"str"},{"t":"cont","v":"192.168.0.92","vt":"str"},{"t":"cont","v":"192.168.0.93","vt":"str"},{"t":"cont","v":"192.168.0.94","vt":"str"},{"t":"cont","v":"192.168.0.99","vt":"str"},{"t":"cont","v":"192.168.0.200","vt":"str"},{"t":"cont","v":"192.168.0.201","vt":"str"},{"t":"cont","v":"192.168.0.202","vt":"str"},{"t":"cont","v":"192.168.0.253","vt":"str"},{"t":"cont","v":"192.168.0.254","vt":"str"}],"checkall":"true","repair":false,"outputs":14,"x":900,"y":290,"wires":[[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"id":"6fc40050.4ae228","type":"comment","z":"8abed8bb.324b88","name":"EDIT THIS NODE","info":"","x":440,"y":250,"wires":[]},{"id":"d26ac357.436de8","type":"comment","z":"8abed8bb.324b88","name":"EDIT THIS NODE","info":"","x":890,"y":160,"wires":[]},{"id":"cc23a510.d10ba","type":"inject","z":"8abed8bb.324b88","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":290,"wires":[["925b0f39.d9c58"]]},{"id":"b4f723b6.b910a8","type":"comment","z":"8abed8bb.324b88","name":"Trigger / clock input.","info":"","x":210,"y":250,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![chucksteele](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@chucksteele](https://discourse.nodered.org/u/chucksteele)\
**Post date:** [21 March 2020 23:29 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/14 "2020-03-21T23:29:38Z")

</div>

I haven't posted a flow before, so hopefully this will work for you. Please let me know before I get banished to the corner for improper posting procedure 😉

```auto
[{"id":"8cfacf5e.eee3e","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"c02c390b.be8a48","type":"ping","z":"8cfacf5e.eee3e","name":"HB Rachio - 217","host":"192.168.0.217","timer":"300","x":337.01953125,"y":473.00390625,"wires":[["1afe60ad.3662df"]]},{"id":"1afe60ad.3662df","type":"ui_led","z":"8cfacf5e.eee3e","group":"c3b7f18b.155d5","order":4,"width":0,"height":0,"label":"Rachio","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"red","value":"0","valueType":"num"},{"color":"green","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"name":"Rachio","x":557.01953125,"y":473.00390625,"wires":[]},{"id":"c3b7f18b.155d5","type":"ui_group","z":"","name":" Status","tab":"2bca5f61.829fc","disp":true,"width":"6","collapse":false},{"id":"2bca5f61.829fc","type":"ui_tab","z":"","name":"HB Status","icon":"dashboard","order":8,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [24 March 2020 12:55 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/15 "2020-03-24T12:55:59Z")

</div>

Try this flow:

```auto
[{"id":"8eee6e26.470a3","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"4a9da371.c1b13c","type":"inject","z":"8eee6e26.470a3","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":180,"wires":[["97e6812b.4bcfc"]]},{"id":"29705fda.de70e","type":"ping","z":"8eee6e26.470a3","name":"Ping Fritzbox alle 60 sec","host":"10.0.0.1","timer":"60","x":210,"y":280,"wires":[["97e6812b.4bcfc"]]},{"id":"2be70490.e9ac7c","type":"inject","z":"8eee6e26.470a3","name":"","topic":"","payload":"25","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":360,"wires":[["97e6812b.4bcfc"]]},{"id":"97e6812b.4bcfc","type":"function","z":"8eee6e26.470a3","name":"","func":"if (msg.payload === false){\n msg.payload = \"off\";\n}\nelse{\n msg.payload = \"on\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":280,"wires":[["ee177ea4.3f32f"]]},{"id":"ee177ea4.3f32f","type":"rbe","z":"8eee6e26.470a3","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":590,"y":280,"wires":[["8d03c1ea.57018"]]},{"id":"8d03c1ea.57018","type":"switch","z":"8eee6e26.470a3","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":280,"wires":[["10a612d2.7e2d9d"],["9885e760.4c1ed8"]]},{"id":"10a612d2.7e2d9d","type":"function","z":"8eee6e26.470a3","name":"","func":"msg.payload = \"red\";\nreturn msg;","outputs":1,"noerr":0,"x":870,"y":240,"wires":[["1eefe2e6.dfab6d"]]},{"id":"9885e760.4c1ed8","type":"function","z":"8eee6e26.470a3","name":"","func":"msg.payload = \"green\";\nreturn msg;","outputs":1,"noerr":0,"x":870,"y":320,"wires":[["33b654b2.b5d89c"]]},{"id":"1eefe2e6.dfab6d","type":"debug","z":"8eee6e26.470a3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1010,"y":240,"wires":[]},{"id":"33b654b2.b5d89c","type":"debug","z":"8eee6e26.470a3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1010,"y":320,"wires":[]}]

```

if you want a red and green dot try template.  
Don't forget to change the ip address!

Dot:

```auto
[{"id":"57c6344f.fc6fbc","type":"change","z":"9b890450.3fe668","name":"green","rules":[{"t":"set","p":"payload","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":420,"wires":[["5d9694b8.687bcc"]]},{"id":"5d9694b8.687bcc","type":"ui_template","z":"9b890450.3fe668","group":"23f69a7d.d522b6","name":"UWP Heizung Template","order":2,"width":"1","height":"2","format":"<div><br><br></div>\n<div style=\"color:{{msg.payload}}\" <i class=\"fa fa-circle\"></i></div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1170,"y":340,"wires":[[]]},{"id":"23f69a7d.d522b6","type":"ui_group","z":"","name":"Temperaturregelung Status","tab":"e12a3848.60d5c8","order":4,"disp":false,"width":"17","collapse":false},{"id":"e12a3848.60d5c8","type":"ui_tab","z":"","name":"Temperaturregelung","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
```

---

<div class="post-metadata">

**Author:** ![knieshe1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knieshe1/32/17635_2.png) [@knieshe1](https://discourse.nodered.org/u/knieshe1)\
**Post date:** [24 March 2020 13:20 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/16 "2020-03-24T13:20:18Z")

</div>

Thank you all "helpers"

I think now I have a solution for my problem

please close this chat

Thanks again Heinz

---

<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:** [24 March 2020 21:05 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/17 "2020-03-24T21:05:55Z")

</div>

Heinz,

To "Close" the chat, pick one of the ones that helped you and click the "solution" box.

It doesn't really "close" the chat, but indicates which is the _better_ solution, so if people have a similar problem they can quickly see which is the solution you chose.

(And it indicates to others they don't need to read it and help you - as you have _found_ a solution.)

---

<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:** [24 March 2020 21:50 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/18 "2020-03-24T21:50:31Z")

</div>

Yeah, ok.... The meaning seems to be lost in translation.

Pick the person's reply you use. Not the last post you made.

So, if _Juntiedt_'s flow is the one you used, pick his post.  
Of if you used _checksteele_'s post, tick his post.  
Or _mine_.

That way if someone has a similar problem, they will see which post you used and it may help them find the answer to their problem faster.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 April 2020 21:50 UTC](https://discourse.nodered.org/t/show-ping-status-on-or-off-as-red-or-green-lamp-on-dashboard/23407/19 "2020-04-07T21:50:32Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
