SystemInfo Channels not Updating Frequently (only some)

I got the SystemInfo binding to work. Some channels update very frequently (obey the interval set below), and some update every few hours if that. There are no errors in the log that indicate any issue.

I’m verifying this via the logs with lines like this:

2020-02-21 18:05:12.546 [vent.ItemStateChangedEvent] - openhab1_CPU_Load1 changed from 0.1 to 0.0

Any ideas what could be wrong? Could this be because those values aren’t changing? If so, is there a way to force update even if the value is the same as the previous value? Thanks!

Channels that update frequently:

systeminfo:computer:openhab1:sensors#cpuTemp
systeminfo:computer:openhab1:cpu#uptime
systeminfo:computer:openhab1:memory#usedPercent
systeminfo:computer:openhab1:cpu#load1

Channels that don’t update frequently:

systeminfo:computer:openhab1:storage#usedPercent
systeminfo:computer:openhab1:swap#usedPercent

Things File: (I tried both)

Thing systeminfo:computer:openhab1	@ "Home"	[interval_high=5, interval_medium=5]
//Thing systeminfo:computer:openhab1	@ "Home"	[interval_high=5, interval_medium=5] { Channels: Type usedPercent : storage#usedPercent [priority="High"] }

Items File:

Number openhab1_CPU_Uptime			"openHAB1 Uptime"							<time> 			(Devices,Influx)	{channel="systeminfo:computer:openhab1:cpu#uptime"}
Number openhab1_CPU_Load1			"openHAB1 CPU Load (1 min)  [%s]"			<none> 			(Devices,Influx)	{channel="systeminfo:computer:openhab1:cpu#load1"}
Number openhab1_CPU_TempC			"openHAB1 CPU Temp (C) [%s]"				<temperature>						{channel="systeminfo:computer:openhab1:sensors#cpuTemp"}
Number openhab1_Memory_Used_Per		"openHAB1 Mem Used (%) [%s]"				<none> 			(Devices,Influx)	{channel="systeminfo:computer:openhab1:memory#usedPercent"}
Number openhab1_Storage_Used_Per	"openHAB1 Storage Used (%)"					<none> 			(Devices,Influx)	{channel="systeminfo:computer:openhab1:storage#usedPercent"}
Number openhab1_Swap_Used_Per		"openHAB1 Swap Used (%)"					<none> 			(Devices,Influx)	{channel="systeminfo:computer:openhab1:swap#usedPercent"}

Have you tried to use different ( not the same for both entries ) values for interval_high and interval_medium ?

Yes. Obviously tried rebooting as well. Forgot to mention: openhab ver 2.5.1

You’ve neglected to check the logs.

Negative. Been watching openhab logs via tail viewer website for hours… Unless you mean a different log? In openhab logs I see the working devices reporting VERY frequently, but the infrequent ones, not so much.

Have you tried to create a test case that increases the disk/storage usage ? E.g. create a file that occupies +10% of the free disk space.

I have not, but that would then align with my theory that it doesn’t update if the value doesn’t change - is that a known “feature”?

This is the way how I would analyze the problem. As I do not make use of this binding I do not know if it’s implemented in the way how you describe it.

…Nonetheless good idea :slight_smile:

So I did as you suggested copy copied some large test files onto the Pi and sure enough it triggered the “systeminfo:computer:openhab1:storage#usedPercent” update event:

2020-02-22 09:08:01.595 [vent.ItemStateChangedEvent] - openhab1_Storage_Used_Per changed from 8.9 to 9.1

So it does in fact appear that it only updates when the value changes - I’m not sure I like this though. At least it’s a known “feature” now…

I’ll do more testing later…

Thanks for the feedback!

How are you determining whether it not the items are updating? Not that updates do not appear in events.log, only commands and changes.

So, unless you have a received update triggered rule to log about it, you would not see any evidence that the items are updating by default.

Check my posts above re: logged events. CPU, for example, is very active, storage is not. The test where I copied large files did in fact trigger the update which was revealed in the logs instantly. So the determination via the logs is accurate.

Via testing it was revealed that events are only triggered when there is a change. I’m wondering if this is a bug or by design.

No, you saw it in the logs because their value changed. When an oitem receives an update to the value it already has, there is no entry in the logs to show the update. But the update did happen. Only changes or commands get logged in events.log.

Lack of log entries does not indicate lack of activity. To see updates, even when the update is to the same value, you need to use a rule with a log statement.

Ok. I didn’t understand you at first, but after reading it a few times I get it now: the logs only show changes, not updates! I think I missed it at first because that doesnt make a lot of sense to me, but that’s ok.

I added a rule for testing and see it is in fact updating. Oddly enough it should be updating every 5 seconds, but it’s only updating every 60 seconds but that’s good enough.

My thing:

Thing systeminfo:computer:openhab1		@ "Home"	[interval_high=5, interval_medium=5] {Channels:
	Type usedPercent : storage#usedPercent [priority="High"]
	Type usedPercent : swap#usedPercent [priority="High"]
}

Test Rule:

rule "Test1"
when
	Item openhab1_Swap_Used_Per received update
then
	logError("Test.rules", "***Test" + " -- openhab1_Swap_Used_Per updated")
end

:slight_smile: