In addition to the exciting data generated by a SmartHome, you should also take care of the status of the heart of the SmartHome. If you have installed your NodeRed installation on a RaspberryPi (or other Linux system), you can use the example below to display some of the most important information of the RaspberryPi on the dashboard.
What you have to do is explained 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/en/sicherheitshinweise/
Affiliate links / advertising links
The links to online stores listed here are so-called affiliate links. If you click on such an affiliate link and store via this link, Nerdiy.de receives a commission from the online store or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support Nerdiy.de in being able to offer further useful projects in the future. 🙂
Requirements
Helpful Articles:
Of course NodeRed should already be installed so that you can take over this configuration.
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.

Node code
In addition to the dashboard node, only standard nodes and corresponding Linux commands are used for this display. Simply add the following node code and do not forget to position the Dashboard elements correctly on your Dashboard.
You can also find information about this in the article NodeRed - Create a User Interface with dashboard nodes.


Node code:
[{"id":"fbbafb8d.8c3818","type":"exec","z":"ae220e4a.3c49d","command":"vcgencmd measure_temp","addpay":false,"append":" ","useSpawn":"","timer":"","oldrc":false,"name":"RPi Temp","x":440,"y":200,"wires":[[" 17fa85a3.c0a5fa"],[],[]]},{"id":"610a759f.da34ec","type":"inject","z":"ae220e4a.3c49d","name":"update 10sec ","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":" ","x":200,"y":200,"wires":[["fbbafb8d.8c3818","6b5302eb.fe0fbc","f8494c08.39fe8"]]},{"id":"17fa85a3.c0a5fa ","type":"function","z":"ae220e4a.3c49d","name":"cutString","func":"str = msg.payload\nmsg.payload = str.substring(5,9 );\nreturn msg;","outputs":1,"noerr":0,"x":660,"y":200,"wires":[["e8f154dc.299398","71f38a1c.ca6f64"] ]},{"id":"4070b9bd.5796b8","type":"exec","z":"ae220e4a.3c49d","command":"sudo reboot","addpay":false,"append" :"","useSpawn":"","timer":"","oldrc":false,"name":"Restart","x":430,"y":540,"wires":[[ ],[],[]]},{"id":"77a93271.11eabc","type":"exec","z" :"ae220e4a.3c49d","command":"sudo shutdown -h now","addpay":false,"append":"","useSpawn":"","timer":"","oldrc": false,"name":"Shutdown","x":440,"y":620,"wires":[[],[],[]]},{"id":"6b5302eb.fe0fbc"," type":"exec","z":"ae220e4a.3c49d","command":"top -d 1 -b -n2 | grep \"Cpu(s)\"|tail -n 1 | awk '{print $2 + $4}'","addpay":false,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"CPU Last","x":420,"y":280,"wires":[["97612f41.a7f6e"],[],[]]},{"id":"f8494c08.39fe8","type" :"exec","z":"ae220e4a.3c49d","command":"free | grep meme | awk '{print 100*(($3+$5)/$2)}'","addpay":false,"append":"","useSpawn":"","timer":"","oldrc": false,"name":"RAM","x":410,"y":360,"wires":[["6ce43c7.2c89bc4"],[],[]]},{"id":"7b744c14 .050354","type":"exec","z":"ae220e4a.3c49d","command":"df -h","addpay":false,"append":"","useSpawn":" ","timer":"","oldrc":false,"name":"Memory","x":440,"y":440,"wires":[["403e1890.2fbab8"],[] ,[]]},{"id":"403e1890.2fbab8","type":"function","z":"ae220e4a.3c49d","name":"modifyString","func":"var re = /([0-9]{2})%/\nvar idx = msg.payload.search(re);\nvar str = msg.payload;\nif (idx >=0) {\n str = msg. payload.substring(idx, idx + 2);\n}\nmsg.payload = str;\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":440 ,"wires":[["f574e160.da0f1"]]},{"id":"da61973.d30f268","type":"inject","z":"ae220e4a.3c49d","name":" update 1min","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay" :"","x":200,"y":440,"wires":[["7b744c14.050354"]]},{"id":"37bde909.05a676" ,"type":"ui_button","z":"ae220e4a.3c49d","name":"","group":"5fe5a9b.a8a6158","order":3,"width":0,"height ":0,"passthru":false,"label":"Restart","color":"","bgcolor":"","icon":"","payload":"","payloadType" :"str","topic":"","x":230,"y":540,"wires":[["4070b9bd.5796b8"]]},{"id":"12fa2be3.80e824", "type":"ui_button","z":"ae220e4a.3c49d","name":"","group":"5fe5a9b.a8a6158","order":4,"width":0,"height" :0,"passthru":false,"label":"Shutdown","color":"","bgcolor":"red","icon":"","payload":"","payloadType": "str","topic":"","x":240,"y":620,"wires":[["77a93271.11eabc"]]},{"id":"e8f154dc.299398"," type":"ui_gauge","z":"ae220e4a.3c49d","name":"","group":"5fe5a9b.a8a6158","order":1,"width":0,"height": 0,"gtype":"gage","title":"CPU temperature","label":"C","format":"{{value}}","min":0,"max":" 100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":910,"y":180,"wires" :[]},{"id":"638024a7.6ca05c","type":"ui_gauge","z":"ae220e4a.3c49d","name":"","group":"6b432a4a.06ad54" ,"ord er":1,"width":0,"height":0,"gtype":"gage","title":"CPU","label":"CPU","format":"{{value} }%","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"", "x":870,"y":300,"wires":[]},{"id":"d80d6326.88202","type":"ui_gauge","z":"ae220e4a.3c49d"," name":"","group":"6b432a4a.06ad54","order":1,"width":0,"height":0,"gtype":"gage","title":"Memory", "label":"RAM","format":"{{value}}%","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838 "]","seg1":"","seg2":"","x":880,"y":360,"wires":[]},{"id":"f574e160.da0f1","type ":"ui_gauge","z":"ae220e4a.3c49d","name":"","group":"6b432a4a.06ad54","order":1,"width":0,"height":0 ,"gtype":"gage","title":"Disk","label":"Memory","format":"{{value}}%","min":0,"max":"100 ","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":870,"y":440,"wires": []},{"id":"71f38a1c.ca6f64","type":"ui_chart","z":"ae220e4a.3c49d","name":"","group":"5fe5a9b.a8a6158", "order":2,"width":0,"height":0 ,"label":"CPU temperature curve","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata" :"","dot":false,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout" :0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"] ,"useOldStyle":true,"x":930,"y":240,"wires":[[],[]]},{"id":"6ce43c7.2c89bc4","type":"function" ,"z":"ae220e4a.3c49d","name":"deleteWhitespace","func":"var str = msg.payload\nstr = str.trim();\nvar nr=parseInt(str);\nmsg .payload = nr.toFixed(1);\nreturn msg;","outputs":1,"noerr":0,"x":690,"y":360,"wires":[["d80d6326.88202 "]]},{"id":"97612f41.a7f6e","type":"function","z":"ae220e4a.3c49d","name":"deleteWhitespace","func":"str = msg .payload\nmsg.payload = str.trim();\nreturn msg;","outputs":1,"noerr":0,"x":690,"y":280,"wires":[[" 638024a7.6ca05c"]]},{"id":"75f679fd.1125a8","type":"inject","z":"ae220e4a.3c49 d","name":"Shutdown","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once" :false,"onceDelay":0.1,"x":260,"y":680,"wires":[["77a93271.11eabc"]]},{"id":"5fe5a9b.a8a6158","type" :"ui_group","z":"ae220e4a.3c49d","name":"2","tab":"7e8708a2.0fc408","order":2,"disp":false,"width":" 6","collapse":false},{"id":"6b432a4a.06ad54","type":"ui_group","z":"ae220e4a.3c49d","name":"1","tab" :"7e8708a2.0fc408","order":1,"disp":false,"width":"6","collapse":false},{"id":"7e8708a2.0fc408","type":" ui_tab","z":"ae220e4a.3c49d","name":"Raspi data","icon":"dashboard","order":1}]
Have fun with the project
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. 🙂
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 that I share this information with you, I would be happy about a small donation to the coffee box. 🙂
Hi, very nice flow. I'm a beginner with node-red and can learn a lot with it.
CPU temperature and history running. For the node RAM, I replaced "mem" with "RAM" (German Raspian :-), works too. But the commands for "memory space" and "CPU" do not work and unfortunately my knowledge is not sufficient for a change. Could you adapt that for a German version?
Thanks and regards, Hajo.
Hi hajo,
I just tested it all again. "Unfortunately" everything works for me. Can you give me some more info what isn't working for you? 🙂
Best regards
Fabian
2/13/2023, 9:04:19 am node: modifyString
function : (error)
"TypeError: msg.payload.search is not a function"
???
Hallo Nerdy,
habe (bin auch noch Anfänger) den Flow heruntergeladen und installiert.
Hat super funktioniert …
Nachdem ich nun das System von der SD-Karte auf eine HD übertragen habe werden in CPU, Speicher und Disk keine Werte mehr angezeigt …
CPUTempertur funktioniert.
Hast mglw. einen Tip für mich?
Beste Grüsse
Jurgen
Hi Jürgen,
ja das liegt sehr wahrscheinlich daran, dass die Festplatte einen anderen Mountpoint/Pfad hat als die SD Karte.
Kannst du mir mal die Ausgabe von „df -h“ (einfach in die Konsole eingeben) schicken? Dann kann ich dir sagen wie der aktuelle Mountpoint lautet und wir können den NodeRed Code entsprechend anpassen. 🙂
Best regards
Fabian