How to post the event time for each sensor in a multi-sensor event

I want to show the event time in the basicui sitemap, near each event in a multisensor event (my installation is OH2 official release)
I have a motion sensor (Fibaro - FGMS-001) with e.g. temperature, lux and motion sensors

I was able to get a single timestamp for the entire multisensor following the post in here but not a time for every sensor. To get the event time for every sensor, I followed the instructions in here and here

I do get sensor events (note1) but I think that something is not OK with my rule since I’m not seeing any items with update history (see note2).
My items and rules files are in note3, and note4.
As I understand I need a persistence service but I’m not sure if it is set correctly. I do have MapDB (see note5)
But it looks like there are no persisted events?


I was missing the file mapdb.persist. After adding it (note6) I am starting to get update history and the event times are showing in the basicui sitemap


---- note1 - ok - seeing events, e.g. temperature change in the log file

tail -f /var/log/openhab2/events.log
2017-04-15 00:01:53.669 [ItemStateChangedEvent     ] - zwave_device_02710de3_node6_sensor_temperature changed from 22.8 to 22.6

---- note2 - not ok - no events with last update

tail -f /var/log/openhab2/openhab.log
2017-04-14 23:18:11.356 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id 'myopenhab'
2017-04-14 23:48:07.265 [INFO ] [.eclipse.smarthome.model.script.RULE] - --> Fibaro1_LastUpdate executed...
2017-04-14 23:48:07.384 [INFO ] [.eclipse.smarthome.model.script.Test] - There are 0 events that have a last update

---- note3

cat /etc/openhab2/items/fibaro.items
Group gFibaro1Sensors  (All)
Group gFibaro1SensorsTime (All)

Number Fibaro1Lux                          "*Fibaro1 [%.2f Lux]"                        <sun>          (gFibaro1Sensors)           { channel="zwave:device:02710de3:node6:sensor_luminance" }

Number Fibaro1Temp                         "Fibaro1 Temp [%.1f C]"                           <temperature>  (gFibaro1Sensors)           { channel="zwave:device:02710de3:node6:sensor_temperature" }
DateTime Fibaro1Temp_LastUpdate            "Fibaro1 Temp time [%1$tm/%1$td %1$tH:%1$tM]"  <clock>    (gFibaro1SensorsTime)

Switch Fibaro1AlarmMotion                  "Fibaro1 Alarm Motion [%s]"          <fire>                 (gFibaro1Sensors)           { channel="zwave:device:02710de3:node6:alarm_motion" }
DateTime Fibaro1AlarmMotion_LastUpdate     "Fibaro1 Alarm Motion time [%1$tm/%1$td %1$tH:%1$tM]"  <clock>  (gFibaro1SensorsTime)

---- note4

cat /etc/openhab2/rules/fibaro.rules

import org.openhab.core.library.types.DateTimeType
rule "Records when device was last seen"
  Item Fibaro1AlarmMotion received update or
  Item Fibaro1Temp received update or
  Item Fibaro1Lux received update
  logInfo("RULE", "--> Fibaro1_LastUpdate executed...")

  // Get the updated event
  val sensor1 = gFibaro1Sensors.members.filter[s|s.lastUpdate("mapdb") != null].sortBy[lastUpdate("mapdb")].last as Item

  val haveHistory = gFibaro1Sensors.members.filter[l|l.lastUpdate("mapdb") != null]
  logInfo("Test", "There are " + haveHistory.size + " items that have a last update")

  val last = gFibaro1SensorsTime.members.filter[dt | =="_LastUpdate"].head as DateTimeItem
  last.postUpdate(new DateTimeType)

---- note5

cat /etc/openhab2/services/runtime.cfg

cat /etc/openhab2/services/mapdb.cfg
# the commit interval in seconds (optional, default to '5')                                                                                                                                                                                 

# issue a commit even if the state did not change (optional, defaults to 'false')                                                                                                                                                           

---- note6

cat /etc/openhab2/persistence/mapdb.persist
Strategies {
    default = everyChange
Items {
    * : strategy = everyChange