Hab es jetzt direkt getestet und funktioniert bei mir:
Holger
Code:
rule "zufall licht" when Time cron "0 0 13 * * ?" then var Number rand1 = (Math::random) * 10 if (Abwesenheitssimulation.state == ON { createTimer(now.plusMinutes(rand1.intValue)) [| { var Number rand2 = ((Math::random) * 10) + 15 // 15= mindest Leuchtdauer sendCommand(switch_licht,ON) createTimer(now.plusMinutes(rand2.intValue)) [| { sendCommand(switch_licht,OFF) } ] } ] } end
Kommentar