Hi all,
Taken my first step into persistance today but it doesn’t seem to be going too well…I wanted to install mapdb so I can use the previous state of my items in rules. Heres what I have done:
- Installed mapdb as per instructions
- restarted OH
- Set up my mapdb.persist file
// mapdb persistence - store every item previous state - restore them on startup
Strategies {
default = everyChange
}
Items {
gMapDB* : strategy = everyChange, restoreOnStartup
}
- Added the gMapDB to an items file
Group gMapDB "gMapDB Presistence"
- Then added the group gMapDB to the items I want to store the previous state, eg
String vGPCurrLoc "Current Location [%s]" (gMapDB)
-
Restarted OH again
-
Made sure the item vGPCurrLoc updated it’s status, (this item actually updates every 5 minutes anyway)
-
Added the following code into a rule
vGPCurrLoc.previousState("mapdb").state.toString
- Am currently getting the following in the log:
Rule 'GP iPhone Location detection': An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.BusEvent.sendCommand(org.eclipse.smarthome.core.items.Item,org.eclipse.smarthome.core.types.Command) on instance: null
Now that reads to me like the item previous state is null, ie it hasn’t been assigned a value yet…
I know it has certainly updated so I’d expect to see something in there.
Does anyone have any ideas or pointers please???