HowTo: Node Red – Display server uptime in the dashboard

In addition to the data from your SmartHome, you can also display data about the server on which NodeRed is running.

How you can display the uptime (i.e. the running time) of your Raspberry Pi in the dashboard is described in the following article.


Safety instructions

I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.
https://www.nerdiy.de/sicherheitshinweise/

Affiliate links/advertising links

The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, Nerdiy.de will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support Nerdiy.de in being able to offer other useful projects in the future. 🙂 


Requirements

Helpful articles:
Before you start with the article you should have prepared the RaspberryPi so that it is accessible via the network and controllable via SSH. Furthermore NodeRed and the Dashboard-Node should be installed.

The following three articles describe what needs to be done to prepare the RaspberryPi:
RaspberryPi – setup for nerdiys!
RaspberryPi – The first configuration!
RaspberryPi – Control the RaspberryPi via SSH

NodeRed - Create a user interface with dashboard nodes
NodeRed - import and export node code

Required tool:
-no-

Required material:

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


Log into the NodeRed configuration interface

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

View of the login dialog. Here you have to enter the login data that you specified during the configuration of the login. You can find information about this in the article NodeRed - set up user login.

Node code

Insert the following node code into your flow to display the runtime of your RaspberryPi in the dashboard.
After inserting, don't forget to position the output text field correctly on your dashboard.
You can also find information on this in the article NodeRed - Create 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"}]

Have fun with the project

I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂

PS 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 think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂

Buy Me a Coffee at ko-fi.com       

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert

This site uses Akismet to reduce spam. Learn how your comment data is processed.