[RELEASE] Hub Information Driver v3

Should be able to create a virtual Pi Information device without too much effort. What attributes do you want to track from the Pi? Couple of ways to get the data in, one thought is to send over a JSON string with the attributes to be updated and use a single command, another would be a command for each attribute.

1 Like

CPU usage and Temp (in C)
At least for now :rofl:
Many many thanks

If you create a virtual Omni Sensor in HE, you can easily transfer the temperature of the RPi to the Omni Sensor's Temperature field using Node Red. What are the units of CPU usage? A percentage? If so, you could save it in the Humidity field.

If you are feeling adventurous, the code for the Omni Sensor is available and you can tweak to exactly match the characteristics you are pulling from RPi in Node Red. I do similar and created a Virtual Alexa Air Quality Monitor that pulls data from the actual monitor using Home Assistant.

1 Like

Have you looked at: node-red-contrib-device-stats

Not that I remember. Will have a look tonight. Thanks

@amithalp when you do, might also want to look at [RELEASE]Node Red Server Information Driver

1 Like

Also found this one - node-red-contrib-os.
Will test the new driver and let you know.
Every team needs a Go To Guy. You are my GTG.
Thanks a lot

1 Like

If your running influxdb I can share my bash script that posts cpu use, memory, load average, temp, etc to influx. Then it just runs as a cron job.

Just change the curl lines to match for your influx server

#!/bin/bash

regex='^[0-9]+([.][0-9]+)?$'






LOADAVG=`cat /proc/loadavg | cut -f1 -d' '`
PROCESSES=`cat /proc/loadavg | cut -d ' ' -f4 | cut -d '/' -f 2`
RXBYTES=`ifconfig wlan0 | grep "RX bytes:" | sed -e 's,.*RX bytes:,,' -e 's, .*,,'`
TXBYTES=`ifconfig wlan0 | grep "TX bytes:" | sed -e 's,.*TX bytes:,,' -e 's, .*,,'`
SWAPFREE=`cat /proc/meminfo | grep "SwapFree:" | sed 's/ * / /g' | cut -d ' ' -f2`
SWAPTOTAL=`cat /proc/meminfo | grep "SwapTotal:" | sed 's/ * / /g' | cut -d ' ' -f2`
MEMAVAIL=`cat /proc/meminfo | grep "MemAvailable:" | sed 's/ * / /g' | cut -d ' ' -f2`
SWAPUSED=$((SWAPTOTAL-SWAPFREE))
DISKUSED=`df / --output=pcent | grep -v "Use" | tr -d ' ','%'`
#USB1USED=`df /mnt/usbstorage --output=pcent | grep -v "Use" | tr -d ' ','%'`
CPUTEMP=`vcgencmd measure_temp | cut -d "=" -s -f2 | cut -d "'" -s -f1`





curl -i -XPOST 'http://192.168.0.95:8086/write?db=serverstats' --data-binary "loadavg,host=octoprint value=$LOADAVG" &>/dev/null
curl -i -XPOST 'http://192.168.0.95:8086/write?db=serverstats' --data-binary "processes,host=octoprint value=$PROCESSES" &>/dev/null
curl -i -XPOST 'http://192.168.0.95:8086/write?db=serverstats' --data-binary "rxbytes,host=octoprint value=$RXBYTES" &>/dev/null
curl -i -XPOST 'http://192.168.0.95:8086/write?db=serverstats' --data-binary "txbytes,host=octoprint value=$TXBYTES" &>/dev/null
curl -i -XPOST 'http://192.168.0.95:8086/write?db=serverstats' --data-binary "memavail,host=octoprint value=$MEMAVAIL" &>/dev/null
curl -i -XPOST 'http://192.168.0.95:8086/write?db=serverstats' --data-binary "swapused,host=octoprint value=$SWAPUSED" &>/dev/null
curl -i -XPOST 'http://192.168.0.95:8086/write?db=serverstats' --data-binary "diskused,host=octoprint value=$DISKUSED" &>/dev/null
#curl -i -XPOST 'http://192.168.0.95:8086/write?db=serverstats' --data-binary "usb1used,host=octoprint value=$USB1USED" &>/dev/null
curl -i -XPOST 'http://192.168.0.95:8086/write?db=serverstats' --data-binary "cputemp,host=octoprint value=$CPUTEMP" &>/dev/null


Thanks but I am using Quick Chart app on Hubitat.

1 Like

Just a curios side question for anyone logging on a C8. Does your C8 run a bit hotter than your C7 did? About 20 degrees hotter?

1 Like

I'd say mine runs roughly the same. May depend on what you are using it for, how you have located it in your home and other environmental factors. That said, 20 degress seems pretty extreme as a difference (though the F and C scales may also play a part in the difference.... ? ).

1 Like

3 Likes

I'm just comparing temps from old to new. Load of apps and devices should be the same historically. New hub is in the same exact spot the old one was.

I'm curious if it's really hotter, or just a different chipset reporting the temp, etc. But I'd think if the later were the case, we'd all see roughly the same thing.

You can see the spike right when I migrated.

image

Hmmm... That does seem odd... and probably worthy of a topic of it's own...

3 Likes

Good point. I made one here if you are curious..

I also noticed the processor load is ever so slightly higher on the new hub as a whole. Maybe some new background process running.

1 Like

Also have a WiFi chip in there now so some extra heat from it…

2 Likes

@thebearmay,
I have set the Zigbee stack on my C7 to standard and rebooted, but Hub Info still shows new?

Hub Info:
image

That attribute was accidently released at one point, but disabled in a subsquent version. I’ll re-enable it and push up a new version.

Edit: v3.0.24 is available

  • Re-enables the zigbeeStack attribute
    • Values standard, new
  • Adds preference input for selecting polling queue for the attribute
5 Likes

FYI.
I just changed my stack and updated your code from HPM.
It says standard but it's new.

Hub is set to use new Zigbee stack. I did do a Refresh before hand.

  • zigbeeEui : 000D6F001635FCD1
  • zigbeeId : 000D6F001635FCD1
  • zigbeeStack : standard
  • zigbeeStatus : enabled
  • zigbeeStatus2 : enabled

I don't see this setting on my c7.. what is it? Are running a beta?