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.
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 {…