Thanks for this. I like the vertical stack, and used that on mine as well.
I also used your NodeRed code, as the SNMP from HA kept failing (sensors Unavailable. And sometimes they’d suddenly show up days later, but not consistently).
I did edit a few things. Like updating your temp units to “°C” (Which allowed HA to show it to me in the GUI as °F).
In addition, I completely redid your disk space. Rather than looking at allocation units, I grabbed 1.3.6.1.4.1.5127.1.1.1.8.1.9.1.5.1 for disk size (which returns 3.6T for my 4TB system), and just stripped the T from it. At these sizes, I’m not too concerned about more decimals. But that makes the function easier to get total, used and free size.
And since I didn’t have a switch to look at if the NAS was up, I just (for simplicity’s sake) used an inject node to kick this off every 15 minutes.
Here’s my code in case anyone else wants to use it
[{"id":"b724648aef7e329f","type":"group","z":"9e354d802036d78a","name":"WD EX2 Ultra SNMP queries","style":{"stroke":"#92d04f","fill":"#e3f3d3","fill-opacity":"0.6","label":true,"color":"#0070c0"},"nodes":["88e133bc1808a21a","602f8d14ec73f71c","08b41def0b9a98f9","53997450868c9442","1c7a7b676efa1c55","ee8a5f4a75567bcb","16292bcf74abd204","e818a9bd9a324128","677a3b4e076e916e","a64e64e32b8c9bd4","2d99cc3126646528","a7732d0f158590e3","4d99a3f62dc1bd25","8f2f872054cb118e","641d3b2b9d9cf55f","8c465ff341c89415","e008579a086ab391","9236d42249b7e21b","be17066c2365d73e","586df903fb7afe81","3cafe0c987a42a02","f6bd7d82dc07d2cb","deebc32c42f350cd","fb72868fa2e7cceb","18b0551be066270f","917bcf570eb10663","e1ee6e618dcf3da8"],"x":34,"y":79,"w":1152,"h":562},{"id":"88e133bc1808a21a","type":"snmp","z":"9e354d802036d78a","g":"b724648aef7e329f","host":"hostname","community":"string","version":"2c","oids":"1.3.6.1.2.1.25.1.1.0","timeout":5,"name":"NAS Up-Time","x":360,"y":120,"wires":[["08b41def0b9a98f9"]]},{"id":"602f8d14ec73f71c","type":"inject","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Query","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":120,"wires":[["88e133bc1808a21a"]]},{"id":"08b41def0b9a98f9","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Format SNMP payload","func":"// Timetick conversion below - used to caculate hours / days etc.\n//\n// timeticks / 100 = seconds\n// timeticks / 6000 = minutes\n// timeticks / 360000 = hours\n// timeticks / 8640000 = days\n\n// Code to convert \"up-time\" to both hours and days.\nmsg.UpTimeDays = (msg.payload[0].value/8640000).toFixed(1) +\" Days\"; //timeticks / 8640000 = days\nmsg.UpTimeHours = (msg.payload[0].value/360000 ).toFixed(2) +\" Hours\" ; //timeticks / 360000 = hours\n\n// Code to display the \"up-time\" in hours if it's less than 1 day\nif ((msg.UpTimeDays).includes(\"0.\")) {\n msg.Uptime = msg.UpTimeHours;\n } else {\n msg.Uptime = msg.UpTimeDays;\n}\n\n\nmsg.payload = msg.Uptime;\nreturn msg\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":120,"wires":[["3cafe0c987a42a02"]]},{"id":"53997450868c9442","type":"inject","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Query","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":300,"wires":[["1c7a7b676efa1c55"]]},{"id":"1c7a7b676efa1c55","type":"snmp","z":"9e354d802036d78a","g":"b724648aef7e329f","host":"hostname","community":"string","version":"2c","oids":"1.3.6.1.4.1.5127.1.1.1.8.1.9.1.5.1,\n1.3.6.1.4.1.5127.1.1.1.8.1.9.1.6.1","timeout":5,"name":"NAS Disk Info","x":360,"y":300,"wires":[["ee8a5f4a75567bcb"]]},{"id":"ee8a5f4a75567bcb","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Format SNMP payload","func":"msg.SizeTB = parseFloat((msg.payload[0].value).replace(\"T\",\"\"))\nmsg.FreeTB = parseFloat((msg.payload[1].value).replace(\"T\",\"\"))\nmsg.UsedTB = (msg.SizeTB - msg.FreeTB).toFixed(1)\n\nmsg.PercentUsed = ((msg.UsedTB / msg.SizeTB) * 100).toFixed(0)\nmsg.PercentFree = ((msg.FreeTB / msg.SizeTB) * 100).toFixed(0)\n\nreturn msg\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":300,"wires":[["a7732d0f158590e3","641d3b2b9d9cf55f","8f2f872054cb118e","e008579a086ab391","be17066c2365d73e"]]},{"id":"16292bcf74abd204","type":"inject","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Query","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":480,"wires":[["e818a9bd9a324128"]]},{"id":"e818a9bd9a324128","type":"snmp","z":"9e354d802036d78a","g":"b724648aef7e329f","host":"hostname","community":"string","version":"2c","oids":"1.3.6.1.4.1.5127.1.1.1.8.1.7.0,\n1.3.6.1.4.1.5127.1.1.1.8.1.10.1.5.1,\n1.3.6.1.4.1.5127.1.1.1.8.1.10.1.5.2","timeout":5,"name":"NAS System Temperature","x":390,"y":480,"wires":[["677a3b4e076e916e"]]},{"id":"677a3b4e076e916e","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Format SNMP payload","func":"// Code to get the disk temperatures, fix up the string and display the average temp.\nmsg.System = parseInt((msg.payload[0].value.split('Fahrenheit:')[1]));\nmsg.Disk1 = parseInt((msg.payload[1].value).replace(\"Centigrade:\",\"\"));\nmsg.Disk2 = parseInt((msg.payload[2].value).replace(\"Centigrade:\",\"\"));\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":480,"wires":[["f6bd7d82dc07d2cb","deebc32c42f350cd","18b0551be066270f"]]},{"id":"a64e64e32b8c9bd4","type":"ha-entity","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"nas.disk1","server":"c619ecc5.a1f0d","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"nas.disk1"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:nas"},{"property":"unit_of_measurement","value":"°C"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[{"property":"entity_id","value":"sensor.nas.temprature","valueType":"str"}],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1020,"y":480,"wires":[[]]},{"id":"2d99cc3126646528","type":"ha-entity","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"nas.diskcapacity","server":"c619ecc5.a1f0d","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"nas.diskcapacity"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:harddisk"},{"property":"unit_of_measurement","value":"TB"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[{"property":"entity_id","value":"sensor.nas.diskcapacity","valueType":"str"}],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1040,"y":180,"wires":[[]]},{"id":"a7732d0f158590e3","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Payload","func":"//msg.payload = msg.SizeTB;\nmsg.payload = msg.SizeTB;\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":180,"wires":[["2d99cc3126646528"]]},{"id":"4d99a3f62dc1bd25","type":"ha-entity","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"nas.diskfree","server":"c619ecc5.a1f0d","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"nas.diskfree"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:harddisk"},{"property":"unit_of_measurement","value":"TB"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[{"property":"entity_id","value":"sensor.nas.diskfree","valueType":"str"}],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1030,"y":300,"wires":[[]]},{"id":"8f2f872054cb118e","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Payload","func":"msg.payload = msg.FreeTB;\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":300,"wires":[["4d99a3f62dc1bd25"]]},{"id":"641d3b2b9d9cf55f","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Payload","func":"msg.payload = msg.UsedTB;\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":240,"wires":[["8c465ff341c89415"]]},{"id":"8c465ff341c89415","type":"ha-entity","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"nas.diskusage","server":"c619ecc5.a1f0d","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"nas.diskusage"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:harddisk"},{"property":"unit_of_measurement","value":"TB"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[{"property":"entity_id","value":"sensor.nas.diskusage","valueType":"str"}],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1040,"y":240,"wires":[[]]},{"id":"e008579a086ab391","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Payload","func":"msg.payload = msg.PercentFree;\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":360,"wires":[["9236d42249b7e21b"]]},{"id":"9236d42249b7e21b","type":"ha-entity","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"nas.diskpercentfree","server":"c619ecc5.a1f0d","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"nas.diskpercentfree"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:harddisk"},{"property":"unit_of_measurement","value":"%"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[{"property":"entity_id","value":"sensor.nas.diskpercentfree","valueType":"str"}],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1050,"y":360,"wires":[[]]},{"id":"be17066c2365d73e","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Payload","func":"msg.payload = msg.PercentUsed;\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":420,"wires":[["586df903fb7afe81"]]},{"id":"586df903fb7afe81","type":"ha-entity","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"nas.diskpercentused","server":"c619ecc5.a1f0d","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"nas.diskpercentused"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:harddisk"},{"property":"unit_of_measurement","value":"%"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[{"property":"entity_id","value":"sensor.nas.diskpercentused","valueType":"str"}],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1060,"y":420,"wires":[[]]},{"id":"3cafe0c987a42a02","type":"ha-entity","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"nas.uptime","server":"c619ecc5.a1f0d","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"nas.uptime"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:nas"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[{"property":"entity_id","value":"sensor.nas.uptime","valueType":"str"}],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1030,"y":120,"wires":[[]]},{"id":"f6bd7d82dc07d2cb","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Payload","func":"msg.payload = msg.Disk1;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":480,"wires":[["a64e64e32b8c9bd4"]]},{"id":"deebc32c42f350cd","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Payload","func":"msg.payload = msg.Disk2;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":540,"wires":[["fb72868fa2e7cceb"]]},{"id":"fb72868fa2e7cceb","type":"ha-entity","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"nas.disk2","server":"4f28a876.524b58","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"nas.disk2"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:nas"},{"property":"unit_of_measurement","value":"°C"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"","outputPayloadType":"str","x":1020,"y":540,"wires":[[]]},{"id":"18b0551be066270f","type":"function","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"Payload","func":"msg.payload = msg.System;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":600,"wires":[["917bcf570eb10663"]]},{"id":"917bcf570eb10663","type":"ha-entity","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"nas.temp","server":"4f28a876.524b58","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"nas.temp"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:nas"},{"property":"unit_of_measurement","value":"°F"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"","outputPayloadType":"str","x":1020,"y":600,"wires":[[]]},{"id":"e1ee6e618dcf3da8","type":"inject","z":"9e354d802036d78a","g":"b724648aef7e329f","name":"15 Mins","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"900","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":140,"y":200,"wires":[["88e133bc1808a21a","1c7a7b676efa1c55","e818a9bd9a324128"]]},{"id":"c619ecc5.a1f0d","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"},{"id":"4f28a876.524b58","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]