linux uptime in seconds

read system uptime in seconds from /proc/uptime and parse into integer

[{"id":"b465d5a8.146ba8","type":"exec","z":"9e6a9c81.273b9","command":"cat","addpay":true,"append":"/proc/uptime | awk ' {print $1}'","useSpawn":"false","timer":"","oldrc":false,"name":"uptime in sec","x":230,"y":40,"wires":[["f94be815.623218"],[],[]]},{"id":"6b3b664d.ffd2c8","type":"inject","z":"9e6a9c81.273b9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":90,"y":40,"wires":[["b465d5a8.146ba8"]]},{"id":"98dd488f.6e4c58","type":"debug","z":"9e6a9c81.273b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":40,"wires":[]},{"id":"f94be815.623218","type":"function","z":"9e6a9c81.273b9","name":"parse seconds","func":"msg.payload = parseInt(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":440,"y":40,"wires":[["98dd488f.6e4c58"]]}]

Flow Info

Created 4 years, 7 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x1)
  • exec (x1)
  • function (x1)
  • inject (x1)

Tags

Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option