2015-12-09 17:18:42.386 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule 'Today Water Used': cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.persistence.HistoricItem.getState() on null
My test line is:
logInfo(“Testing”, "Water_Meter = " + Water_Meter.previousState(true).state)
I verified that Water_Meter is being stored in db4o and that is my default persistence for openhab.
“Every rule that has at least one status change event trigger, will have the variable previousState available, which can be used inside the execution block.”