Sharing some work to use HWiNFO64 and remote sensor monitor to get PC sensor data

I found myself needing to monitor the thermals on a PC and to log the data for later use.
I am using a program names HWiNFO64 to read the sensor data. It's a reasonably popular program that is regularly updated.
In addition to that, I'm using a program called Remote Sensor Monitor which connects to HWiNFO64 and sends the sensor data over HTTP in JSON format.

I have to do some additional processing with Node Red to extract the data I want, but I got that all sorted and added a convenience feature to make it easy to log the data to a Google sheet.

I'm still a JavaScript novice so I'm sure the function node could be done much more cleanly but it works well enough for my purposes and I don't think there are any alternative examples out there.

I don't know if using an inject node the way I am here is frowned on, but it's the only way I could think of to generate the periodic requests.

Once you have HWiNFO64 and Remote Senor Monitor running, and you can confirm that you can see it from the machine running Node Red, update the HTTP request node with the correct IP, and update the inject node with the interval to make the HTTP request.

[{"id":"5409a8b0.7faf98","type":"tab","label":"RSM example","disabled":false,"info":""},{"id":"fff8be70.9e9d","type":"http request","z":"5409a8b0.7faf98","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"192.168.1.xxx:55555","tls":"","persist":false,"proxy":"","authType":"","x":310,"y":180,"wires":[["a9dde72b.e7fbd8"]]},{"id":"c3edab81.7dd588","type":"inject","z":"5409a8b0.7faf98","name":"","props":[],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":100,"y":160,"wires":[["fff8be70.9e9d"]]},{"id":"a9dde72b.e7fbd8","type":"function","z":"5409a8b0.7faf98","name":"","func":"var Timestamp = new Date();\nfor (var i=0 ; i < msg.payload.length ; i++)\n{\n    if (msg.payload[i][\"SensorName\"] == \"Core 0\") {\n      var Cpu0tempMsg = {payload:msg.payload[i][\"SensorValue\"]};\n    }\n    if (msg.payload[i][\"SensorName\"] == \"Core 1\") {\n      var Cpu1tempMsg = {payload:msg.payload[i][\"SensorValue\"]};\n    }\n    if (msg.payload[i][\"SensorName\"] == \"CPU Package\") {\n      var CpuPkgMsg = {payload:msg.payload[i][\"SensorValue\"]};\n    }\n    if (msg.payload[i][\"SensorName\"] == \"CPU\") {\n      var FanRpmMsg = {payload:msg.payload[i][\"SensorValue\"]};\n    }\n    if (msg.payload[i][\"SensorName\"] == \"PCH Temperature\") {\n      var PchTempMsg = {payload:msg.payload[i][\"SensorValue\"]};\n    }\n    if (msg.payload[i][\"SensorName\"] == \"Core Thermal Throttling\") {\n      var CpuThrmThrottle;\n      if (msg.payload[i][\"SensorValue\"] == \"0\") {\n        CpuThrmThrottle = {payload:\"false\"};\n      } else {\n        CpuThrmThrottle = {payload:\"true\"};\n      }\n    }\n}\nvar logging_array = [Timestamp.toLocaleString('en-US', {timeZone: 'America/Los_Angeles'}), Cpu0tempMsg.payload,Cpu1tempMsg.payload, CpuPkgMsg.payload, FanRpmMsg.payload, PchTempMsg.payload, CpuThrmThrottle.payload ];\nvar loggingMsg = {payload:logging_array};\n\nreturn [Cpu0tempMsg, Cpu1tempMsg, CpuPkgMsg, FanRpmMsg, PchTempMsg, CpuThrmThrottle, loggingMsg ];","outputs":7,"noerr":0,"initialize":"","finalize":"","x":480,"y":180,"wires":[["46e7ff6b.dc158"],["e495dc46.f82a3"],["90672efe.f65a9"],["86761c71.5bfa"],["1e662854.2c7c38"],["d867c01f.0d173"],["7a332e20.8c7c4"]]},{"id":"7a332e20.8c7c4","type":"GSheet","z":"5409a8b0.7faf98","creds":"","method":"append","action":"","sheet":"","cells":"","flatten":false,"name":"","x":650,"y":340,"wires":[[]]},{"id":"86761c71.5bfa","type":"ui_gauge","z":"5409a8b0.7faf98","name":"","group":"37878bb2.756ce4","order":6,"width":0,"height":0,"gtype":"gage","title":"fan RPM","label":"units","format":"{{value}}","min":0,"max":"3500","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":700,"y":220,"wires":[]},{"id":"bb9813f.6765bf","type":"comment","z":"5409a8b0.7faf98","name":"Server IP note","info":"Update with the IP of the system running remote sensor monitor","x":320,"y":120,"wires":[]},{"id":"d47f6137.77f8e","type":"comment","z":"5409a8b0.7faf98","name":"Google sheets log note","info":"background info on using this node can be found here: https://flows.nodered.org/node/node-red-contrib-google-sheets","x":660,"y":380,"wires":[]},{"id":"46e7ff6b.dc158","type":"ui_text","z":"5409a8b0.7faf98","group":"37878bb2.756ce4","order":5,"width":0,"height":0,"name":"","label":"Core 0 temp","format":"{{msg.payload}}","layout":"row-spread","x":610,"y":80,"wires":[]},{"id":"e495dc46.f82a3","type":"ui_text","z":"5409a8b0.7faf98","group":"37878bb2.756ce4","order":5,"width":0,"height":0,"name":"","label":"Core 1 temp","format":"{{msg.payload}}","layout":"row-spread","x":670,"y":120,"wires":[]},{"id":"90672efe.f65a9","type":"ui_text","z":"5409a8b0.7faf98","group":"37878bb2.756ce4","order":5,"width":0,"height":0,"name":"","label":"CPU package temp","format":"{{msg.payload}}","layout":"row-spread","x":750,"y":160,"wires":[]},{"id":"1e662854.2c7c38","type":"ui_text","z":"5409a8b0.7faf98","group":"37878bb2.756ce4","order":5,"width":0,"height":0,"name":"","label":"PCH temp","format":"{{msg.payload}}","layout":"row-spread","x":690,"y":260,"wires":[]},{"id":"d867c01f.0d173","type":"ui_text","z":"5409a8b0.7faf98","group":"37878bb2.756ce4","order":5,"width":0,"height":0,"name":"","label":"Is thermal Throttling?","format":"{{msg.payload}}","layout":"row-spread","x":700,"y":300,"wires":[]},{"id":"37878bb2.756ce4","type":"ui_group","name":"health","tab":"c4e23d32.1c97d","order":1,"disp":true,"width":"6","collapse":false},{"id":"c4e23d32.1c97d","type":"ui_tab","name":"RSM example","icon":"dashboard","disabled":false,"hidden":false}]
2 Likes

Hi Matt, it is generally a decent idea to share a picture of your flow in cases like this because people won't really want to install a flow that won't work for them because they don't have the dependencies. Without that, it is hard to visualise what you are currently doing.

I've edited my post to add a picture.

1 Like