Systeminfo Problems

Hello,

I have took the Demo project and I wanted to add the CPU-load. But it don’t work and I don’t know what I do wrong…

Can someone help me please? :heart:

2018-03-17%2023_04_07-System

items:

Number CPU_Load "Prozessorlast [%.1f %%]" <CPU> { channel="systeminfo:computer:work:cpu#load"}

things:

systeminfo:computer:work [interval_high=3, interval_medium=60]

sitemap:

    Frame label="Demo" {
		Text item=CurrentDate
		Text label="System" icon="settings" {
			Text item=CPU_Load
		}
		...
	}

Systeminfo Binding is installed.

  • Platform information:
    • OS: Win 10 / Win Server 2016
    • Java Runtime Environment: 8
    • openHAB version: 2.1

Is the Systeminfo-Binding installed?
Does the PaperUI control panel shows the values?

1 Like

Yes, “Systeminfo Binding is installed.” is in my Text.


Are any entries in the log?

1 Like

No, the word “system” is not in the two log files

You use 2.1 and WinServer, but I don’t think that sould be a problem.
Have you restarted openHAB?

1 Like

The Demo is working normaly and I can change these things. But when I add something new, it does not work…

As I don’t use Systeminfo yet, it’s just a guess:
Maybe the keyword Thing is missing?

Thing systeminfo:computer:work [interval_high=3, interval_medium=60]

No, I just tested it… And the Demo Things are also without “Thing”:

yahooweather:weather:berlin [ location=AUXX0025 ]
astro:sun:home   [ geolocation="48.2,16.3667", interval=60 ]
astro:moon:home  [ geolocation="48.2,16.3667", interval=60 ]
ntp:ntp:demo [ hostname="nl.pool.ntp.org", refreshInterval=60, refreshNtp=30 ]

Yes I also restarted it.

Could that be a problem?

71%20-%20Remotedesktopverbindung

Can you find a entry like this for your things-file in your openhab.log?

2018-03-17 23:24:45.067 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘tmp.things’

1 Like

What about this?

1 Like

Yes:

2018-03-17 21:39:40.273 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'demo.things'

And I just see that ERROR:


2018-03-17 23:48:39.567 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id 'rrd4j'
2018-03-17 23:48:39.824 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2018-03-17 23:48:39.925 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.event.EventHandler, org.osgi.service.cm.ManagedService, id=346, bundle=213/mvn:org.openhab.binding/org.openhab.binding.lgtv/1.10.0]: Unexpected problem updating configuration org.openhab.lgtv
java.lang.NullPointerException
	at org.openhab.binding.lgtv.internal.LgtvBinding.updated(LgtvBinding.java:322)[213:org.openhab.binding.lgtv:1.10.0]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1461)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1417)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
	at java.lang.Thread.run(Unknown Source)[:1.8.0_162]
2018-03-17 23:48:39.949 [INFO ] [b.core.service.AbstractActiveService] - IRtrans Refresh Service has been started
2018-03-17 23:49:10.895 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'demo.things' has errors, therefore ignoring it: [1,40]: Number expected.

2018-03-17 23:49:10.908 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'demo.things' has errors, therefore ignoring it: [1,40]: Number expected.

Can you post your demo.things file?
Remove the lg binding

Now it works… I comment the yahooweather out.

//yahooweather:weather:berlin [ location=AUXX0025 ]
astro:sun:home   [ geolocation="48.2,16.3667", interval=60 ]
astro:moon:home  [ geolocation="48.2,16.3667", interval=60 ]
ntp:ntp:demo [ hostname="nl.pool.ntp.org", refreshInterval=60, refreshNtp=30 ]
systeminfo:computer:work [interval_high=3, interval_medium=60]


Bridge fronius:bridge:mybridge [hostname="192.168.222.69",refreshInterval=5] {
    Thing powerinverter myinverter [ deviceId=1 ]
}

// vim: syntax=Xtend

But… the Uptime is a negative Value?!:

Number CPU_Load         "Prozessorlast [%.1f %%]" <CPU> { channel="systeminfo:computer:work:cpu#load"}
Number CPU_Load1                    { channel="systeminfo:computer:work:cpu#load1" }
Number CPU_Load5                    { channel="systeminfo:computer:work:cpu#load5" }
Number CPU_Load15                   { channel="systeminfo:computer:work:cpu#load15" }
Number CPU_Uptime          "UpTime"        { channel="systeminfo:computer:work:cpu#uptime" }

1 Like

Looks like it’s working
Did you have the yahooweather binding installed?

The negative value for uptime is odd…
What system are you using?

Yes I have it installed, but I think I have the ERROR for the Weather…

Win Srv 2016

Also with the JS the Uptime is -32k

To display the uptime in human format instead of minutes I use a javascript transform.

item:

Number LocalComputer_Cpu_SystemUptime "[JS(CPUTime.js):%s]" { channel="systeminfo:computer:work:cpu#uptime" }

Javasccript file: CPUTime.js in the transform folder

/*
Javascript transform function to change the number
of minutes of CPU time from the System Info Binding
into a more readable format
eg: 2365 into '1 day 15 hours 25 minutes

The item in the items file is defined as follow:
Number LocalComputer_Cpu_SystemUptime "[JS(CPUTime.js):%s]"
and linked via PaperUI to the System uptime channel
of the System Info Thing
*/

(function(i) {
    var val = parseInt(i); // The value sent by OH is a string so we parse into an integer
    var days = 0; // Initialise variables
    var hours = 0;
    var minutes = 0;
    if (val >= 1440) { // 1440 minutes in a days
        days = Math.floor(val / 1440); // Number of days
        val = val - (days * 1440); // Remove days from val
    }
    if (val >= 60) { // 60 minutes in an hour
       hours = Math.floor(val /60); // Number of hours
        val = val - (hours * 60); // Remove hours from val
    }
    minutes = Math.floor(val); // Number of minutes

    var stringDays = ''; // Initialse string variables
    var stringHours = '';
    var stringMinutes = '';
    if (days === 1) {
        stringDays = '1 day '; // Only 1 day so no 's'
    } else if (days > 1) {
        stringDays = days + ' days '; // More than 1 day so 's'
    } // If days = 0 then stringDays remains ''

    if (hours === 1) {
        stringHours = '1 hour '; // Only 1 hour so no 's'
    } else if (hours > 1) {
        stringHours = hours + ' hours '; // More than 1 hour so 's'
    } // If hours = 0 then stringHours remains ''

    if (minutes === 1) {
        stringMinutes = '1 minute'; // Only 1 minute so no 's'
    } else if (minutes > 1) {
        stringMinutes = minutes + ' minutes'; // More than 1 minute so 's'
    } // If minutes = 0 then stringMinutes remains ''

    var returnString =  stringDays + stringHours + stringMinutes
    return returnString.trim(); // Removes the extraneous space at the end

})(input)