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:
Item MyNumb changed
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 )
then my persistence:
// persistence strategies have a name and a definition and are referred to in the “Items” section
// for rrd charts, we need a cron strategy
everyMinute : “0 * * * * ?”
//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 " ?