System binding is not list CPU

Hi,

I’ve just installed system info binding to create a simple overview page in habpanel. Everything seems to be fine except the CPU monitoring. I would like to show the CPU usage here, but the thing list in Paper UI is not showing the CPU channels only the name. If I create the item based on the documentation it is also returning null as a value. I’ve tried to use the Process part, but these have also issues. The things are listed, but the linked items are returning null.

OH 2.5 (latest) is running on RPI 2 B.

Any ideas?

Thanks,
Attila

The upstream project removed support for that.

Thank Bruce for your answer. You mean for the whole binding or just for the CPU stuff? If yes, then is there any other way to display the CPU utilization in habpanel?

The library that the binding uses to get the information has removed support for the CPU utilization…

You can use a script with

#!/bin/bash

echo $[100-$(vmstat 1 2|tail -1|awk '{print $15}')]

and call this script from the Exec binding or a Rule with executeCommandLine. Note, you can’t call that line directly from the Exec binding because OH doesn’t have a shell so $ and | are meaningless and, in general, it’s much easier to just get this sort of thing working with a script than trying to do so from the Exec binding itself.

1 Like

You can get load averages for the last 1, 5 and 15 minutes (load1, load5 resp load15 channels) but these are hidden, so you need to click “Show more” at the top of the channel list before you can see them.

2 Likes

Thanks guys for the hint, the “show more” solved my issue. That’s much easier for me than running scripts and bash commands (I’m beginner in OH and linux too :))

Thanks,
Attila