var pwr = (PwrCounter.historicState(now.toDateMidnight, "rrd4j").state as DecimalType
2015-05-02 23:55:03.243 [ERROR] [.o.m.r.i.engine.ExecuteRuleJob] - Error during the execution of rule Counters plus
java.lang.NullPointerException: cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.persistence.HistoricItem.getState() on null
--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab/efaa23a7-a5d4-43e2-b0ce-963351932d7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
rule "Counters plus"
when
Time cron "0 * * * * ?"
then
if (PwrCounter.historicState(now.toDateMidnight, "rrd4j").state != null) {
var pwr = (PwrCounter.historicState(now.toDateMidnight, "rrd4j").state as DecimalType
logInfo("PwrCounter.historicState="+ pwr.toString)
}
end
2015-05-03 23:27:03.737 [ERROR] [.o.m.r.i.engine.ExecuteRuleJob] - Error during the execution of rule Counters plus
java.lang.NullPointerException: null
at org.openhab.model.script.lib.NumberExtensions.operator_notEquals(NumberExtensions.java:89) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_79]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_79]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_79]
......