HowTo: NodeRed – View server uptime in dashboard

In addition to the data of your SmartHome, you can also display data about the server that is running your NodeRed instance.

How you can see the uptime of your RaspberryPi in the Dashboard is described in the following article.

Hints for our lovely english readers: Basically, many of the articles on Nerdiy.de are translations from the original german articles. Therefore, it may happen here and there that some illustrations are not available in english and that some translations are weird/strange/full of mistakes or generally totaly wrong. So if you find some obvious (or also not obvious) mistakes don't hesitate to leave us a hint about that in the comment section. 
Also please don't get confused, that instead of a "dot" often a "comma" is used as decimal separator. 🙂


Safety instructions

I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance. https://www.nerdiy.de/sicherheitshinweise/


Requirements

Helpful Articles:

Before you start with this article, you should have prepared the RaspberryPi so far that it can be reached via the network and controlled by SSH. Also NodeRed should be installed.

How to prepare a RaspberryPi and then install NodeRed on it, is described in the following articles.
RaspberryPi – Setting up for Nerdiys!
RaspberryPi – The first configuration
RaspberryPi – Controlling the RaspberryPi via SSH
NodeRed – Installing NodeRed on the RaspberryPi
NodeRed – Install New Nodes
NodeRed – Import and Export Node Code
NodeRed – Create a User Interface with dashboard nodes

Required tools:
-none-

Required material:

In the following list you will find all the parts you need to implement this article.


Log in to the NodeRed configuration interface

Before you can edit your NodeRed configuration you must - if activated - first log in to the NodeRed configuration interface.

View of the login screen. Here you have to enter the login details that you entered during the configuration of the login. Information about this can be found in the article NodeRed - User Login Setup.

Node Code

Add the following code in your flow to show the runtime of your RaspberryPi in the dashboard.
After inserting, do not forget to position the output text box on your dashboard correctly.
You can also find information about this in the article NodeRed – Creating a User Interface with Dashboard Nodes.

View in the NodeRed editor
[{"id":"5d7f95c0.a4beac","type":"inject","z":"977ed91b.3c1268","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":true,"onceDelay":0.1,"x":350,"y":2400,"wires":[["bc9f9009.9737c"]]},{"id":"bc9f9009.9737c","type":"exec","z":"977ed91b.3c1268","command":"uptime -p","addpay":false,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"Laufzeit","x":520,"y":2400,"wires":[["97a66498.6af468"],[],[]]},{"id":"97a66498.6af468","type":"ui_text_input","z":"977ed91b.3c1268","name":"","label":"Uptime","group":"56d04a8f.ecd7a4","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":760,"y":2400,"wires":[[]]},{"id":"56d04a8f.ecd7a4","type":"ui_group","z":"","name":"System","tab":"77aad24e.6a657c","disp":true,"width":"6","collapse":false},{"id":"77aad24e.6a657c","type":"ui_tab","z":"","name":"Einstellungen","icon":"dashboard"}]

I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂

Fab

P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate it that I share these information with you, I would be happy about a small donation to the coffee box. 🙂

Buy Me a Coffee at ko-fi.com

Leave a Reply

Your email address will not be published. Required fields are marked *