Rule to update an item

i had to to make a cron script to stop/start openhab every day at 03:00, i have a memory leakage wich results in openhab freeze

because of that my Alarm clock rule wont trigger

i have mapdb.persist

how do i update the items “AlarmTimme” and “AlarmMinute” on system startup?
so my alarm rule activates

rule "AlarmTid"
when
Item AlarmTimme changed or
Item AlarmMinute changed
then
// If the UI to change the Alarm time is clicked several times the code below
// is subject to race conditions. Therefore we make sure that all events
// are processed one after the other.
lock1.lock()
try {
var String msg = “”

// Copy the Alarm-Time from the UI to local variables
var timme = AlarmTimme.state as DecimalType
var minut = AlarmMinute.state as DecimalType



did you set up mapdb to restore your Items at startup? Then in Case of Systemstartup, you should build a rule which triggers at startup and updates the vars as necessary. Maybe you need some time to wait from ruletrigger to correct itemstates, you could use Thread::sleep(1000) for waiting a Second before updating.

Hi Nikola,
Just out of curiousity, do you use an arm based processor and openJDK?
Cheers
Björn
PS: I am asking because of your memory leak.

yes i use restore in mapdb, didn´t work

after a whole lot tinkering i got it to work

rule "Initialization"
when
System started
then
if
(AlarmON.state == ON)
{
sendCommand(AlarmON, OFF)
sendCommand(AlarmON, ON)
}
else
sendCommand(AlarmON, OFF)
end

rule "AlarmTid"
when
Item AlarmON received update ON
then
lock1.lock()
try {…

i use an Rasberry Pi2 and Rasbian Jessie Full
Openhab 1.8.1

i read somewhere that the memory leak was caused by the Sonos addon