Grabbing persistence value not working

I’m trying to grab the latest value of an item, but I keep getting an error. Tried it with different iterms, they all have values in the db.

part of .rules
logInfo("Meterstanden", MeterElekDag.lastUpdate)
logInfo("Meterstanden", MeterElekDag.previousState)

log message
2017-11-03 10:08:00.884 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'Load meterstanden': An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.LogAction.logInfo(java.lang.String,java.lang.String,java.lang.Object[]) on instance: null

I also trued it with sendCommand, but het the same message.
If I understand it well, it reports that there are no values?

Have you configured any persistence for this ihem?


logInfo("Meterstanden", MeterElekDag.lastUpdate.toString)
logInfo("Meterstanden", MeterElekDag.previousState.toString)

this looks better! The lastupdate output is correct, but the previousState not.

2017-11-03 16:33:46.746 [INFO ] [.smarthome.model.script.Meterstanden] - 2017-11-03T09:58:31.560+01:00
2017-11-03 16:33:46.753 [INFO ] [.smarthome.model.script.Meterstanden] - org.openhab.core.persistence.internal.QueryablePersistenceServiceDelegate$1@12556fe

I changed it to

logInfo(“Meterstanden”, MeterElekDag.previousState.state.toString)

Now I get the correct entry