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.
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)