Number Persistence rrd4j

Hello.
Should save the value of a dimmer, but surfing I’ve seen there is a bug, so I’m passing the value of the dimmer to a value.
Still have some probblems.

Here My rule:

rule test_numero
when
Item MyNumb changed
then
var start_val_numb =""
var final_val_numb =""

  start_val_numb = MyNumb.previousState.toString
    logInfo("LORENZO start_val number = ", start_val_numb )

  final_val_numb = MyNumb.state.toString
      logInfo("LORENZO final_val number = ", final_val_numb )

end

then my persistence:

// persistence strategies have a name and a definition and are referred to in the “Items” section
Strategies {
// for rrd charts, we need a cron strategy
everyMinute : “0 * * * * ?”
}

Items {
//DemoSwitch,NoOfLights,Window_GF_Toilet,Heating* : strategy = everyChange, everyMinute, restoreOnStartup
DimmedLight,MyNumb : strategy = everyChange, restoreOnStartup

// let's only store temperature values in rrd
Temperature*,Weather_Chart* : strategy = everyMinute, restoreOnStartup

}

And the log, where unfortunately previous state is equal to current state:

2015-11-14 15:30:14.045 [INFO ] [.s.LORENZO start_val number = ] - Nov 14, 2015 3:30:00 PM: MyNumb -> 58
2015-11-14 15:30:14.083 [INFO ] [.s.LORENZO final_val number = ] - 58
2015-11-14 15:30:24.346 [INFO ] [.s.LORENZO start_val number = ] - Nov 14, 2015 3:30:00 PM: MyNumb -> 83
2015-11-14 15:30:24.348 [INFO ] [.s.LORENZO final_val number = ] - 83

I’m doing for sure a trivial error, someone can show me where ? Is in here " start_val_numb = MyNumb.previousState.toString " ?

Thank you

My rule is now the following:

rule test_numero
when
Item MyNumb changed
then
sendCommand(MyNumb, MyNumb.persist as DecimalType)
var final_val_numb =""
logInfo(“MyNumb.lastUpdate =”, MyNumb.lastUpdate.toString)
logInfo(“MyNumb.previousState =”, MyNumb.previousState.toString)

    logInfo("MyNumb.historicState - 1 secs =", MyNumb.historicState(now.minusSeconds(1)).toString) 
  final_val_numb = MyNumb.state.toString
      logInfo("LORENZO final_val number = ", final_val_numb )

end

I’ve read what is 2183, but still I’m not able to get the value of MyNumb before and after change.

Any Ideas ?

Thank you